mirror of
https://github.com/scr34m/php-malware-scanner.git
synced 2026-06-16 12:30:35 +00:00
JQuery whitelist update, reported in #24
This commit is contained in:
22
tools/jquery.py
Normal file
22
tools/jquery.py
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/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()
|
||||
Reference in New Issue
Block a user