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

Skip to content

Commit da1ea48

Browse files
committed
added some nagging for connection details
1 parent 4f299f2 commit da1ea48

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

lib/core/common.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
from lib.core.exception import sqlmapNoneDataException
5050
from lib.core.exception import sqlmapMissingDependence
5151
from lib.core.exception import sqlmapSyntaxException
52+
from lib.core.exception import sqlmapUnsupportedFeatureException
5253
from lib.core.settings import DESCRIPTION
5354
from lib.core.settings import IS_WIN
5455
from lib.core.settings import SITE
@@ -604,6 +605,7 @@ def parseTargetDirect():
604605
return
605606

606607
details = None
608+
remote = False
607609

608610
for dbms in SUPPORTED_DBMS:
609611
details = re.search("^(?P<dbms>%s)://(?P<credentials>(?P<user>.+?)\:(?P<pass>.+?)\@)?(?P<remote>(?P<hostname>.+?)\:(?P<port>[\d]+)\/)?(?P<db>[\w\d\.\_\-\/]+?)$" % dbms, conf.direct, re.I)
@@ -619,6 +621,7 @@ def parseTargetDirect():
619621
conf.dbmsPass = str()
620622

621623
if details.group('remote'):
624+
remote = True
622625
conf.hostname = details.group('hostname')
623626
conf.port = int(details.group('port'))
624627
else:
@@ -648,6 +651,15 @@ def parseTargetDirect():
648651
for dbmsName, data in dbmsDict.items():
649652
if conf.dbms in data[0]:
650653
try:
654+
if dbmsName in ('Access', 'SQLite'):
655+
if remote:
656+
errMsg = "direct connection over the network for %s DBMS is not supported" % dbmsName
657+
raise sqlmapUnsupportedFeatureException, errMsg
658+
else:
659+
if not remote:
660+
errMsg = "missing remote connection details"
661+
raise sqlmapSyntaxException, errMsg
662+
651663
if dbmsName == "Microsoft SQL Server":
652664
import _mssql
653665
import pymssql

0 commit comments

Comments
 (0)