Package: securetea
OWASP SecureTea Tool ProjectUser GuideRead developer guidehere.IntroductionThe OWASP SecureTea Project provides a one-stop security solution for various devices (personal computers / servers / IoT devices).InstallationContents:Pre-requisitesProcedure for installingAfter installationPre-requisitesSupported PlatformsOWASP SecureTea Tool project runs on Linux, Windows and macOS operating systems. It is compatible with both Python 2 and Python 3.HardwareLinux OS / Raspberry Pi - havesudoaccess on the terminal/consoleMouse / Wireless Mouse / Touchpad congenital laptopSoftwarePython 2.x or 3.xAngularTwitter account (optional)Telegram account (optional)Slack account (optional)Twilio SMS account (optional)Amazon Web Services account (optional)LibnetfilterInstalling pre-requisitesPython:https://www.python.org/Angular:https://angular.io/Libnetfilter:https://www.netfilter.org/projects/libnetfilter_queue/$sudoapt-getupdate
$sudoapt-getinstallbuild-essentialpython-devlibnetfilter-queue-devYara:https://yara.readthedocs.io/en/v3.7.0/gettingstarted.htmlDownload the latest Yara release at:https://github.com/VirusTotal/yara/releasesExecute the following instructions in the order:$tar-zxfyara-3.10.0.tar.gz
$cdyara-3.10.0
$./bootstrap.sh
$sudoapt-getinstallautomakelibtoolmakegcc
$sudoapt-getinstallflexbison
$./configure
$make
$sudomakeinstall
$makecheckClam AV:https://www.clamav.net/Execute the following instructions in the order:$sudoapt-getinstallclamav
$sudofreshclamProcedure for installingYou can install OWASP SecureTea Tool using the following methods:PyPiGitHubZipSetting up a virtual environmentInstall virtualenv:$ pip install virtualenvCreate a virtual environment namedvenv1:$ virtualenv venv1Activate virtual environmentvenv1:$ source venv1/bin/activatePyPiYou can install SecureTea from PyPi package manager using the following command:$ sudo python3 -m pip install secureteaPlease make sure all dependencies are installed if this fails.GitHubInstalling from GitHub involves the following steps:Clone the repository:$ git clone https://github.com/OWASP/SecureTea-Project.gitNavigate into the project directory:$ cd SecureTea-ProjectInstall Python dependencies:$ sudo python3 -m pip install -r requirements.txtInstall SecureTea package:$ sudo python3 setup.py installIf done, proceed to After installation.ZipInstalling from Zip involves the following steps:Download thezip.Unzip using:$ unzip master.zipNavigate into the project directory:$ cd SecureTea-ProjectInstall python dependencies:$ sudo python3 -m pip install -r requirements.txtInstall SecureTea package:$ sudo python3 setup.py installTip: Incase of any error during installation related to NetfilterQueue, try using$ sudo apt-get install build-essential python-dev libnetfilter-queue-devto resolve the error.If done, proceed to After installation.After installationConfiguring SecureTeaEditing the configurations using a text-editorDefault configuration:{"twitter":{"api_key":"XXXX","api_secret_key":"XXXX","access_token":"XXXX","access_token_secret":"XXXX"},"telegram":{"token":"XXXX","user_id":"XXXX"},"twilio":{"twilio_sid":"XXXX","twilio_token":"XXXX","twilio_from":"XXXX","twilio_to":"XXXX"},"slack":{"token":"XXXX","user_id":"XXXX"},"aws_ses":{"aws_email":"XXXX","aws_access_key":"XXXX","aws_secret_key":"XXXX"},"gmail":{"sender_email":"XXXX","to_email":"XXXX","password":"XXXX"},"firewall":{"interface":"","inbound_IPRule":{"action":"0","ip_inbound":""},"outbound_IPRule":{"action":"0","ip_outbound":""},"protocolRule":{"action":"0","protocols":"ICMP"},"scanLoad":{"action":"0","extensions":".exe"},"source_portRule":{"action":"0","sports":""},"dest_portRule":{"action":"0","dports":""},"HTTPRequest":{"action":"0"},"HTTPResponse":{"action":"0"},"DNSRule":{"action":"0","dns":""},"time":{"time_lb":"00:00","time_ub":"23:59"}},"insecure_headers":{"url":""},"ids":{"threshold":10,"interface":"XXXX"},"server_log":{"log_type":"","log_file":"","window":"30","ip_list":"","status_code":""},"auto-server-patcher":{"url":"XXXX","apache":"1","sysctl":"1","login":"1","ssh":"1"},"antivirus":{"update":"1","custom-scan":"","auto-delete":"0","monitor-usb":"1","monitor-file-changes":"1","virustotal-api-key":"XXXX"},"web-deface":{"path":"","server-name":""},"iot-check":{"shodan-api-key":"XXXX","ip":""},"debug":false}Using geditgedit securetea.confUsing vimvi securetea.confConfiguring using interactive setup modeSetup all the featuresStart SecureTea without any parameters:sudo SecureTea.pyThis will start an interactive setup mode, to skip a particular setup, enter s or S.Setup a particular featureArguments list--telegram     Start Telegram interactive setup
--twitter      Start Twitter interactive setup
--twilio_sms   Start Twilio SMS interactive setup
--firewall     Start Firewall interactive setup
--aws_ses      Start Amazon Web Services(AWS-Simple Email Services) interactive setup
--gmail        Start G-Mail interactive setupExamples:Starting SecureTea-Firewall interactive setup:sudo SecureTea.py --firewallStarting Telegram & Twitter interactive setup:sudo SecureTea.py --telegram --twitterConfiguring using Web UIUsing local web server over HTTPSPreviewsConfiguring using CLI argumentsusage: SecureTea.py [-h] [--conf CONF] [--debug] [--twitter] [--twilio_sms]
                    [--telegram] [--gmail] [--slack] [--aws_ses]
                    [--twitter_api_key TWITTER_API_KEY]
                    [--twitter_api_secret_key TWITTER_API_SECRET_KEY]
                    [--twitter_access_token TWITTER_ACCESS_TOKEN]
                    [--twitter_access_token_secret TWITTER_ACCESS_TOKEN_SECRET]
                    [--telegram_bot_token TELEGRAM_BOT_TOKEN]
                    [--telegram_user_id TELEGRAM_USER_ID]
                    [--twilio_sid TWILIO_SID] [--twilio_token TWILIO_TOKEN]
                    [--twilio_from TWILIO_FROM] [--twilio_to TWILIO_TO]
                    [--slack_token SLACK_TOKEN]
                    [--slack_user_id SLACK_USER_ID]
                    [--sender_email SENDER_EMAIL] [--to_email TO_EMAIL]
                    [--password PASSWORD] [--aws_email AWS_EMAIL]
                    [--aws_secret_key AWS_SECRET_KEY]
                    [--aws_access_key AWS_ACCESS_KEY] [--firewall]
                    [--interface INTERFACE]
                    [--inbound_IP_action INBOUND_IP_ACTION]
                    [--inbound_IP_list INBOUND_IP_LIST]
                    [--outbound_IP_action OUTBOUND_IP_ACTION]
                    [--outbound_IP_list OUTBOUND_IP_LIST]
                    [--protocol_action PROTOCOL_ACTION]
                    [--protocol_list PROTOCOL_LIST]
                    [--scan_action SCAN_ACTION] [--scan_list SCAN_LIST]
                    [--dest_port_action DEST_PORT_ACTION]
                    [--dest_port_list DEST_PORT_LIST]
                    [--source_port_action SOURCE_PORT_ACTION]
                    [--source_port_list SOURCE_PORT_LIST]
                    [--HTTP_request_action HTTP_REQUEST_ACTION]
                    [--HTTP_response_action HTTP_RESPONSE_ACTION]
                    [--dns_action DNS_ACTION] [--dns_list DNS_LIST]
                    [--time_lb TIME_LB] [--time_ub TIME_UB]
                    [--insecure_headers] [--url URL] [--ids]
                    [--threshold THRESHOLD] [--system_log] [--server_log]
                    [--log_file LOG_FILE] [--log_type LOG_TYPE]
                    [--window WINDOW] [--ip_list IP_LIST]
                    [--status-code STATUS_CODE] [--auto-server-patcher]
                    [--ssh] [--sysctl] [--login] [--apache] [--ssl]	
		    [--antivirus] [--update UPDATE]
                    [--custom-scan CUSTOM_SCAN] [--auto-delete]
                    [--monitor-usb] [--monitor-file-changes]
                    [--virustotal-api-key]
                    [--web-deface] [--path PATH] [--server-name SERVER_NAME]	
		    [--iot-checker][--shodan-api-key SHODAN_API_KEY] [--ip IP]Example usage:Configuring Slack:sudo SecureTea.py --slack_user_id <your data> --slack_token <your data>Setting up Web UIFollow the following steps to setup Web UIcd guinpm installng servesudo python monitor.pyVisithttp://localhost:4200to view your project, END-POINT ishttp://localhost:5000.Getting tokensIn order to use the various communication medium you need to get yourself a verified token from the respective provider.Getting Twitter tokensVisithttps://apps.twitter.com.Create new app to obtain authentication and token codes.Getting Slack tokensVisithttps://api.slack.com/apps/newand create a new bot app.In the bot app settings, setup event subscriptions by Enabling Events.Install the bot app in the workspace required.Get the "Bot User OAuth Access Token", it starts withxoxb-Get your user id for the particular workspace.Getting Telegram tokensVisithttps://core.telegram.org/bots#botfather& follow the steps to obtain Telegram token & user id.Getting Twilio SMS tokensVisithttps://www.twilio.comand click on "Get a free API key".Getting AWS-SES tokensSign up for AWShttps://aws.amazon.com/(For new users)Search for Simple Email Service in search bar of AWSSelect your AWS region accordingly( e.g, US East)Click on email address and verify your emailClick on "My security credentials"Click "Get started with IAM users" and add a new user(You can use root user's access code too ,but that would be insecure.)Click on the username of just created userClick "Security Credentials" and note down your "Access Key ID(aws_access_key)" and "Secret Access Key(aws_secret_kay)".
Warning: Do not share this keys for security reasons.Put those keys and email into 'SecureTea.conf' file.Getting Gmail tokensSign up for a Gmail accounthttps://mail.google.com(for new users)Go to "Accounts" and proceed to "Security" dashboardTurn on "Less secure app access" to allow SecureTea be able to send emailsProceed tohttps://accounts.google.com/DisplayUnlockCaptchaand click on Continue, and then allowPut your sender email ID, password and destination email ID in thesecuretea.conffile.UsageThe following argument options are currently available:-h, --help           show this help message and exit
  --conf CONF           Path of config file. default:-
                        "~/.securetea/securetea.conf"
  --debug               Degug true or false
  --twitter             Setup twitter credentials
  --twilio_sms          Setup twilio SMS credentials
  --telegram            Setup telegram SMS credentials
  --gmail               Setup Gmail credentials
  --slack               Setup Slack credentials
  --aws_ses             Setup AWS SES credentials
  --twitter_api_key TWITTER_API_KEY, -tak TWITTER_API_KEY
                        Twitter api key
  --twitter_api_secret_key TWITTER_API_SECRET_KEY, -tas TWITTER_API_SECRET_KEY
                        Twitter api secret
  --twitter_access_token TWITTER_ACCESS_TOKEN, -tat TWITTER_ACCESS_TOKEN
                        Twitter access token
  --twitter_access_token_secret TWITTER_ACCESS_TOKEN_SECRET, -tats TWITTER_ACCESS_TOKEN_SECRET
                        Twitter access token secret
  --telegram_bot_token TELEGRAM_BOT_TOKEN, -tbt TELEGRAM_BOT_TOKEN
                        Telegram Bot Token
  --telegram_user_id TELEGRAM_USER_ID, -tui TELEGRAM_USER_ID
                        Telegram user id
  --twilio_sid TWILIO_SID, -tws TWILIO_SID
                        Twilio SID
  --twilio_token TWILIO_TOKEN, -twt TWILIO_TOKEN
                        Twilio authorization token
  --twilio_from TWILIO_FROM, -twf TWILIO_FROM
                        Twilio (From) phone number
  --twilio_to TWILIO_TO, -twto TWILIO_TO
                        Twilio (To) phone number
  --slack_token SLACK_TOKEN, -st SLACK_TOKEN
                        Slack token
  --slack_user_id SLACK_USER_ID, -suid SLACK_USER_ID
                        Slack user id
  --sender_email SENDER_EMAIL
                        Gmail sender e-mail id
  --to_email TO_EMAIL   Destination of e-mail
  --password PASSWORD   Password for Gmail sender account
  --aws_email AWS_EMAIL, -awse AWS_EMAIL
                        AWS email id
  --aws_secret_key AWS_SECRET_KEY, -awss AWS_SECRET_KEY
                        AWS secret key
  --aws_access_key AWS_ACCESS_KEY, -awsa AWS_ACCESS_KEY
                        AWS access key
  --firewall, -f        Start firewall
  --interface INTERFACE
                        Name of the interface
  --inbound_IP_action INBOUND_IP_ACTION
                        Inbound IP rule action
  --inbound_IP_list INBOUND_IP_LIST
                        List of inbound IPs to look for
  --outbound_IP_action OUTBOUND_IP_ACTION
                        Outbound IP rule action (0: BLOCK, 1: ALLOW)
  --outbound_IP_list OUTBOUND_IP_LIST
                        List of outbound IPs to look for
  --protocol_action PROTOCOL_ACTION
                        Protocol action (0: BLOCK, 1: ALLOW)
  --protocol_list PROTOCOL_LIST
                        List of protocols to look for
  --scan_action SCAN_ACTION
                        Scan load action (0: BLOCK, 1: ALLOW)
  --scan_list SCAN_LIST
                        List of extensions to scan for
  --dest_port_action DEST_PORT_ACTION
                        Destination port action (0: BLOCK, 1: ALLOW)
  --dest_port_list DEST_PORT_LIST
                        List of destination ports to look for
  --source_port_action SOURCE_PORT_ACTION
                        Source port action (0: BLOCK, 1: ALLOW)
  --source_port_list SOURCE_PORT_LIST
                        List of source ports to look for
  --HTTP_request_action HTTP_REQUEST_ACTION
                        HTTP request action (0: BLOCK, 1: ALLOW)
  --HTTP_response_action HTTP_RESPONSE_ACTION
                        HTTP response action (0: BLOCK, 1: ALLOW)
  --dns_action DNS_ACTION
                        DNS action (0: BLOCK, 1: ALLOW)
  --dns_list DNS_LIST   List of DNS to look for
  --time_lb TIME_LB     Time lower bound
  --time_ub TIME_UB     Time upper bound
  --insecure_headers, -ih
                        Test URL for insecure headers
  --url URL, -u URL     URL on which operations are to be performed
  --ids                 Start Intrusion Detection System (IDS)
  --threshold THRESHOLD, -th THRESHOLD
                        Intrusion Detection System (IDS) threshold
  --system_log, -sys_log
                        Start system log monitoring process
  --server_log          Start server log monitoring process
  --log_file LOG_FILE   Path of the log file
  --log_type LOG_TYPE   Type of the log file (Apache/Nginx)
  --window WINDOW       Days old log to process
  --ip_list IP_LIST     List of IPs to grab from log file
  --status_code STATUS_CODE
                        List of status code to grab from log file
  --auto-server-patcher, -asp
                        Start auto server patcher
  --ssh                 Patch SSH config
  --sysctl              Patch system configuration
  --login               Patch login configuration
  --apache              Patch apache configuration
  --ssl                 Scan for SSL vulnerability
  --antivirus           Start AntiVirus
  --update UPDATE       Auto-update AntiVirus or not (1: yes, 0: no)
  --custom-scan CUSTOM_SCAN
			Path to custom scan
  --auto-delete         Auto delete malicious files or manually (1: auto, 0:
			manual)
  --monitor-usb         Monitor USB devices or not (1: yes, 0: no)
  --monitor-file-changes
			Monitor file changes or not (1:yes, 0:no)
  --virustotal-api-key  Virus Total API key  
  --web-deface          Start Web Deface Detection
  --path PATH           Path of the directory
  --server-name SERVER_NAME
                        Name of the server (apache/nginx/etc.)
  --iot-checker, -ic    Start IoT Anonymity Checker
  --shodan-api-key SHODAN_API_KEY, -sak SHODAN_API_KEY
                        Shodan API Key
  --ip IP               IP address on which to perform operationExample usagesStarting Twitter notifierUsage:sudo SecureTea.py --twitter_api_key <data> --twitter_api_secret_key <data> --twitter_access_token <data> --twitter_access_token_secret <data>Starting Slack notifierUsage:sudo SecureTea.py --slack_token <data> --slack_user_id <data>Starting Telegram notifierUsage:sudo SecureTea.py --telegram_bot_token <data> --telegram_user_id <data>Starting Twilio notifierUsage:sudo SecureTea.py --twilio_sid <data> --twilio_token <data> --twilio_from <data> --twilio_to <data>Starting FirewallUsage:sudo SecureTea.py --interface <data> --inbound_IP_action <data> --inbound_IP_list <data> --outbound_IP_action <data> --outbound_IP_list <data> --protocol_action <data> --protocol_list <data> --scan_action <data> --scan_list <data> --dest_port_action <data> --dest_port_list <data> --source_port_action <data> --source_port_list <data> --HTTP_request_action <data> --HTTP_response_action <data> --dns_action <data> --dns_list <data> --time_lb <data> --time_ub <data>Starting AWS-SESUsage:sudo SecureTea.py --aws_ses <data> --aws_email <data> --aws_access_key <data> --aws_secret_key <data>Setting up notifiersSetting up TwitterExample usage:1. Using interactive setupsudo SecureTea.py --twitter2. Argument listArgumentDefault valueDescription--twitter_api_keyXXXXTwitter API key--twitter_api_secret_keyXXXXTwitter API Secret Key--twitter_access_tokenXXXXTwitter Access Token--twitter_access_token_secretXXXXTwitter Access Token SecretSetting up SlackExample usage:1. Using interactive setupsudo SecureTea.py --slack2. Argument listArgumentDefault valueDescription--slack_tokenXXXXSlack Token--slack_user_idXXXXSlack User IDSetting up Amazon SESExample usage:1. Using interactive setupsudo SecureTea.py --aws_ses2. Argument listArgumentDefault valueDescription--aws_emailXXXXAWS SES Email--aws_secret_keyXXXXAWS SES Secret Key--aws_access_keyXXXXAWS SES Access KeySetting up GmailExample usage:1. Using interactive setupsudo SecureTea.py --gmail2. Argument listArgumentDefault valueDescription--to_emailXXXXG-mail To E-mail--sender_emailXXXXG-mail From E-mail--passwordXXXXG-mail App PasswordSetting up TelegramExample usage:1. Using interactive setupsudo SecureTea.py --telegram2. Argument listArgumentDefault valueDescription--telegram_bot_tokenXXXXTelegram Bot Token--telegram_user_idXXXXTelegram User IDSetting up SMSExample usage:1. Using interactive setupsudo SecureTea.py --twilio_sms2. Argument listArgumentDefault valueDescription--twilio_sidXXXXTwilio SID--twilio_tokenXXXXTwilio Token--twilio_fromXXXXTwilio From Phone No.--twilio_toXXXXTwilio To Phone No.Setting up FirewallExample usage:1. Using interactive setupsudo SecureTea.py --firewall2. Argument listArgumentDefault valueDescription--interfaceNoneName of theinterface--inbound_IP_action0Inbound IP rule action (0: BLOCK, 1: ALLOW)--inbound_IP_listNoneList of inbound IPs to look for--outbound_IP_action0Outbound IP rule action (0: BLOCK, 1: ALLOW)--outbound_IP_listNoneList of outbound IPs to look for.--protocol_action0Protocol action (0: BLOCK, 1: ALLOW)--protocol_listNoneList of protocols to look for--scan_action0Scan load action (0: BLOCK, 1: ALLOW)--scan_listNoneList of extensions to scan for--dest_port_action0Destination port action (0: BLOCK, 1: ALLOW)--dest_port_listNoneList of destination ports to look for--source_port_action0Source port action (0: BLOCK, 1: ALLOW)--source_port_listNoneList of source ports to look for--HTTP_request_action0HTTP request action (0: BLOCK, 1: ALLOW)--HTTP_response_actionNoneHTTP response action (0: BLOCK, 1: ALLOW)--dns_action0DNS action (0: BLOCK, 1: ALLOW)--dns_listNoneList of DNS to look for--time_lb00:00Time lower bound--time_ub23:59Time upper boundSetting up Intrusion Detection SystemExample usage:1. Using interactive setupsudo SecureTea.py --ids2. Argument listArgumentDefault valueDescription--threshold10Intrusion Detection System (IDS) threshold--interfaceNoneName of theinterfaceWhat arethresholds?It simply represents the number of times you want to ignore the possibility of an attack. In other words, it is the extent to which IDS will not bother to inform you about the attack, once it crosses the limit (here threshold), it will start notifying you about the possible attack. Lower the number is, the more sensitive IDS is, and may also give rise to false alarms. Higher the number is, the less sensitive IDS is, it may give rise to less false positives but at the same time choosing a very high number is not suggested either. Choose a mid range number within (10-100) to be on the safer side while keeping alarms of false positives to the minimal.Setting up Insecure HeadersExample usage:1. Using interactive setupsudo SecureTea.py --insecure_headers2. Argument listArgumentDefault valueDescription--urlNoneURL on which operations are to be performedSetting up Server Log MonitorExample usage:1. Using interactive setupsudo SecureTea.py --server-log2. Argument listArgumentDefault valueDescription--log-fileXXXXPath of the log file--log-typeXXXXType of the log file (Apache/Nginx)--windowXXXXDays old log to process--ip-listXXXXList of IPs to grab from log file--status-codeXXXXList of status code to grab from log fileSetting up System Log MonitorExample usage:1. Using interactive setupsudo SecureTea.py --system_log2. Argument listNo optional arguments.Setting up Auto Server PatcherExample usage:1. Using interactive setupsudo SecureTea.py --auto-server-patcheror:sudo SecureTea.py -asp2. Argument listArgumentDefault valueDescription--urlXXXXURL for SSL scanning--apache1Patch apache configuration or not (0:no, 1:yes)--sysctl1Patch system configuration or not (0:no, 1:yes)--login1Patch login configuration or not (0:no, 1:yes)--ssh1Patch SSH configuration or not (0:no, 1:yes)--ssl1Scan for SSL vulnerabilitySetting up AntiVirusExample usage:1. Using interactive setupsudo SecureTea.py --antivirus2. Argument listArgumentDefault valueDescription--update1Auto update ON (1) or OFF (0)--custom-scanNonePath of the directory to custom scan--auto-delete0Auto clean the found malicious files (1) or manually (0)--monitor-usb1Monitor USB devices or not (1:yes, 0:no)--monitor-file-changes1Monitor files changes or addition (1:yes, 0:no)--virustotal-api-keyXXXXVirusTotal API keySetting up Web Deface DetectionExample usage:1. Using interactive setupsudo SecureTea.py --web-deface2. Argument listArgumentDefault valueDescription--pathNonePath of the directory--server-nameNoneName of the server (apache/nginx/etc.)Setting up IoT Anonymity CheckerExample usage:1. Using interactive setupsudo SecureTea.py --iot-checkersudo SecureTea.py -ic2. Argument listArgumentDefault valueDescription--shodan-api-keyXXXXShodan API Key--ipNoneIP address on which to perform operationStarting up modesStarting up in server modeIntegrations (features) of server modeFirewallServer Log MonitorAntiVirusSystem Log MonitorIntrusion Detection System (IDS)Auto Server PatcherWeb Deface DetectionExample usage:1. Non-debug modesudo SecureTea.py --server-mode1. Debug modesudo SecureTea.py --server-mode --debugUpon this, it will ask whether to load the previously saved configurations or enter a new one. Choosing to go with a new configuration will start an interactive setup of the respected modules. Also, user can skip any module among the above 7 modules.It makes a lot easier to configure SecureTea, with server mode they can easily secure their servers. You need to bother about the various arguments or the toughness of setting up SecureTea individual modules. Also, since you can skip any module among the above 7, it is not necessary to configure them all.Starting up in system modeIntegrations (features) of system modeFirewallAntiVirusSystem Log MonitorIntrusion Detection System (IDS)Example usgae:1. Non-debug modesudo SecureTea.py --system-mode1. Debug modesudo SecureTea.py --system-mode --debugUpon this, it will ask whether to load the previously saved configurations or enter a new one. Choosing to go with a new configuration will start an interactive setup of the respected modules. Also, user can skip any module among the above 4 modules.It makes a lot easier to configure SecureTea, with system mode they can easily secure their systems (PC / laptops). You need to bother about the various arguments or the toughness of setting up SecureTea individual modules. Also, since you can skip any module among the above 4, it is not necessary to configure them all.Starting up in IoT modeIntegrations (features) of IoT modeFirewallIntrusion Detection System (IDS)IoT Anonymity CheckerExample usgae:1. Non-debug modesudo SecureTea.py --iot-mode1. Debug modesudo SecureTea.py --iot-mode --debugUpon this, it will ask whether to load the previously saved configurations or enter a new one. Choosing to go with a new configuration will start an interactive setup of the respected modules. Also, user can skip any module among the above 3 modules.It makes a lot easier to configure SecureTea, with IoT mode they can easily secure their IoT devices. You need to bother about the various arguments or the toughness of setting up SecureTea individual modules. Also, since you can skip any module among the above 3, it is not necessary to configure them all.FirewallSecureTea Firewall currently uses the following rules to filter the incoming traffic:Process 1 (Firewall Engine):Filter packets based on:Inbound IP rulesOutbound IP rulesSource port rulesDestination port rulesProtocolsScan for downloads in HTTP websitesDNS filter rulesFilter HTTP request & responseIP packet first fragmentIP packet fragment boundaryIP packet fragment small offsetUnknown IP versionInvalid IP sourceInvalid IP header lengthNetwork congestion detectionEnding FIN-ACK handshakesTCP Packet with None flagSYN fragmentationICMP fragmentation attackLarge ICMP packetsApart from that, the background process deals with the following functions:Process 2 (Firewall Monitor):Monitor open portsMonitor active servicesMonitor network usageMonitor active CPU processGenerate report about the malicious IP address using OSINT toolsThe report will contain the following fields:Reverse DNSGeo lookupWHOIS lookupOther important detailsIntrusion Detection SystemSecureTea Intrusion Detection System (IDS) deals with the following attack vectors and logs any abnormalities:Detect probe (reconnaissance) attacks (performed for information gathering)General scans: TCP ACK & TCP Window, UDP, ICMP scansStealth scans: FIN, XMAS, NULL scansOS fingerprinting scansDetect Denial of Service (DoS) & Remote to Local (R2L) attacksDoS attacksCAM Table ExhaustionDHCP ExhaustionMan in The Middle (MiTM) / ARP cache poisoningSYN flood attackPing of deathLand attackWirelessDeauthentication attackHidden node attackSSID spoofingFake access pointGenerate report about the malicious IP address using OSINT toolsThe report will contain the following fields:Reverse DNSGeo lookupWHOIS lookupOther important detailsInsecure HeadersCheck/monitor the website for the followings:X-XSS-ProtectionX-Content-TypeStrict Transport SecurityContent Security PolicyX-FrameHTTP methodsTest all methods - 'GET', 'POST', 'PUT', 'DELETE', 'OPTIONS', 'TRACE', 'TEST'Cross Site Tracing vulnerabilityCheck for cookie detailsSystem Log MonitorSystem log aggregator to disparate log files, organize the useful data and apply intelligence to detect intrusion activities.a. Log file :/etc/passwd&/etc/shadowDetect backdoorsDetect user existing without a password that may lead to privilege escalationCheck integrity of system's password storingDetect non-standard hashing algorithm used in passwords to guess system manipulationb. Log file:/var/log/auth.log&/var/log/faillogDetect system login attemptsDetect password brute-forceDetect harmful commands executed as rootDetect port scansDetect SSH login attempts & brute-forcec. Log file:/var/log/syslogDetect malicious sniffer by extracting PROMISC modeServer Log MonitorSystem log aggregator to disparate server log files, organize the useful data and apply intelligence to detect intrusion activities.Currently, the server log monitor supports the following log file types:ApacheNginxThe following suspicious activities/attacks can be detected:AttacksDenial of Service (DoS) attacksCross site scripting (XSS) injectionSQL injection (SQLi)Local file inclusion (LFI)Web shell injectionReconnaissance attacksWeb crawlers / spiders / botsURL FuzzingPort scansBad user agentsLog bad/suspicious IP (later on picked up by Firewall to block incoming request from that IP)User defined rules:Filter based on selected IPsFilter based on response codeGenerate report about the malicious IP address using OSINT toolsThe report will contain the following fields:Reverse DNSGeo lookupWHOIS lookupOther important detailsAuto Server PatcherSecureTea Auto Server Patcher will patch the server configurations for highest security & help overcome common security deployment mistakes.The following features are currently supported:Auto update packagesSet password expiration & password strength rulesCheck for rootkitsAuto remove discarded packageEnhanceIP TABLErules:Force SYN packets checkDrop XMAS packetsDrop null packetsDrop incoming packets with fragmentsConfigure/etc/sysctl.confDisable IP forwarding & IP source routingDisable sent packets redirectsDisable ICMP redirect acceptanceEnable IP spoofing protectionEnable bad error message protectionPatchApacheserver configurationsPrevent server from broadcasting version numberTurn off TRACE method to prevent Cross-Site ScriptingX-powered by headersConfigureSSHDisallow root access via SSHDisallow SSH from trusting a host based only on its IPPrevent users from logging into SSH with an empty passwordSop the possibility of the server sending commands back to the clientDrop the SSH connection after 5 failed authorization attemptsDisable weak ciphersDisables password authentication and defers authorization to the key-based PAMLog out idle users after 15 minutesConfigure server checks whether the session is active before droppingList all the possibleSSLvulnerabilities in the server using SSL Labs APIBeast attackPoodlePoodle TLSRC4HeartbeatHeartbleedTicketbleedOpenSSL CCSOpenSSL paddingRobot attackFreakLogjamDrown attackAntiVirusSecureTea real-time signature & heuristic based antivirus.The following features are currently supported:Auto fetch updates: Smart update mechanism, that keeps track of the last update and resumes update from the last downloaded file. User can configure toswitch offandswitch onthe auto-update feature.Real-Time monitoring: Scan as soon as a file is modified or a new file is added.Scanner engine: Scanner engine runs on3 process, they are as follows:HashSignature scannerYaraHeuristic scannerClam AVScannerYARArules can detect:VirusesWormsRansomwareAdwareSpywareRootkitsRATsLeveraging the power ofVirusTotal API: Optional for users, provides an easy option for them to test for specific files against multiple anti-viruses & in a safe sandbox environment, i.e. after a file is detected malicious, the file will be put under VirusTotal test for a final confirmation.Monitororphaned files: Use SUID, SGID and read capabilities in Linux to separate orphaned files and check if any file is granted more capabilities than it should be.Keeps an eye onUSB devices: Start scanning the USB device as soon as it is plugged in & report for any virus/malware found.Cleaning the found files: Opt for eitherauto-deleteormanualdelete option, in auto-delete the file found malicious is automatically deleted, whereas in manual it requires the confirmation of the user.CustomandFullscan optionsWeb Deface DetectionMonitor server files to detect any changes, roll back to default in case of defacement.Features:Auto locate the server files based on the user choice of server (i.e. Apache, Nginx, etc.) and the operating system detected.Allow user to overwrite the above default auto-located file path and use their custom file path.Scan the directory for files and generate a cache / backup of the files.Generate SHA 256 hashes of each file and use them for comparison.SecureTea Web Defacement Detection would detect file addition, deletion and modification and roll back to the original file immediately. It would not allow addition of any new files, deletion of files or any type of modification to the current existing files.IoT Anonymity Checker“Shodan is a search engine which collects the information about all IPv4 and IPv6 devices connected to the internet and gives us the ability to search devices using filters that can be very sophisticated.” (source:https://resources.infosecinstitute.com/shodan-iot-problem/#gref)In short, Shodan is a search engine for IoT devices, that can index thousands of IoT devices connected to the internet. At times, this can be great for hackers trying to gain access to the device. As a security feature, it would be good to stay out of Shodan search radar. It will good to check whether the IoT device is under the Shodan grid or not, if
yes, immediate action needs to be taken or else we are all fine!Features:Use public IP address of the device to check (if provided) else auto-collect the public IP address of the device and perform the check.LicenseMIT LicenseCopyright (c) 2019 OWASP SecureTea-Project Team -http://owasp.orgPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.