Files
php-malware-scanner/tools/jquery.py

23 lines
565 B
Python
Raw Normal View History

#!/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()