mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-07-02 02:43:35 +03:00
now ASPX works too for --os-shell
This commit is contained in:
parent
ca58bdbc66
commit
9579a97039
|
@ -1626,3 +1626,13 @@ def getPublicTypeMembers(type_):
|
||||||
retVal.append((name, value))
|
retVal.append((name, value))
|
||||||
|
|
||||||
return retVal
|
return retVal
|
||||||
|
|
||||||
|
def extractRegexResult(regex, content):
|
||||||
|
retVal = None
|
||||||
|
|
||||||
|
if regex and content and '?P<result>' in regex:
|
||||||
|
match = re.search(regex, content)
|
||||||
|
if match:
|
||||||
|
retVal = match.group("result")
|
||||||
|
|
||||||
|
return retVal
|
||||||
|
|
|
@ -15,6 +15,7 @@ import re
|
||||||
from extra.cloak.cloak import decloak
|
from extra.cloak.cloak import decloak
|
||||||
from lib.core.agent import agent
|
from lib.core.agent import agent
|
||||||
from lib.core.common import decloakToNamedTemporaryFile
|
from lib.core.common import decloakToNamedTemporaryFile
|
||||||
|
from lib.core.common import extractRegexResult
|
||||||
from lib.core.common import getDirs
|
from lib.core.common import getDirs
|
||||||
from lib.core.common import getDocRoot
|
from lib.core.common import getDocRoot
|
||||||
from lib.core.common import ntToPosixSlashes
|
from lib.core.common import ntToPosixSlashes
|
||||||
|
@ -83,6 +84,11 @@ class Web:
|
||||||
"uploadDir": directory,
|
"uploadDir": directory,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if self.webApi == "aspx":
|
||||||
|
page = Request.getPage(url=self.webStagerUrl, content=True, raise404=False)
|
||||||
|
multipartParams['__EVENTVALIDATION'] = extractRegexResult(r"__EVENTVALIDATION[^>]+value=\"(?P<result>[^\"]+)\"", page[0])
|
||||||
|
multipartParams['__VIEWSTATE'] = extractRegexResult(r"__VIEWSTATE[^>]+value=\"(?P<result>[^\"]+)\"", page[0])
|
||||||
|
|
||||||
page = Request.getPage(url=self.webStagerUrl, multipart=multipartParams, raise404=False)
|
page = Request.getPage(url=self.webStagerUrl, multipart=multipartParams, raise404=False)
|
||||||
|
|
||||||
if "File uploaded" not in page:
|
if "File uploaded" not in page:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user