Do not even prompt for ICMP tunnel if the target OS is not Windows

This commit is contained in:
Bernardo Damele 2011-04-23 21:57:07 +00:00
parent d0dff82ce0
commit d0a534dee5

View File

@ -93,18 +93,26 @@ class Takeover(Abstraction, Metasploit, ICMPsh, Registry, Miscellaneous):
msg = "how do you want to establish the tunnel?" msg = "how do you want to establish the tunnel?"
msg += "\n[1] TCP: Metasploit Framework (default)" msg += "\n[1] TCP: Metasploit Framework (default)"
if Backend.isOs(OS.WINDOWS):
msg += "\n[2] ICMP: icmpsh - ICMP tunneling" msg += "\n[2] ICMP: icmpsh - ICMP tunneling"
valids = ( 1, 2 )
else:
valids = ( 1, )
while True: while True:
tunnel = readInput(msg, default=1) 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) tunnel = int(tunnel)
break break
elif isinstance(tunnel, int) and tunnel in ( 1, 2 ): elif isinstance(tunnel, int) and tunnel in valids:
break break
elif len(valids) == 1:
warnMsg = "invalid value, valid value is 1"
logger.warn(warnMsg)
else: else:
warnMsg = "invalid value, valid values are 1 and 2" warnMsg = "invalid value, valid values are 1 and 2"
logger.warn(warnMsg) logger.warn(warnMsg)