File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed
modules/exploits/unix/webapp Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -95,21 +95,18 @@ def exploit
95
95
'data' => data
96
96
} )
97
97
98
- if res . nil? or res . headers [ 'Location' ] =~ /action=Login/ or res . get_cookies . empty?
98
+ if res . nil? || res . headers [ 'Location' ] =~ /action=Login/ || res . get_cookies . empty?
99
99
print_error ( "#{ peer } - Login failed with \" #{ username } :#{ password } \" " )
100
100
return
101
101
end
102
102
103
103
if res . get_cookies =~ /PHPSESSID=([A-Za-z0-9]*); path/
104
104
session_id = $1
105
- else
106
- if res . get_cookies =~ /PHPSESSID=([A-Za-z0-9]*);/
105
+ elsif res . get_cookies =~ /PHPSESSID=([A-Za-z0-9]*);/
107
106
session_id = $1
108
107
else
109
- print_error ( "#{ peer } - Login failed with \" #{ username } :#{ password } \" (No session ID)" )
110
- return
108
+ fail_with ( Failure ::NoAccess , "#{ peer } - Login failed with \" #{ username } :#{ password } \" (No session ID)" )
111
109
end
112
- end
113
110
114
111
print_status ( "#{ peer } - Login successful with #{ username } :#{ password } " )
115
112
@@ -132,7 +129,7 @@ def exploit
132
129
'data' => data
133
130
} )
134
131
135
- if not res or res . code != 200
132
+ if not res || res . code != 200
136
133
print_error ( "#{ peer } - Exploit failed: #{ res . code } " )
137
134
return
138
135
end
@@ -148,10 +145,10 @@ def exploit
148
145
}
149
146
} )
150
147
151
- if not res or res . code != 200
152
- print_error ( "#{ peer } - Payload execution failed: #{ res . code } " )
153
- else
148
+ if res && res . code == 200
154
149
print_good ( "#{ peer } - Payload Executed Successfuly: #{ res . code } " )
150
+ else
151
+ print_error ( "#{ peer } - Payload execution failed: #{ res . code } " )
155
152
end
156
153
157
154
end
You can’t perform that action at this time.
0 commit comments