<menu id="guoca"></menu>
<nav id="guoca"></nav><xmp id="guoca">
  • <xmp id="guoca">
  • <nav id="guoca"><code id="guoca"></code></nav>
  • <nav id="guoca"><code id="guoca"></code></nav>

    命令行版 HTTP 工具集,自動化檢查網站狀態

    VSole2021-09-09 08:30:00

    如果我們有幾十萬個網站需要檢測,該如何實現?手工檢測嗎?當然不行,這是非常不現實的,只有自動化才是正確的選擇,那么如何自動化實現?

    對于幾十個網站的目標,如果要對所有網站進行掃描,每一個網站的掃描都需要比較長的時間,而且,其中難免有很多無效網站,如果我們可以將無效網站排除,那么我們就可以節省掃描的時間,從而提升檢測效率。

    自動化檢測,離不開自動化的工具,今天來為大家分享一款命令行版的 HTTP 工具集 httpx,項目地址:

    https://github.com/projectdiscovery/httpx

    該工具使用 go 語言編寫,安裝方式也比較簡單,需要提前安裝 go 環境,安裝完成之后需要換成國內的代理,否則安裝的時候,會出現連接超時的問題,安裝命令如下:

    go get -v github.com/projectdiscovery/httpx/cmd/httpx
    

    Windows 下安裝時報錯,然后執行下面的命令之后,再進行安裝就可以了:

    go env -w GOSUMDB=off

    安裝完成之后,查看幫助信息:

    [root@vultrguest ~]# httpx -hUsage of httpx:  -H value                # 自定義 header,比如 UA、cookie 等      Custom Header         -allow value                  Allowlist ip/cidr  -body string                Content to send in body with HTTP request  -cdn                    # 根據頁面返回 header,判斷是否存在 cdn      Check if domain's ip belongs to known CDN (akamai, cloudflare, ..)  -cname      Output first cname  -content-length         # 輸出返回包的長度      Extracts content length  -content-type           # 輸出網站的內容類型      Extracts content-type  -csp-probe      Send HTTP probes on the extracted CSP domains  -debug      Debug mode  -deny value      Denylist ip/cidr  -exclude-cdn      Skip full port scans for CDNs (only checks for 80,443)  -extract-regex string      Extract Regex  -fc string              # 過濾掉某些狀態碼的網站,比如 404、500 等      Filter status code  -filter-regex string      Filter Regex  -filter-string string      Filter String  -fl string      Filter content length  -follow-host-redirects      Only follow redirects on the same host  -follow-redirects      Follow Redirects  -http-proxy string      # 設置請求代理      HTTP Proxy, eg http://127.0.0.1:8080  -http2      HTTP2 probe  -include-chain      Show Raw HTTP Chain In Output (-json only)  -include-response      Show Raw HTTP Response In Output (-json only)  -ip                     # 輸出域名對應的 IP      Output target ip  -json      JSON Output  -l string      File containing domains  -location      Extracts location header  -match-regex string      Match Regex  -match-string string      Match string  -mc string      Match status code  -method      Display request method  -ml string      Match content length  -no-color      No Color  -no-fallback      If HTTPS on port 443 is successful on default configuration, probes also port 80 for HTTP  -no-fallback-scheme      The tool will respect and attempt the scheme specified in the url (if HTTPS is specified no HTTP is attempted)  -o string      File to write output to (optional)  -path string      Request path/file (example '/api')  -paths string      Command separated paths or file containing one path per line (example '/api/v1,/apiv2')  -pipeline      HTTP1.1 Pipeline  -ports value      ports range (nmap syntax: eg 1,2-10,11)  -probe      Display probe status  -random-agent      Use randomly selected HTTP User-Agent header value (default true)  -rate-limit int      Maximum requests to send per second (default 150)  -request string      File containing raw request  -response-in-json      Show Raw HTTP Response In Output (-json only) (deprecated)  -response-size-to-read int      Max response size to read in bytes (default - unlimited) (default 2147483647)  -response-size-to-save int      Max response size to save in bytes (default - unlimited) (default 2147483647)  -response-time      Output the response time  -resume      Resume scan using resume.cfg  -retries int      Number of retries  -silent      Silent mode  -sr      Save response to file (default 'output')  -srd string      Save response directory (default "output")  -stats      Enable statistic on keypress (terminal may become unresponsive till the end)  -status-code      Extracts status code  -store-chain      Save chain to file (default 'output')  -tech-detect      Perform wappalyzer based technology detection  -threads int      Number of threads (default 50)  -timeout int      Timeout in seconds (default 5)  -title      Extracts title  -tls-grab      Perform TLS data grabbing  -tls-probe      Send HTTP probes on the extracted TLS domains  -unsafe      Send raw requests skipping golang normalization  -verbose      Verbose Mode  -version      Show version of httpx  -vhost      Check for VHOSTs  -vhost-input      Get a list of vhosts as input  -web-server      Extracts server header  -websocket      Prints out if the server exposes a websocket  -x string      Request Methods, use ALL to check all verbs ()
    

    使用場景一:檢查網站是否存活

    將網站列表保存為一個文本,比如:

    最簡單的命令,無需加任何參數:

    type domain.txt | httpx (windows)/ cat domain.txt | httpx (Linux)

    或者

    httpx -l domain.txt 

    無法訪問的網站,在結果中未進行顯示:

    這個工具在 linux 下使用顯示會比較好看,如果我們想要顯示連接失敗的網站,可以使用命令:

    httpx -l domain.txt -silent -probe

    使用場景二:獲取網站 Title 、狀態碼等

    通過獲取網站的 Title 和狀態碼,可以排除大量非正常網站,比如 404、500 等狀態碼,還有很多域名指向同一個網站,然后通過網站標題可以去掉大量重復的網站域名,從而提升檢測的效率。

    httpx -l domain.txt -title -tech-detect -status-code

    對于有大量無法訪問網站的情況,默認的超時時間是 5 秒,想要提升速度,可以將超時時間,比如:

    httpx -l domain.txt -title -tech-detect -status-code -timeout 2

    目標多的情況下,可以結合多線程技術,使用參數 -threads:

    httpx -l domain.txt -title -tech-detect -status-code -timeout 2 -threads 30

    如果還想獲取目標網的服務器信息,可以使用 -web-server 參數:

    httpx -l domain2.txt -title -tech-detect -status-code -threads 30 -web-server

    使用場景三:使用域名作為目標,獲取網站信息

    當我們收集了很多域名,并沒有生成網站的鏈接,httpx 通用可以檢測域名上搭建的網站信息,比如下面的域名:

    通用使用獲取 title 的命令:

    httpx -l domain2.txt -title -tech-detect -status-code -timeout 2 -threads 30

    總結

    本文對 httpx 做了一個簡單的使用,工具好壞主要與使用者面臨的問題和需求決定,當你需要時,它是一個提效的好幫手,當你不需要時,他不過就是個工具而已,對于大量目標的狀態檢測和信息收集,httpx 是個不錯的幫手,在這幾天的實戰訓練營中,這個工具也是可以使用的,當然,如果自己有編碼基礎,寫腳本來實現自己的目標,更高效且高度自定義化,滿足自己的各種需求,公開的工具多少是有缺陷的,作者不可能把所有狀況都考慮到,而且在使用的時候,目標過多的情況下,會出現各種各樣的 bug,參與訓練營的小伙伴,多少都體驗多了。


    命令行string
    本作品采用《CC 協議》,轉載必須注明作者和本文鏈接
    關于Second Order Second Order是一款功能強大的子域名接管漏洞安全掃描工具,該工具可以通過網絡爬蟲爬取App,并收集匹配特定規則或以特定形式響應數據的URL地址以及其他數據,以期幫助廣大研究人員掃描Web應用程序并發現其中潛在的二級子域名接管問題。 工具安裝 直接使用 廣大研究人員可以直接從該項目的【Releases頁面】下載預構建好的工具代碼,然后解壓之后便可直
    命令行版 HTTP 工具集,自動化檢查網站狀態。
    話說不久前,需要輸出一個按發布時間排序的酷Go推薦的歷史文章列表,類似于這樣:于是乎,想著從GoCN上一篇一篇copy文章的標題吧,5篇下來,手眼已經不協調了,此時此刻才想起自己貌似是個碼農,此情此景那必須coding一段,讓代碼來輸出這個列表。
    0x01 前言滲透測試中無論是打點,還是后滲透,多多少少都會用到命令行下的一些技巧以達到快速拿到目標主機權限和繞過一些安全防護功能等。
    Adobe已經發布了一個名為Stringlifier的開源工具,該工具允許用戶識別任何純文本中隨機生成的字符串,該工具可用于清理日志。Stringlifier工具是用Python編寫的,它使用機器學習來識別插入普通文本中的隨機字符序列。開源工具可用于出于多種目的分析日志,例如研究意外暴露的憑證。Stringlifier能夠在源代碼或配置文件中查找API密鑰,哈希,隨機生成的字符串,包括密碼,日志。Adobe在Github上發布的描述中寫道。
    WSH是一款功能強大的Web Shell生成器和命令行接口工具。WSH的客戶端支持命令歷史記錄和日志記錄功能,并且可以跟以前部署的標準Webshell交互。生成器使用了PHP、ASP和JSP來創建Webshell。它們使用隨機變量生成,因此每一個都擁有單獨的哈希。它們可以使用白名單或密碼進行配置,并允許通過自定義Header和參數進行發送。廣大研究人員可以使用下列命令將該項目源碼克隆至本地:
    wall是一個命令行程序,可在所有已登錄用戶的終端上顯示一條消息。可以在終端上鍵入消息,也可以在文件內容中讀取消息。代表全部寫入,使用write命令僅向特定用戶發送消息。通常,系統管理員發送消息以宣布維護,并要求用戶注銷并關閉所有打開的程序。程序控制對其終端的寫訪問。超級用戶調用wall命令時,無論其mesg設置如何,所有用戶都會收到消息。也可以通過其GID(組ID)指定該組。
    VSole
    網絡安全專家
      亚洲 欧美 自拍 唯美 另类