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

Skip to content

Commit 27ff5d6

Browse files
committed
Implementation of #3156
1 parent 72ff6e2 commit 27ff5d6

6 files changed

Lines changed: 20 additions & 6 deletions

File tree

lib/core/common.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,6 +1274,7 @@ def setPaths(rootPath):
12741274
paths.SQLMAP_FILES_PATH = os.path.join(paths.SQLMAP_OUTPUT_PATH, "%s", "files")
12751275

12761276
# sqlmap files
1277+
paths.API_SHELL_HISTORY = os.path.join(_, "api.hst")
12771278
paths.OS_SHELL_HISTORY = os.path.join(_, "os.hst")
12781279
paths.SQL_SHELL_HISTORY = os.path.join(_, "sql.hst")
12791280
paths.SQLMAP_SHELL_HISTORY = os.path.join(_, "sqlmap.hst")

lib/core/enums.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ class AUTOCOMPLETE_TYPE:
382382
SQL = 0
383383
OS = 1
384384
SQLMAP = 2
385+
API = 3
385386

386387
class NOTE:
387388
FALSE_POSITIVE_OR_UNEXPLOITABLE = "false positive or unexploitable"

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from lib.core.enums import OS
2020

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

lib/core/shell.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ def saveHistory(completion=None):
6060
historyPath = paths.SQL_SHELL_HISTORY
6161
elif completion == AUTOCOMPLETE_TYPE.OS:
6262
historyPath = paths.OS_SHELL_HISTORY
63+
elif completion == AUTOCOMPLETE_TYPE.API:
64+
historyPath = paths.API_SHELL_HISTORY
6365
else:
6466
historyPath = paths.SQLMAP_SHELL_HISTORY
6567

@@ -86,6 +88,8 @@ def loadHistory(completion=None):
8688
historyPath = paths.SQL_SHELL_HISTORY
8789
elif completion == AUTOCOMPLETE_TYPE.OS:
8890
historyPath = paths.OS_SHELL_HISTORY
91+
elif completion == AUTOCOMPLETE_TYPE.API:
92+
historyPath = paths.API_SHELL_HISTORY
8993
else:
9094
historyPath = paths.SQLMAP_SHELL_HISTORY
9195

lib/utils/api.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
from lib.core.data import logger
3434
from lib.core.datatype import AttribDict
3535
from lib.core.defaults import _defaults
36+
from lib.core.enums import AUTOCOMPLETE_TYPE
3637
from lib.core.enums import CONTENT_STATUS
3738
from lib.core.enums import MKSTEMP_PREFIX
3839
from lib.core.enums import PART_RUN_CONTENT_TYPES
@@ -43,6 +44,10 @@
4344
from lib.core.settings import IS_WIN
4445
from lib.core.settings import RESTAPI_DEFAULT_ADDRESS
4546
from lib.core.settings import RESTAPI_DEFAULT_PORT
47+
from lib.core.shell import autoCompletion
48+
from lib.core.shell import clearHistory
49+
from lib.core.shell import loadHistory
50+
from lib.core.shell import saveHistory
4651
from lib.core.subprocessng import Popen
4752
from lib.parse.cmdline import cmdLineParser
4853
from thirdparty.bottle.bottle import error as return_error
@@ -741,6 +746,9 @@ def client(host=RESTAPI_DEFAULT_ADDRESS, port=RESTAPI_DEFAULT_PORT, username=Non
741746
logger.critical(errMsg)
742747
return
743748

749+
commands = ("help", "new", "use", "data", "log", "status", "option", "stop", "kill", "list", "flush", "exit", "bye", "quit")
750+
autoCompletion(AUTOCOMPLETE_TYPE.API, commands=commands)
751+
744752
taskid = None
745753
logger.info("Type 'help' or '?' for list of available commands")
746754

txt/checksum.md5

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ c7443613a0a2505b1faec931cee2a6ef lib/controller/handler.py
2828
1e5532ede194ac9c083891c2f02bca93 lib/controller/__init__.py
2929
0adf547455a76dc71e6a599e52da1ed9 lib/core/agent.py
3030
fd8f239e259afaf5f24bcf34a0ad187f lib/core/bigarray.py
31-
e9ea20ebda48080ff80f4b87b0085e6c lib/core/common.py
31+
6165b8a826803b29c479d47a60e8dbf6 lib/core/common.py
3232
0d082da16c388b3445e656e0760fb582 lib/core/convert.py
3333
9f87391b6a3395f7f50830b391264f27 lib/core/data.py
3434
72016ea5c994a711a262fd64572a0fcd lib/core/datatype.py
3535
4086fb55f42e27de5330505605baad0f lib/core/decorators.py
3636
fbb55cc6100318ff922957b6577dc58f lib/core/defaults.py
3737
f92abf47b2a41b75cd4b89ff0c93194c lib/core/dicts.py
3838
9ea8a043030796e6faef7f7e957729d5 lib/core/dump.py
39-
bfffdc74a93ff647c49b79c215d96d8a lib/core/enums.py
39+
afca5fd7ec20d29c30522a007cf3160f lib/core/enums.py
4040
cada93357a7321655927fc9625b3bfec lib/core/exception.py
4141
1e5532ede194ac9c083891c2f02bca93 lib/core/__init__.py
4242
458a194764805cd8312c14ecd4be4d1e lib/core/log.py
@@ -48,8 +48,8 @@ c8c386d644d57c659d74542f5f57f632 lib/core/patch.py
4848
0c3eef46bdbf87e29a3f95f90240d192 lib/core/replication.py
4949
a7db43859b61569b601b97f187dd31c5 lib/core/revision.py
5050
fcb74fcc9577523524659ec49e2e964b lib/core/session.py
51-
09e31da3cc7ba29d6d2cf251284df707 lib/core/settings.py
52-
0dfc2ed40adf72e302291f6ecd4406f6 lib/core/shell.py
51+
0b3afef34882e0bf9bf8149cd672aa22 lib/core/settings.py
52+
dd68a9d02fccb4fa1428b20e15b0db5d lib/core/shell.py
5353
a7edc9250d13af36ac0108f259859c19 lib/core/subprocessng.py
5454
36bd2dc292c0e10e39bd9c43b77fe1bc lib/core/target.py
5555
72d499ca8d792e90a1ebfb2ad2341a51 lib/core/testing.py
@@ -100,7 +100,7 @@ f5fb02487edaf9adaa81d54324c84f8f lib/techniques/error/use.py
100100
1e5532ede194ac9c083891c2f02bca93 lib/techniques/union/__init__.py
101101
94d7a22bb6725a91e84ba2cd9973e96d lib/techniques/union/test.py
102102
11ecf2effbe9f40b361843d546c3c521 lib/techniques/union/use.py
103-
bec403b9c2816c96ae4cac87dff70bbe lib/utils/api.py
103+
02321950c18e08b9422c49d389665946 lib/utils/api.py
104104
37dfb641358669f62c2acedff241348b lib/utils/brute.py
105105
31b1e7eb489eac837db6a2bc1dcb7da7 lib/utils/crawler.py
106106
de9620f03231d8329ee8434884b6bacd lib/utils/deps.py

0 commit comments

Comments
 (0)