mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-26 11:33:47 +03:00
Bug fix (bad idea is to do os.path.join on web URLs - especially on Windows OS)
This commit is contained in:
parent
d05bfdd7dd
commit
43df4efd11
|
@ -5,6 +5,7 @@ Copyright (c) 2006-2014 sqlmap developers (http://sqlmap.org/)
|
||||||
See the file 'doc/COPYING' for copying permission
|
See the file 'doc/COPYING' for copying permission
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import urlparse
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import StringIO
|
import StringIO
|
||||||
|
@ -222,9 +223,9 @@ class Web:
|
||||||
logger.info(infoMsg)
|
logger.info(infoMsg)
|
||||||
self._webFileInject(stagerContent, stagerName, directory)
|
self._webFileInject(stagerContent, stagerName, directory)
|
||||||
|
|
||||||
for x in list(re.finditer('/', directory)):
|
for match in re.finditer('/', directory):
|
||||||
self.webBaseUrl = "%s://%s:%d%s" % (conf.scheme, conf.hostname, conf.port, directory[x.start():])
|
self.webBaseUrl = "%s://%s:%d%s" % (conf.scheme, conf.hostname, conf.port, directory[match.start():])
|
||||||
self.webStagerUrl = os.path.join(self.webBaseUrl, stagerName)
|
self.webStagerUrl = urlparse.urljoin(self.webBaseUrl, stagerName)
|
||||||
self.webStagerFilePath = ntToPosixSlashes(os.path.join(directory, stagerName))
|
self.webStagerFilePath = ntToPosixSlashes(os.path.join(directory, stagerName))
|
||||||
|
|
||||||
debugMsg = "trying to see if the file is accessible from %s" % self.webStagerUrl
|
debugMsg = "trying to see if the file is accessible from %s" % self.webStagerUrl
|
||||||
|
|
Loading…
Reference in New Issue
Block a user