|
| 1 | +# [OSweep™] |
| 2 | +##### Don't Just Search OSINT. Sweep It. |
| 3 | + |
| 4 | +#### Description |
| 5 | +If you work in a IT security, then you most likely use OSINT to help understand what it is that your SIEM alerted you on and what everyone else in the world understands about it. More than likely, you are using more than one website because most of the time OSINT will only provide you with reports based on the last analysis of the IOC. For some, that's good enough. They create network and email blocks, create new rules for their IDS/IPS, update the content in the SIEM, create new alerts for monitors in Google Alerts and DomainTools, etc etc. For others, they perform deploy these same countermeasures based on provided reports from their third-party tool that the company is paying THOUSANDS of dollars for. The problem with both of these it that the analyst needs to dig a little deeper (ex. FULLY deobfuscate a PowerShell command found in a malicious macro) to gather all of the IOCs. And what if the additional IOC(s) you are basing your on has nothing to do with what is true today? And then you get pwned? Then other questions arise... |
| 6 | + |
| 7 | +See where this is headed? You're about to get a pink slip and walked out of the building so you can start looking for another job in a different line of work. |
| 8 | + |
| 9 | +So why did you get pwned? Because if wasted time gathering all the IOCs for that one alert manually, it would have taken you half of your shift to complete and you would've got pwned regardless. |
| 10 | + |
| 11 | +The fix? **OSweep™**. |
| 12 | + |
| 13 | +#### Prerequisites |
| 14 | +- Splunk |
| 15 | + |
| 16 | +#### Setup |
| 17 | +Open a terminal and run the following commands: |
| 18 | +```bash |
| 19 | +cd /opt/splunk/etc/apps |
| 20 | +git clone https://github.com/leunammejii/osweep.git |
| 21 | +/opt/splunk/bin/splunk restart |
| 22 | +``` |
| 23 | + |
| 24 | +#### Commands |
| 25 | +- crtsh |
| 26 | +- cybercrimeTracker |
| 27 | +- ransomwareTracker |
| 28 | +- threatcrowd |
| 29 | +- urlhaus |
| 30 | +- urlscan |
| 31 | + |
| 32 | +#### Usage |
| 33 | +#####  logs.") - Dashboard |
| 34 | +1. Switch to the  logs.") dashboard in the OSweep™ app. |
| 35 | +2. Add the list of domains to the 'Domain (+)' textbox. |
| 36 | +3. Select 'Yes' or 'No' from the 'Wildcard' dropdown to search for subdomains. |
| 37 | +4. Click 'Submit'. |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | +#####  logs.") - Adhoc |
| 42 | +``` |
| 43 | +| crtsh <DOMAINS> |
| 44 | +| table "Issuer CA ID", "Issuer Name", "Name Value", "Min Cert ID", "Min Entry Timestamp", "Not Before", "Not After", Invalid |
| 45 | +| sort - "Min Cert ID" |
| 46 | +``` |
| 47 | + |
| 48 | +or to search for subdomains, |
| 49 | + |
| 50 | +``` |
| 51 | +| crtsh wildcard <DOMAINS> |
| 52 | +| table "Issuer CA ID", "Issuer Name", "Name Value", "Min Cert ID", "Min Entry Timestamp", "Not Before", "Not After", Invalid |
| 53 | +| sort - "Min Cert ID" |
| 54 | +``` |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | +#####  - Dashboard |
| 59 | +1. Switch to the  dashboard in the OSweep™ app. |
| 60 | +2. Add the list of domains to the 'Domain (+)' textbox. |
| 61 | +3. Select whether the results will be grouped and how from the dropdowns. |
| 62 | +4. Click 'Submit'. |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | +#####  - Adhoc |
| 67 | +``` |
| 68 | +| cybercrimeTracker <DOMAINS> |
| 69 | +| table Date URL IP "VT Latest Scan" "VT IP Info" Type Invalid |
| 70 | +``` |
| 71 | + |
| 72 | +##### , ransomware payment sites, and ransomware distribution sites.") - Dashboard |
| 73 | +1. Add the following cron jobs to the 'splunk' user's cron schedule: |
| 74 | +```bash |
| 75 | +*/5 * * * * /opt/splunk/etc/apps/osweep/bin/ransomware_tracker.py feed |
| 76 | +``` |
| 77 | +2. Manually download URL dump |
| 78 | +``` |
| 79 | +| ransomwareTracker feed |
| 80 | +``` |
| 81 | +3. Switch to the , ransomware payment sites, and ransomware distribution sites.") dashboard in the OSweep™ app. |
| 82 | +4. Add the list of IOCs to the 'Domain, IP, Malware, Status, Threat, URL (+)' |
| 83 | +textbox. |
| 84 | +5. Select whether the results will be grouped and how from the dropdowns. |
| 85 | +6. Click 'Submit'. |
| 86 | + |
| 87 | + |
| 88 | + |
| 89 | +##### , ransomware payment sites, and ransomware distribution sites.") - Adhoc |
| 90 | +``` |
| 91 | +| ransomwareTracker <DOMAINS> |
| 92 | +| table "Firstseen (UTC)" Threat Malware Host "IP Address(es)" URL Status Registrar ASN(s) Country Invalid |
| 93 | +``` |
| 94 | + |
| 95 | +#####  - Dashboard |
| 96 | +1. Switch to the  dashboard in the OSweep™ app. |
| 97 | +2. Add the list of IOCs to the 'IP, Domain, or Email (+)' textbox. |
| 98 | +3. Select the IOC type. |
| 99 | +4. Click 'Submit'. |
| 100 | + |
| 101 | + |
| 102 | + |
| 103 | +#####  - Dashboard |
| 104 | +1. Add the following cron jobs to the 'splunk' user's cron schedule: |
| 105 | +```bash |
| 106 | +*/5 * * * * /opt/splunk/etc/apps/osweep/bin/urlhaus.py feed |
| 107 | +``` |
| 108 | +2. Manually download URL dump: |
| 109 | +``` |
| 110 | +| urlhaus feed |
| 111 | +``` |
| 112 | +3. Switch to the  dashboard in the OSweep™ app. |
| 113 | +4. Add the list of IOCs to the 'Domain, MD5, SHA256, URL (+)' textbox. |
| 114 | +5. Select whether the results will be grouped and how from the dropdowns. |
| 115 | +6. Click 'Submit'. |
| 116 | + |
| 117 | + |
| 118 | + |
| 119 | +#####  - Adhoc |
| 120 | +``` |
| 121 | +| urlhaus <IOCs> |
| 122 | +| table URL Payload "URLhaus Link" Invalid |
| 123 | +``` |
| 124 | + |
| 125 | +#####  - Dashboard |
| 126 | +1. Switch to the  dashboard in the OSweep™ app. |
| 127 | +2. Add the list of IOCs to the 'Domain, IP, SHA256 (+)' textbox. |
| 128 | +3. Select whether the results will be grouped and how from the dropdowns. |
| 129 | +4. Click 'Submit'. |
| 130 | + |
| 131 | + |
| 132 | + |
| 133 | +#####  - Adhoc |
| 134 | +``` |
| 135 | +| urlscan <IOCs> |
| 136 | +| Table URL Domain IP PTR Server City Country ASN "ASN Name" Filename "File Size" "MIME Type" SHA256 Invalid |
| 137 | +``` |
| 138 | + |
| 139 | +#### Destroy |
| 140 | +To remove the project completely, run the following commands: |
| 141 | +```bash |
| 142 | +rm -rf /opt/splunk/etc/apps/osweep |
| 143 | +``` |
| 144 | + |
| 145 | +#### Things to know |
| 146 | +All commands accept input from the pipeline. Either use the `fields` or `table` command to select one field containing the values that the command accepts and pipe it to the command with the first argument being the field name. |
| 147 | +``` |
| 148 | +<search> |
| 149 | +| fields <FIELD NAME> |
| 150 | +| <OSWEEP COMMAND> <FIELD NAME> |
| 151 | +``` |
| 152 | + |
| 153 | +ex. The following will allow a user to find other URLs analyzed by URLhaus that are hosting the same Lokibot malware as mytour[d]pk and group it by the payload: |
| 154 | +``` |
| 155 | +| urlhaus mytour.pk |
| 156 | +| fields Payload |
| 157 | +| urlhaus Payload |
| 158 | +| stats values("URL") AS "URL" values(Invalid) AS Invalid BY "Payload" |
| 159 | +``` |
| 160 | + |
| 161 | + |
| 162 | + |
| 163 | +You can also pipe the results of one command into a totally different command to correlate data. |
| 164 | + |
| 165 | + |
| 166 | + |
| 167 | +#### Dashboards Coming Soon |
| 168 | +- Alienvault |
| 169 | +- Censys |
| 170 | +- Cymon |
| 171 | +- Grey Noise |
| 172 | +- Hybrid-Analysis |
| 173 | +- Malshare |
| 174 | + |
| 175 | +Please fork, create merge requests, and help make this better. |
0 commit comments