mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 17:46:37 +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
|
from lib.core.revision import getRevisionNumber
|
||||||
|
|
||||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||||
VERSION = "1.0.4.16"
|
VERSION = "1.0.4.17"
|
||||||
REVISION = getRevisionNumber()
|
REVISION = getRevisionNumber()
|
||||||
STABLE = VERSION.count('.') <= 2
|
STABLE = VERSION.count('.') <= 2
|
||||||
VERSION_STRING = "sqlmap/%s#%s" % (VERSION, "stable" if STABLE else "dev")
|
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 os
|
||||||
|
import re
|
||||||
|
import socket
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from extra.icmpsh.icmpsh_m import main as icmpshmaster
|
from extra.icmpsh.icmpsh_m import main as icmpshmaster
|
||||||
|
@ -54,15 +56,29 @@ class ICMPsh:
|
||||||
if self.localIP:
|
if self.localIP:
|
||||||
message += "[Enter for '%s' (detected)] " % self.localIP
|
message += "[Enter for '%s' (detected)] " % self.localIP
|
||||||
|
|
||||||
while not address:
|
valid = None
|
||||||
address = readInput(message, default=self.localIP)
|
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:
|
if conf.batch and not address:
|
||||||
raise SqlmapDataException("local host address is missing")
|
raise SqlmapDataException("local host address is missing")
|
||||||
|
elif address and not valid:
|
||||||
|
warnMsg = "invalid local host address"
|
||||||
|
logger.warn(warnMsg)
|
||||||
|
|
||||||
return address
|
return address
|
||||||
|
|
||||||
def _prepareIngredients(self, encode=True):
|
def _prepareIngredients(self, encode=True):
|
||||||
|
self.localIP = getattr(self, "localIP", None)
|
||||||
|
self.remoteIP = getattr(self, "remoteIP", None)
|
||||||
self.lhostStr = ICMPsh._selectLhost(self)
|
self.lhostStr = ICMPsh._selectLhost(self)
|
||||||
self.rhostStr = ICMPsh._selectRhost(self)
|
self.rhostStr = ICMPsh._selectRhost(self)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user