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

Skip to content

Commit 862395c

Browse files
committed
further refactoring (all enumerations are now put into enums.py)
1 parent 8e44aa6 commit 862395c

54 files changed

Lines changed: 87 additions & 95 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

lib/controller/handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from lib.core.data import conf
1313
from lib.core.data import kb
1414
from lib.core.data import logger
15-
from lib.core.settings import DBMS
15+
from lib.core.enums import DBMS
1616
from lib.core.settings import MSSQL_ALIASES
1717
from lib.core.settings import MYSQL_ALIASES
1818
from lib.core.settings import ORACLE_ALIASES

lib/core/agent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
from lib.core.data import kb
2121
from lib.core.data import queries
2222
from lib.core.datatype import advancedDict
23+
from lib.core.enums import DBMS
24+
from lib.core.enums import PLACE
2325
from lib.core.exception import sqlmapNoneDataException
24-
from lib.core.place import PLACE
25-
from lib.core.settings import DBMS
2626
from lib.core.settings import PAYLOAD_DELIMITER
2727

2828
class Agent:

lib/core/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@
4343
from lib.core.data import queries
4444
from lib.core.convert import htmlunescape
4545
from lib.core.convert import urlencode
46+
from lib.core.enums import DBMS
47+
from lib.core.enums import PLACE
4648
from lib.core.exception import sqlmapFilePathException
4749
from lib.core.exception import sqlmapGenericException
4850
from lib.core.exception import sqlmapNoneDataException
4951
from lib.core.exception import sqlmapMissingDependence
5052
from lib.core.exception import sqlmapSyntaxException
5153
from lib.core.optiondict import optDict
52-
from lib.core.place import PLACE
53-
from lib.core.settings import DBMS
5454
from lib.core.settings import DESCRIPTION
5555
from lib.core.settings import IS_WIN
5656
from lib.core.settings import PLATFORM

lib/core/enums.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env python
2+
3+
"""
4+
$Id$
5+
6+
Copyright (c) 2006-2010 sqlmap developers (http://sqlmap.sourceforge.net/)
7+
See the file 'doc/COPYING' for copying permission
8+
"""
9+
10+
class PRIORITY:
11+
LOWEST = -100
12+
LOWER = -50
13+
LOW = -10
14+
NORMAL = 0
15+
HIGH = 10
16+
HIGHER = 50
17+
HIGHEST = 100
18+
19+
class DBMS:
20+
MYSQL = "MySQL"
21+
ORACLE = "Oracle"
22+
POSTGRESQL = "PostgreSQL"
23+
MSSQL = "Microsoft SQL Server"
24+
SQLITE = "SQLite"
25+
ACCESS = "Microsoft Access"
26+
FIREBIRD = "Firebird"
27+
MAXDB = "SAP MaxDB"
28+
SYBASE = "Sybase"
29+
30+
class PLACE:
31+
GET = "GET"
32+
POST = "POST"
33+
URI = "URI"
34+
COOKIE = "Cookie"
35+
UA = "User-Agent"

lib/core/option.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
from lib.core.data import paths
4343
from lib.core.data import queries
4444
from lib.core.datatype import advancedDict
45+
from lib.core.enums import PRIORITY
4546
from lib.core.exception import sqlmapFilePathException
4647
from lib.core.exception import sqlmapGenericException
4748
from lib.core.exception import sqlmapMissingDependence
@@ -51,7 +52,6 @@
5152
from lib.core.exception import sqlmapUnsupportedDBMSException
5253
from lib.core.exception import sqlmapUserQuitException
5354
from lib.core.optiondict import optDict
54-
from lib.core.priority import PRIORITY
5555
from lib.core.settings import IS_WIN
5656
from lib.core.settings import PLATFORM
5757
from lib.core.settings import PYVERSION

lib/core/place.py

Lines changed: 0 additions & 15 deletions
This file was deleted.

lib/core/priority.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

lib/core/session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from lib.core.data import conf
1616
from lib.core.data import kb
1717
from lib.core.data import logger
18-
from lib.core.place import PLACE
18+
from lib.core.enums import PLACE
1919
from lib.core.settings import MSSQL_ALIASES
2020
from lib.core.settings import MYSQL_ALIASES
2121
from lib.core.settings import PGSQL_ALIASES

lib/core/settings.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,6 @@
9090
SUPPORTED_DBMS = MSSQL_ALIASES + MYSQL_ALIASES + PGSQL_ALIASES + ORACLE_ALIASES + SQLITE_ALIASES + ACCESS_ALIASES + FIREBIRD_ALIASES + MAXDB_ALIASES + SYBASE_ALIASES
9191
SUPPORTED_OS = ( "linux", "windows" )
9292

93-
class DBMS:
94-
MYSQL = "MySQL"
95-
ORACLE = "Oracle"
96-
POSTGRESQL = "PostgreSQL"
97-
MSSQL = "Microsoft SQL Server"
98-
SQLITE = "SQLite"
99-
ACCESS = "Microsoft Access"
100-
FIREBIRD = "Firebird"
101-
MAXDB = "SAP MaxDB"
102-
SYBASE = "Sybase"
103-
10493
SQL_STATEMENTS = {
10594
"SQL SELECT statement": (
10695
"select ",

lib/parse/banner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from lib.core.common import sanitizeStr
1818
from lib.core.data import kb
1919
from lib.core.data import paths
20-
from lib.core.settings import DBMS
20+
from lib.core.enums import DBMS
2121
from lib.parse.handler import FingerprintHandler
2222

2323
class MSSQLBannerHandler(ContentHandler):

0 commit comments

Comments
 (0)