Skip to content

Commit 2ee4b81

Browse files
committed
Minor fix
1 parent 777d999 commit 2ee4b81

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

plugins/dbms/sybase/fingerprint.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
from lib.core.common import Backend
99
from lib.core.common import Format
10+
from lib.core.common import unArrayizeValue
1011
from lib.core.data import conf
1112
from lib.core.data import kb
1213
from lib.core.data import logger
@@ -98,12 +99,17 @@ def checkDbms(self):
9899
infoMsg = "actively fingerprinting %s" % DBMS.SYBASE
99100
logger.info(infoMsg)
100101

101-
for version in xrange(6, 17):
102-
result = inject.checkBooleanExpression("PATINDEX('%%/%d[./]%%',@@VERSION)>0" % version)
102+
result = unArrayizeValue(inject.getValue("SUBSTRING(@@VERSION,1,1)"))
103103

104-
if result:
105-
Backend.setVersion(str(version))
106-
break
104+
if result and result.isdigit():
105+
Backend.setVersion(str(result))
106+
else:
107+
for version in xrange(12, 16):
108+
result = inject.checkBooleanExpression("PATINDEX('%%/%d[./]%%',@@VERSION)>0" % version)
109+
110+
if result:
111+
Backend.setVersion(str(version))
112+
break
107113

108114
return True
109115
else:

0 commit comments

Comments
 (0)