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

Skip to content

Commit 9df1a3d

Browse files
committed
Minor patch for PostgreSQL UDF handling
1 parent a2bc690 commit 9df1a3d

2 files changed

Lines changed: 5 additions & 17 deletions

File tree

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from thirdparty.six import unichr as _unichr
1919

2020
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
21-
VERSION = "1.3.6.19"
21+
VERSION = "1.3.6.20"
2222
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2323
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2424
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

plugins/dbms/postgresql/takeover.py

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,10 @@ def udfSetLocalPaths(self):
4747

4848
banVer = kb.bannerFp["dbmsVersion"]
4949

50-
if banVer >= "9.4":
51-
majorVer = "9.4"
52-
elif banVer >= "9.3":
53-
majorVer = "9.3"
54-
elif banVer >= "9.2":
55-
majorVer = "9.2"
56-
elif banVer >= "9.1":
57-
majorVer = "9.1"
58-
elif banVer >= "9.0":
59-
majorVer = "9.0"
60-
elif banVer >= "8.4":
61-
majorVer = "8.4"
62-
elif banVer >= "8.3":
63-
majorVer = "8.3"
64-
elif banVer >= "8.2":
65-
majorVer = "8.2"
50+
if banVer >= "10":
51+
majorVer = banVer.split('.')[0]
52+
elif banVer >= "8.2" and '.' in banVer:
53+
majorVer = '.'.join(banVer.split('.')[:2])
6654
else:
6755
errMsg = "unsupported feature on versions of PostgreSQL before 8.2"
6856
raise SqlmapUnsupportedFeatureException(errMsg)

0 commit comments

Comments
 (0)