MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / checkDbms

Method checkDbms

plugins/dbms/sybase/fingerprint.py:63–120  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

61 return value
62
63 def checkDbms(self):
64 if not conf.extensiveFp and Backend.isDbmsWithin(SYBASE_ALIASES):
65 setDbms("%s %s" % (DBMS.SYBASE, Backend.getVersion()))
66
67 self.getBanner()
68
69 Backend.setOs(OS.WINDOWS)
70
71 return True
72
73 infoMsg = "testing %s" % DBMS.SYBASE
74 logger.info(infoMsg)
75
76 if conf.direct:
77 result = True
78 else:
79 result = inject.checkBooleanExpression("@@transtate=@@transtate")
80
81 if result:
82 infoMsg = "confirming %s" % DBMS.SYBASE
83 logger.info(infoMsg)
84
85 result = inject.checkBooleanExpression("suser_id()=suser_id()")
86
87 if not result:
88 warnMsg = "the back-end DBMS is not %s" % DBMS.SYBASE
89 logger.warning(warnMsg)
90
91 return False
92
93 setDbms(DBMS.SYBASE)
94
95 self.getBanner()
96
97 if not conf.extensiveFp:
98 return True
99
100 infoMsg = "actively fingerprinting %s" % DBMS.SYBASE
101 logger.info(infoMsg)
102
103 result = unArrayizeValue(inject.getValue("SUBSTRING(@@VERSION,1,1)"))
104
105 if result and result.isdigit():
106 Backend.setVersion(str(result))
107 else:
108 for version in xrange(12, 16):
109 result = inject.checkBooleanExpression("PATINDEX('%%/%d[./]%%',@@VERSION)>0" % version)
110
111 if result:
112 Backend.setVersion(str(version))
113 break
114
115 return True
116 else:
117 warnMsg = "the back-end DBMS is not %s" % DBMS.SYBASE
118 logger.warning(warnMsg)
119
120 return False

Callers

nothing calls this directly

Calls 9

setDbmsFunction · 0.90
unArrayizeValueFunction · 0.90
xrangeClass · 0.85
isDbmsWithinMethod · 0.80
getVersionMethod · 0.80
setOsMethod · 0.80
infoMethod · 0.80
setVersionMethod · 0.80
getBannerMethod · 0.45

Tested by

no test coverage detected