forked from PythonWebScrapingMalware/Malware
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbadmalweb.py
More file actions
29 lines (20 loc) · 663 Bytes
/
badmalweb.py
File metadata and controls
29 lines (20 loc) · 663 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import re
import urllib
url= "http://badmalweb.com/?p=live"
htmltext = urllib.urlopen(url).read()
ips = re.findall('<td class="ip">(.+?)</td>',htmltext)
dates = re.findall('<td class="date">(.+?)</td>', htmltext)
hosts = re.findall('<td class="url">(.+?)</td>', htmltext)
ips = [re.findall('">(.+?)</a>', x) for x in ips]
f = open('badmalweb.txt', 'a')
newIpList = []
f = open('badmalweb.txt', 'a')
for x in ips:
for x in x:
newIpList.append(x)
for index, value in enumerate(newIpList):
final = "%s - %s - %s" % (value, dates[index], hosts[index])
print final
f.write(final + "\n")
f.close()
#URL: http://badmalweb.com/?p=live