Created
March 4, 2019 16:05
-
-
Save rshipp/d399491305c5d293357a800d5a51b0aa to your computer and use it in GitHub Desktop.
extract iocs from urls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
# dependencies: pip install requests bs4 iocextract | |
# usage: python wwwextract.py URL | |
import sys | |
import requests | |
import bs4 | |
import iocextract | |
response = requests.get(sys.argv[1]) | |
document = bs4.BeautifulSoup(response.content, 'html.parser') | |
for ioc in iocextract.extract_iocs(document.get_text(separator=' '), refang=True, strip=True): | |
print(ioc.encode('utf-8')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment