Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 023dda2

Browse files
committed
Minor update for --os-shell directories
1 parent 3e76895 commit 023dda2

3 files changed

Lines changed: 11 additions & 6 deletions

File tree

lib/core/common.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -767,9 +767,14 @@ def getManualDirectories():
767767

768768
for suffix in BRUTE_DOC_ROOT_SUFFIXES:
769769
for target in targets:
770-
item = "%s/%s" % (prefix, suffix)
770+
if not prefix.endswith("/%s" % suffix):
771+
item = "%s/%s" % (prefix, suffix)
772+
else:
773+
item = prefix
774+
771775
item = item.replace(BRUTE_DOC_ROOT_TARGET_MARK, target).replace("//", '/').rstrip('/')
772-
directories.append(item)
776+
if item not in directories:
777+
directories.append(item)
773778

774779
if BRUTE_DOC_ROOT_TARGET_MARK not in prefix:
775780
break

lib/core/dicts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,6 @@
234234
}
235235

236236
DEFAULT_DOC_ROOTS = {
237-
OS.WINDOWS: ("C:/xampp/htdocs/", "C:/Inetpub/wwwroot/"),
238-
OS.LINUX: ("/var/www/", "/var/www/html", "/usr/local/apache2/htdocs", "/var/www/nginx-default") # Reference: https://wiki.apache.org/httpd/DistrosDefaultLayout
237+
OS.WINDOWS: ("C:/xampp/htdocs/", "C:/wamp/www/", "C:/Inetpub/wwwroot/"),
238+
OS.LINUX: ("/var/www/", "/var/www/html", "/usr/local/apache2/htdocs", "/var/www/nginx-default", "/srv/www") # Reference: https://wiki.apache.org/httpd/DistrosDefaultLayout
239239
}

lib/core/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from lib.core.revision import getRevisionNumber
2020

2121
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
22-
VERSION = "1.0.5.49"
22+
VERSION = "1.0.5.50"
2323
REVISION = getRevisionNumber()
2424
STABLE = VERSION.count('.') <= 2
2525
VERSION_STRING = "sqlmap/%s#%s" % (VERSION, "stable" if STABLE else "dev")
@@ -680,7 +680,7 @@
680680
}
681681

682682
# Suffixes used in brute force search for web server document root
683-
BRUTE_DOC_ROOT_SUFFIXES = ("", "html", "htdocs", "httpdocs", "php", "public", "src", "site", "build", "web", "data", "sites/all", "www/build")
683+
BRUTE_DOC_ROOT_SUFFIXES = ("", "html", "htdocs", "httpdocs", "php", "public", "src", "site", "build", "web", "www", "data", "sites/all", "www/build")
684684

685685
# String used for marking target name inside used brute force web server document root
686686
BRUTE_DOC_ROOT_TARGET_MARK = "%TARGET%"

0 commit comments

Comments
 (0)