Advertisement
KingSkrupellos

WordPress nlh_omp-v1 Themes 1.0 Unauthorized File Upload

Mar 5th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.72 KB | None | 0 0
  1. ####################################################################
  2.  
  3. # Exploit Title : WordPress nlh_omp-v1 Themes 1.0 Unauthorized File Insertation Vulnerability
  4. # Author [ Discovered By ] : KingSkrupellos
  5. # Team : Cyberizm Digital Security Army
  6. # Date : 06/03/2019
  7. # Vendor Homepage : wordpress.org ~ nlh.gr
  8. # Software Information Link : wordpress.org/themes/nlh_omp-v1/
  9. # Software Affected Version : 1.0
  10. # Tested On : Windows and Linux
  11. # Category : WebApps
  12. # Exploit Risk : Medium
  13. # Vulnerability Type : CWE-264 - [ Permissions, Privileges, and Access Controls ]
  14. # PacketStormSecurity : packetstormsecurity.com/files/authors/13968
  15. # CXSecurity : cxsecurity.com/author/KingSkrupellos/1/
  16. # Exploit4Arab : exploit4arab.org/author/351/KingSkrupellos
  17.  
  18. ####################################################################
  19.  
  20. # Impact :
  21. ***********
  22. WordPress nlh_omp-v1 Themes 1.0 is prone to an arbitrary file upload vulnerability.
  23.  
  24. An attacker may leverage this issue to upload arbitrary files to the affected computer;
  25.  
  26. this can result in arbitrary code execution within the context of the vulnerable application.
  27.  
  28. Weaknesses in this category are related to the management of permissions,
  29.  
  30. privileges, and other security features that are used to perform access control.
  31.  
  32. ####################################################################
  33.  
  34. # Exploit :
  35. *********
  36. /wp-content/themes/nlh_omp-v1/inc/moments_form.php
  37.  
  38. # Directory File Path :
  39. ********************
  40. /wp-content/uploads/[YEAR]/[MONTH/.....
  41.  
  42. ####################################################################
  43.  
  44. # Vulnerable Source Code :
  45. *************************
  46. <!doctype html>
  47. <html>
  48. <head>
  49. <meta charset="utf-8">
  50. <title>Moments Upload form</title>
  51. <link href='https://fonts.googleapis.com/css?family=Roboto:400,100,300,500,700,900&subset=latin,greek' rel='stylesheet' type='text/css'>
  52. <link href='https://fonts.googleapis.com/css?family=Roboto+Slab:400,700,300,100&subset=latin,greek' rel='stylesheet' type='text/css'>
  53. <link href='https://nlh.gr/wp-content/themes/nlh_omp-v1/fontawesome/css/font-awesome.min.css' rel='stylesheet' type='text/css'>
  54. <link rel="stylesheet" href="https://nlh.gr/wp-content/themes/nlh_omp-v1/style.css" type="text/css">
  55. <link rel="stylesheet" href="https://nlh.gr/wp-content/themes/nlh_omp-v1/responcive_style.css" type="text/css">
  56. <script src="https://nlh.gr/wp-content/themes/nlh_omp-v1/js/ui/jquery-ui.min.js"></script>
  57. </head>
  58. <body id="moments_body">
  59. <form id="media_upload_form" enctype="multipart/form-data">
  60. <div class="spinner" id="image_loader"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></div>
  61. <div id="image_placeholder">
  62. <label for="user_file" class="btn_view">Select a photo</label>
  63. <input type="file" name="user_file" id="user_file">
  64. <small>*You can upload jpg or png files with maximum file size 2MB.</small>
  65. </div>
  66. <span id="thx_mesage"><strong>Thank you very much!</strong> <br>Your image will be published soon.</span>
  67. <input type="hidden" id="image_id" name="image_id" value="">
  68. <input type="email" id="photo_file_email" name="visitor_email" placeholder="Your email" required>
  69. <input type="text" id="photo_file_title" name="item_title" placeholder="Add Title" required>
  70. <textarea id="photo_file_desc" name="item_desc" placeholder="Add Description"></textarea>
  71. <span class="form_upload_btn" id="form_upload_btn" style="display: none;" onClick="add_gallery();">Save</span>
  72. </form>
  73. <script src="https://nlh.gr/wp-content/themes/nlh_omp-v1/js/simpleUpload.min.js"></script>
  74. <script>
  75. jQuery(function(){
  76. jQuery('#user_file').simpleUpload({
  77. url: 'https://nlh.gr/wp-content/themes/nlh_omp-v1/inc/etc_tools.php',
  78. types: ['jpg', 'png','Jpg','Png','JPG','PNG'],
  79. size: 2072,
  80. fields: {
  81. type : 'user_file',
  82. },
  83. beforeSend : function(files){
  84. jQuery('#image_placeholder').empty();
  85. jQuery('#image_loader').show();
  86. },
  87. change : function(files){
  88. jQuery.each(files, function(i, file){
  89. console.log(file);
  90. jQuery('#image_loader').show();
  91. });
  92. },
  93. success : function(data){
  94. console.log(data);
  95. var obj = jQuery.parseJSON(data);
  96. image_url = obj['url'];
  97. image_id = obj['image_id'];
  98. jQuery("#image_id").val(image_id);
  99. jQuery('#image_loader').hide();
  100. jQuery('#form_upload_btn').show();
  101. jQuery('#image_placeholder').html('<span><img src="'+image_url+'"/></span>');
  102. }
  103. });
  104. });
  105. function add_gallery(){
  106. post_title = jQuery("#photo_file_title").val();
  107. visitor_email = jQuery("#photo_file_email").val();
  108. post_content = jQuery("#photo_file_desc").val();
  109. post_image_id = jQuery("#image_id").val();
  110. jQuery.post("https://nlh.gr/wp-content/themes/nlh_omp-v1/inc/etc_tools.php",{
  111. action : 'add_moment',
  112. post_title : post_title,
  113. visitor_email : visitor_email,
  114. post_content : post_content,
  115. post_image_id : post_image_id
  116. }).done(function(data) {
  117. console.log(data);
  118. if (data == 'OK'){
  119. jQuery("#photo_file_email").remove();
  120. jQuery("#photo_file_title").remove();
  121. jQuery("#photo_file_desc").remove();
  122. jQuery(".form_upload_btn").remove();
  123. jQuery("#thx_mesage").show();
  124. setInterval(function(){
  125. parent.$.fancybox.close();
  126. }, 5000);
  127. }
  128. }
  129. );
  130. }
  131. </script>
  132. </body>
  133. </html>
  134.  
  135. ####################################################################
  136.  
  137. # Example Vulnerable Sites :
  138. *************************
  139. [+] nlh.gr/wp-content/themes/nlh_omp-v1/inc/moments_form.php
  140.  
  141. ####################################################################
  142.  
  143. # Discovered By KingSkrupellos from Cyberizm.Org Digital Security Team
  144.  
  145. ####################################################################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement