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

Skip to content

Commit ac55e1b

Browse files
committed
fix for localhost firebird direct db access
1 parent 3695322 commit ac55e1b

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

lib/core/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ def parseTargetDirect():
647647
if details.group('remote'):
648648
remote = True
649649
conf.hostname = details.group('hostname')
650-
conf.port = int(details.group('port'))
650+
conf.port = int(details.group('port'))
651651
else:
652652
conf.hostname = "localhost"
653653
conf.port = 0
@@ -675,7 +675,7 @@ def parseTargetDirect():
675675
for dbmsName, data in dbmsDict.items():
676676
if conf.dbms in data[0]:
677677
try:
678-
if dbmsName in ('Access', 'SQLite'):
678+
if dbmsName in ('Access', 'SQLite', 'Firebird'):
679679
if remote:
680680
warnMsg = "direct connection over the network for "
681681
warnMsg += "%s DBMS is not supported" % dbmsName

plugins/dbms/firebird/connector.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,17 @@ class Connector(GenericConnector):
4444
def __init__(self):
4545
GenericConnector.__init__(self)
4646

47+
# sample usage:
48+
# ./sqlmap.py -d "firebird://sysdba:testpass@/opt/firebird/testdb.fdb"
49+
# ./sqlmap.py -d "firebird://sysdba:[email protected]:3050//opt/firebird/testdb.fdb"
4750
def connect(self):
4851
self.initConnection()
4952

5053
if not self.hostname:
5154
self.checkFileDb()
5255

5356
try:
54-
self.connector = kinterbasdb.connect(host=self.hostname, database=self.db, user=self.user, password=self.password)
57+
self.connector = kinterbasdb.connect(host=str(self.hostname), database=str(self.db), user=str(self.user), password=str(self.password)) #, charset="UTF8")
5558
except kinterbasdb.OperationalError, msg:
5659
raise sqlmapConnectionException, msg[1]
5760

0 commit comments

Comments
 (0)