Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
extract iocs from urls
#!/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
You can’t perform that action at this time.