關于Pinecone
Pinecone是一款專為紅隊研究人員設計的WLAN網絡安全審計架構,該工具基于子產品化開發,允許廣大研究人員根據任務需求進行自定義功能擴充。Pinecone設計之初專用于樹莓派,可以将樹莓派打造為便攜式無線網絡安全審計工具,但也可以在基于Debian的作業系統中運作。
工具要求
如需運作Pinecone,首先我們需要一個基于Debian的作業系統(該工具已在樹莓派、樹莓派桌面端和Kali Linux上進行過測試)。
接下來,還需要安裝并配置好下列元件:
1、Python 3.5+:你的發行版系統可能已經預安裝了Python 3,如果沒有則需手動安裝;
2、dnsmasq:測試版本為v2.76;
3、hostapd-wpe:測試版本為v2.6;
我們可以通過下列指令安裝該工具所需的運作環境:
apt-get install python3
apt-get install dnsmasq
apt-get install hostapd-wpe
工具安裝
廣大研究人員可以使用下列指令将該項目源碼克隆至本地:
git clone https://github.com/pinecone-wifi/pinecone.git
接下來,使用pip3指令并通過項目提供的requirements.txt來安裝該工具所需的Python元件包:
pip3 install -r requirements.txt
工具使用
執行項目根目錄中的pinecone.py檔案即可運作Pinecone:
root@kali:~/pinecone# python3 pinecone.py
[i] Database file: ~/pinecone/db/database.sqlite
pinecone >
我們可以通過一個類似Metasploit的指令行接口來控制Pinecone,輸入“help”指令即可擷取該工具支援的所有指令幫助資訊,或者輸入“help 'command'”檢視指定指令的幫助資訊:
pinecone > help
Documented commands (type help <topic>):
========================================
alias help load pyscript set shortcuts use
edit history py quit shell unalias
Undocumented commands:
======================
back run stop
pinecone > help use
Usage: use module [-h]
Interact with the specified module.
positional arguments:
module module ID
optional arguments:
-h, --help show this help message and exit
“use 'moduleID'”指令可以激活一個指定的Pinecone子產品,我們可以使用Tab鍵實作指令補全:
pinecone > use
attack/deauth daemon/hostapd-wpe report/db2json scripts/infrastructure/ap
daemon/dnsmasq discovery/recon scripts/attack/wpa_handshake
pinecone > use discovery/recon
pcn module(discovery/recon) >
每一個功能子產品都有不同的參數選項,可以使用“help run”或“run --help”指令來檢視已激活的子產品幫助資訊:
pcn module(discovery/recon) > help run
usage: run [-h] [-i INTERFACE]
optional arguments:
-h, --help show this help message and exit
-i INTERFACE, --iface INTERFACE
monitor mode capable WLAN interface (default: wlan0)
當一個子產品被激活之後,可以使用“run [options...]”指令來使用該子產品提供的功能:
pcn script(attack/wpa_handshake) > run -s TEST_SSID
[i] Sending 64 deauth frames to all clients from AP 00:11:22:33:44:55 on channel 1...
................................................................
Sent 64 packets.
[i] Monitoring for 10 secs on channel 1 WPA handshakes between all clients and AP 00:11:22:33:44:55...
如果子產品在背景運作(比如說scripts/infrastructure/ap),我們可以使用“stop”指令來終止子產品運作:
pcn script(infrastructure/ap) > run
net.ipv4.ip_forward = 1
[i] Creating NAT rules in iptables for forwarding wlan0 -> eth0...
[i] Starting hostapd-wpe and dnsmasq...
Configuration file: ~/pinecone/tmp/hostapd-wpe.conf
Using interface wlan0 with hwaddr 00:11:22:33:44:55 and ssid "PINECONEWIFI"
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED
pcn script(infrastructure/ap) > stop
[i] Stopping hostapd-wpe and dnsmasq...
net.ipv4.ip_forward = 0
[i] Flushing NAT table in iptables...
除此之外,我們還可以使用“shell”或“!”指令來執行Shell指令:
pinecone > !ls
LICENSE modules module_template.py pinecone pinecone.py README.md requirements.txt TODO.md
值得一提的是,目前版本的Pinecone會将所有的資料存儲在一個SQLite資料庫中,路徑為db/,工具所使用的所有臨時檔案都存儲在tmp/目錄中。
許可證協定
本項目的開發與釋出遵循GPL-3.0開源許可證協定。
項目位址
Pinecone:【https://github.com/pinecone-wifi/pinecone】