mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 09:36:35 +03:00
Do not even prompt for ICMP tunnel if the target OS is not Windows
This commit is contained in:
parent
d0dff82ce0
commit
d0a534dee5
|
@ -93,18 +93,26 @@ class Takeover(Abstraction, Metasploit, ICMPsh, Registry, Miscellaneous):
|
|||
|
||||
msg = "how do you want to establish the tunnel?"
|
||||
msg += "\n[1] TCP: Metasploit Framework (default)"
|
||||
msg += "\n[2] ICMP: icmpsh - ICMP tunneling"
|
||||
|
||||
if Backend.isOs(OS.WINDOWS):
|
||||
msg += "\n[2] ICMP: icmpsh - ICMP tunneling"
|
||||
valids = ( 1, 2 )
|
||||
else:
|
||||
valids = ( 1, )
|
||||
|
||||
while True:
|
||||
tunnel = readInput(msg, default=1)
|
||||
|
||||
if isinstance(tunnel, basestring) and tunnel.isdigit() and int(tunnel) in ( 1, 2 ):
|
||||
if isinstance(tunnel, basestring) and tunnel.isdigit() and int(tunnel) in valids:
|
||||
tunnel = int(tunnel)
|
||||
break
|
||||
|
||||
elif isinstance(tunnel, int) and tunnel in ( 1, 2 ):
|
||||
elif isinstance(tunnel, int) and tunnel in valids:
|
||||
break
|
||||
|
||||
elif len(valids) == 1:
|
||||
warnMsg = "invalid value, valid value is 1"
|
||||
logger.warn(warnMsg)
|
||||
else:
|
||||
warnMsg = "invalid value, valid values are 1 and 2"
|
||||
logger.warn(warnMsg)
|
||||
|
|
Loading…
Reference in New Issue
Block a user