@@ -54,7 +54,7 @@ def initialize
54
54
# Send a normal HTTP request and see if we successfully uploaded or deleted a file.
55
55
# If successful, return true, otherwise false.
56
56
#
57
- def file_exists ( path , data )
57
+ def file_exists ( path , data , ip )
58
58
begin
59
59
res = send_request_cgi (
60
60
{
@@ -75,7 +75,7 @@ def file_exists(path, data)
75
75
#
76
76
# Do a PUT request to the server. Function returns the HTTP response.
77
77
#
78
- def do_put ( path , data )
78
+ def do_put ( path , data , ip )
79
79
begin
80
80
res = send_request_cgi (
81
81
{
@@ -96,7 +96,7 @@ def do_put(path, data)
96
96
#
97
97
# Do a DELETE request. Function returns the HTTP response.
98
98
#
99
- def do_delete ( path )
99
+ def do_delete ( path , ip )
100
100
begin
101
101
res = send_request_cgi (
102
102
{
@@ -135,11 +135,11 @@ def run_host(ip)
135
135
end
136
136
137
137
# Upload file
138
- res = do_put ( path , data )
138
+ res = do_put ( path , data , ip )
139
139
vprint_status ( "#{ ip } : Reply: #{ res . code . to_s } " ) if not res . nil?
140
140
141
141
# Check file
142
- if not res . nil? and file_exists ( path , data )
142
+ if not res . nil? and file_exists ( path , data , ip )
143
143
turl = "#{ ( ssl ? 'https' : 'http' ) } ://#{ ip } :#{ rport } #{ path } "
144
144
print_good ( "File uploaded: #{ turl } " )
145
145
report_vuln (
@@ -160,17 +160,17 @@ def run_host(ip)
160
160
if path !~ /(.+\. \w +)$/
161
161
print_error ( "You must supply a filename" )
162
162
return
163
- elsif not file_exists ( path , data )
163
+ elsif not file_exists ( path , data , ip )
164
164
print_error ( "File is already gone. Will not continue DELETE" )
165
165
return
166
166
end
167
167
168
168
# Delete our file
169
- res = do_delete ( path )
169
+ res = do_delete ( path , ip )
170
170
vprint_status ( "#{ ip } : Reply: #{ res . code . to_s } " ) if not res . nil?
171
171
172
172
# Check if DELETE was successful
173
- if res . nil? or file_exists ( path , data )
173
+ if res . nil? or file_exists ( path , data , ip )
174
174
print_error ( "#{ ip } : DELETE failed. File is still there." )
175
175
else
176
176
turl = "#{ ( ssl ? 'https' : 'http' ) } ://#{ ip } :#{ rport } #{ path } "
0 commit comments