File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
modules/auxiliary/scanner/http Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ def check
44
44
end
45
45
46
46
def run_host ( ip )
47
- traversal = " ../" * datastore [ 'DEPTH' ]
47
+ traversal = ' ../' * datastore [ 'DEPTH' ]
48
48
filename = datastore [ 'FILEPATH' ]
49
49
filename = filename [ 1 , filename . length ] if filename =~ /^\/ /
50
50
@@ -59,11 +59,16 @@ def run_host(ip)
59
59
)
60
60
61
61
unless res && res . body
62
- fail_with ( Failure :: Unknown , "#{ peer } - Server did not respond in an expected way." )
62
+ vprint_error ( "#{ peer } - Server did not respond in an expected way." )
63
63
return
64
64
end
65
65
66
- if res . code == 200 && res . body . length > 0 && res . headers [ 'Content-Disposition' ] . include? ( 'attachment; filename' )
66
+ if res . code == 200 &&
67
+ res . body . length > 0 &&
68
+ res . headers [ 'Content-Disposition' ] &&
69
+ res . headers [ 'Content-Disposition' ] . include? ( 'attachment; filename' ) &&
70
+ res . headers [ 'Content-Length' ] &&
71
+ res . headers [ 'Content-Length' ] . to_i > 0
67
72
68
73
vprint_line ( "#{ res . body } " )
69
74
fname = datastore [ 'FILEPATH' ]
@@ -78,7 +83,7 @@ def run_host(ip)
78
83
79
84
print_good ( "#{ peer } - File saved in: #{ path } " )
80
85
else
81
- print_error ( "#{ peer } - Nothing was downloaded. You can try to change the DEPTH parameter or verify the correct filename." )
86
+ vprint_error ( "#{ peer } - Nothing was downloaded. You can try to change the DEPTH parameter or verify the correct filename." )
82
87
end
83
88
end
84
89
end
You can’t perform that action at this time.
0 commit comments