Skip to content

Commit 3fc25a0

Browse files
committed
Make sure we are only grabbing hidden inputs
1 parent 717120b commit 3fc25a0

File tree

2 files changed

+4
-0
lines changed
  • lib/metasploit/framework/login_scanner
  • spec/lib/metasploit/framework/login_scanner

2 files changed

+4
-0
lines changed

lib/metasploit/framework/login_scanner/http.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,9 @@ def get_hidden_inputs(res)
257257
noko.search("form").each_entry do |form|
258258
found_inputs = {}
259259
form.search("input").each_entry do |input|
260+
input_type = input.attributes['type'] ? input.attributes['type'].value : ''
261+
next if input_type !~ /hidden/i
262+
260263
input_name = input.attributes['name'] ? input.attributes['name'].value : ''
261264
input_value = input.attributes['value'] ? input.attributes['value'].value : ''
262265
found_inputs[input_name] = input_value unless input_name.empty?

spec/lib/metasploit/framework/login_scanner/http_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
<input name="input_1" type="hidden" value="some_value_1" />
4242
</form>
4343
<form>
44+
<input name="input_0" type="text" value="Not a hidden input" />
4445
<input name="input_1" type="hidden" value="some_value_1" />
4546
<INPUT name="input_2" type="hidden" value="" />
4647
</form>

0 commit comments

Comments
 (0)