mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-25 19:13:48 +03:00
Fixes #1810
This commit is contained in:
parent
55b23e78ee
commit
c4b74c2e01
|
@ -20,7 +20,7 @@ from lib.core.enums import OS
|
|||
from lib.core.revision import getRevisionNumber
|
||||
|
||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||
VERSION = "1.0.4.16"
|
||||
VERSION = "1.0.4.17"
|
||||
REVISION = getRevisionNumber()
|
||||
STABLE = VERSION.count('.') <= 2
|
||||
VERSION_STRING = "sqlmap/%s#%s" % (VERSION, "stable" if STABLE else "dev")
|
||||
|
|
|
@ -6,6 +6,8 @@ See the file 'doc/COPYING' for copying permission
|
|||
"""
|
||||
|
||||
import os
|
||||
import re
|
||||
import socket
|
||||
import time
|
||||
|
||||
from extra.icmpsh.icmpsh_m import main as icmpshmaster
|
||||
|
@ -54,15 +56,29 @@ class ICMPsh:
|
|||
if self.localIP:
|
||||
message += "[Enter for '%s' (detected)] " % self.localIP
|
||||
|
||||
while not address:
|
||||
address = readInput(message, default=self.localIP)
|
||||
valid = None
|
||||
while not valid:
|
||||
valid = True
|
||||
address = readInput(message, default=self.localIP or "")
|
||||
|
||||
try:
|
||||
socket.inet_aton(address)
|
||||
except socket.error:
|
||||
valid = False
|
||||
finally:
|
||||
valid = valid and re.search(r"\d+\.\d+\.\d+\.\d+", address) is not None
|
||||
|
||||
if conf.batch and not address:
|
||||
raise SqlmapDataException("local host address is missing")
|
||||
elif address and not valid:
|
||||
warnMsg = "invalid local host address"
|
||||
logger.warn(warnMsg)
|
||||
|
||||
return address
|
||||
|
||||
def _prepareIngredients(self, encode=True):
|
||||
self.localIP = getattr(self, "localIP", None)
|
||||
self.remoteIP = getattr(self, "remoteIP", None)
|
||||
self.lhostStr = ICMPsh._selectLhost(self)
|
||||
self.rhostStr = ICMPsh._selectRhost(self)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user