|
35 | 35 | from ConfigParser import ConfigParser |
36 | 36 |
|
37 | 37 | from lib.core.common import getFileType |
| 38 | +from lib.core.common import normalizePath |
38 | 39 | from lib.core.common import ntToPosixSlashes |
39 | 40 | from lib.core.common import parseTargetUrl |
40 | 41 | from lib.core.common import paths |
@@ -427,11 +428,11 @@ def __setMetasploit(): |
427 | 428 | raise sqlmapMissingPrivileges, errMsg |
428 | 429 |
|
429 | 430 | if conf.msfPath: |
430 | | - condition = os.path.exists(os.path.normpath(conf.msfPath)) |
431 | | - condition &= os.path.exists(os.path.normpath(os.path.join(conf.msfPath, "msfcli"))) |
432 | | - condition &= os.path.exists(os.path.normpath(os.path.join(conf.msfPath, "msfconsole"))) |
433 | | - condition &= os.path.exists(os.path.normpath(os.path.join(conf.msfPath, "msfencode"))) |
434 | | - condition &= os.path.exists(os.path.normpath(os.path.join(conf.msfPath, "msfpayload"))) |
| 431 | + condition = os.path.exists(normalizePath(conf.msfPath)) |
| 432 | + condition &= os.path.exists(normalizePath(os.path.join(conf.msfPath, "msfcli"))) |
| 433 | + condition &= os.path.exists(normalizePath(os.path.join(conf.msfPath, "msfconsole"))) |
| 434 | + condition &= os.path.exists(normalizePath(os.path.join(conf.msfPath, "msfencode"))) |
| 435 | + condition &= os.path.exists(normalizePath(os.path.join(conf.msfPath, "msfpayload"))) |
435 | 436 |
|
436 | 437 | if condition: |
437 | 438 | debugMsg = "provided Metasploit Framework 3 path " |
@@ -466,11 +467,11 @@ def __setMetasploit(): |
466 | 467 |
|
467 | 468 | for envPath in envPaths: |
468 | 469 | envPath = envPath.replace(";", "") |
469 | | - condition = os.path.exists(os.path.normpath(envPath)) |
470 | | - condition &= os.path.exists(os.path.normpath(os.path.join(envPath, "msfcli"))) |
471 | | - condition &= os.path.exists(os.path.normpath(os.path.join(envPath, "msfconsole"))) |
472 | | - condition &= os.path.exists(os.path.normpath(os.path.join(envPath, "msfencode"))) |
473 | | - condition &= os.path.exists(os.path.normpath(os.path.join(envPath, "msfpayload"))) |
| 470 | + condition = os.path.exists(normalizePath(envPath)) |
| 471 | + condition &= os.path.exists(normalizePath(os.path.join(envPath, "msfcli"))) |
| 472 | + condition &= os.path.exists(normalizePath(os.path.join(envPath, "msfconsole"))) |
| 473 | + condition &= os.path.exists(normalizePath(os.path.join(envPath, "msfencode"))) |
| 474 | + condition &= os.path.exists(normalizePath(os.path.join(envPath, "msfpayload"))) |
474 | 475 |
|
475 | 476 | if condition: |
476 | 477 | infoMsg = "Metasploit Framework 3 has been found " |
@@ -904,19 +905,19 @@ def __cleanupOptions(): |
904 | 905 | conf.delay = float(conf.delay) |
905 | 906 |
|
906 | 907 | if conf.rFile: |
907 | | - conf.rFile = os.path.normpath(ntToPosixSlashes(conf.rFile)) |
| 908 | + conf.rFile = normalizePath(ntToPosixSlashes(conf.rFile)) |
908 | 909 |
|
909 | 910 | if conf.wFile: |
910 | | - conf.wFile = os.path.normpath(ntToPosixSlashes(conf.wFile)) |
| 911 | + conf.wFile = normalizePath(ntToPosixSlashes(conf.wFile)) |
911 | 912 |
|
912 | 913 | if conf.dFile: |
913 | | - conf.dFile = os.path.normpath(ntToPosixSlashes(conf.dFile)) |
| 914 | + conf.dFile = normalizePath(ntToPosixSlashes(conf.dFile)) |
914 | 915 |
|
915 | 916 | if conf.msfPath: |
916 | | - conf.msfPath = os.path.normpath(ntToPosixSlashes(conf.msfPath)) |
| 917 | + conf.msfPath = normalizePath(ntToPosixSlashes(conf.msfPath)) |
917 | 918 |
|
918 | 919 | if conf.tmpPath: |
919 | | - conf.tmpPath = os.path.normpath(ntToPosixSlashes(conf.tmpPath)) |
| 920 | + conf.tmpPath = normalizePath(ntToPosixSlashes(conf.tmpPath)) |
920 | 921 |
|
921 | 922 | if conf.googleDork or conf.list: |
922 | 923 | conf.multipleTargets = True |
|
0 commit comments