mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-26 03:23:48 +03:00
some improvements regarding --os-shell web server application choice
This commit is contained in:
parent
5abbea4a9f
commit
2802923dbe
|
@ -118,37 +118,43 @@ class Web:
|
||||||
infoMsg = "trying to upload the file stager"
|
infoMsg = "trying to upload the file stager"
|
||||||
logger.info(infoMsg)
|
logger.info(infoMsg)
|
||||||
|
|
||||||
|
default = None
|
||||||
|
choices = ['asp', 'aspx', 'php', 'jsp']
|
||||||
|
|
||||||
|
for ext in choices:
|
||||||
|
if conf.url.endswith(ext):
|
||||||
|
default = ext
|
||||||
|
break
|
||||||
|
|
||||||
|
if not default:
|
||||||
|
if kb.os == "Windows":
|
||||||
|
default = "asp"
|
||||||
|
else:
|
||||||
|
default = "php"
|
||||||
|
|
||||||
message = "which web application language does the web server "
|
message = "which web application language does the web server "
|
||||||
message += "support?\n"
|
message += "support?\n"
|
||||||
message += "[1] ASP%s\n" % (" (default)" if kb.os == "Windows" else "")
|
|
||||||
message += "[2] ASPX\n"
|
for count in xrange(len(choices)):
|
||||||
message += "[3] PHP%s\n" % ("" if kb.os == "Windows" else " (default)")
|
ext = choices[count]
|
||||||
message += "[4] JSP"
|
message += "[%d] %s%s\n" % (count + 1, ext.upper(), (" (default)" if default == ext else ""))
|
||||||
|
if default == ext:
|
||||||
|
default = count + 1
|
||||||
|
|
||||||
|
message = message[:-1]
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
choice = readInput(message, default="1" if kb.os == "Windows" else "2")
|
choice = readInput(message, default=str(default))
|
||||||
|
|
||||||
if choice == "1":
|
if not choice.isdigit():
|
||||||
self.webApi = "asp"
|
|
||||||
break
|
|
||||||
|
|
||||||
elif choice == "2":
|
|
||||||
self.webApi = "aspx"
|
|
||||||
break
|
|
||||||
|
|
||||||
elif choice == "3":
|
|
||||||
self.webApi = "php"
|
|
||||||
break
|
|
||||||
|
|
||||||
elif choice == "4":
|
|
||||||
self.webApi = "jsp"
|
|
||||||
break
|
|
||||||
|
|
||||||
elif not choice.isdigit():
|
|
||||||
logger.warn("invalid value, only digits are allowed")
|
logger.warn("invalid value, only digits are allowed")
|
||||||
|
|
||||||
elif int(choice) < 1 or int(choice) > 4:
|
elif int(choice) < 1 or int(choice) > len(choices):
|
||||||
logger.warn("invalid value, it must be between 1 and 4")
|
logger.warn("invalid value, it must be between 1 and %d" % len(choices))
|
||||||
|
|
||||||
|
else:
|
||||||
|
self.webApi = choices[int(choice) - 1]
|
||||||
|
break
|
||||||
|
|
||||||
kb.docRoot = getDocRoot(self.webApi)
|
kb.docRoot = getDocRoot(self.webApi)
|
||||||
directories = getDirs(self.webApi)
|
directories = getDirs(self.webApi)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user