mirror of
https://github.com/scr34m/php-malware-scanner.git
synced 2026-06-16 12:30:35 +00:00
23 lines
565 B
Python
23 lines
565 B
Python
|
|
#!/usr/bin/env python
|
||
|
|
|
||
|
|
import urllib2
|
||
|
|
import re
|
||
|
|
import hashlib
|
||
|
|
|
||
|
|
def fetch(url):
|
||
|
|
response = urllib2.urlopen(url)
|
||
|
|
return response.read()
|
||
|
|
|
||
|
|
def main():
|
||
|
|
html = fetch('https://code.jquery.com/jquery/')
|
||
|
|
regex = re.compile(r"<a class='open\-sri\-modal' href='(/jquery-.*?\.js)'")
|
||
|
|
m1 = regex.search(html)
|
||
|
|
for m in regex.findall(html):
|
||
|
|
js = fetch("https://code.jquery.com" + m)
|
||
|
|
hash = hashlib.md5()
|
||
|
|
hash.update(js)
|
||
|
|
print hash.hexdigest() + " " + m
|
||
|
|
|
||
|
|
if __name__ == '__main__':
|
||
|
|
main()
|