
-
快速且完全可配置的網(wǎng)絡(luò)爬行
-
標(biāo)準(zhǔn)和無外設(shè)模式支持
-
JavaScript 解析/爬網(wǎng)
-
可定制的自動(dòng)表單填寫
-
范圍控制 - 預(yù)配置字段/正則表達(dá)式
-
可自定義的輸出 - 預(yù)配置字段
-
輸入 - 標(biāo)準(zhǔn)輸入、URL 和列表
-
輸出 - 標(biāo)準(zhǔn)輸出、文件和 JSON
0x01 工具安裝
Katana需要Go 1.18才能成功安裝。要安裝,只需運(yùn)行以下命令或從發(fā)布頁面下載預(yù)編譯的二進(jìn)制文件。
go install github.com/projectdiscovery/katana/cmd/katana@latest
Docker安裝:
docker pull projectdiscovery/katana:latest
docker run projectdiscovery/katana:latest -u https://tesla.com
docker run projectdiscovery/katana:latest -u https://tesla.com -system-chrome -headless
Ubuntu安裝:
sudo apt update
sudo snap refresh
sudo apt install zip curl wget git
sudo snap install golang --classic
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt update
sudo apt install google-chrome-stable
go install github.com/projectdiscovery/katana/cmd/katana@latest
0x02 工具使用
Katana需要URL或端點(diǎn)進(jìn)行爬網(wǎng),并接受單個(gè)或多個(gè)輸入。
可以使用-u 選項(xiàng)提供輸入 URL,可以使用逗號(hào)分隔的輸入提供多個(gè)值,同樣使用-list 選項(xiàng)支持文件輸入,并且還支持額外的管道輸入 (stdin)。
katana -u https://tesla.com
多個(gè) URL 輸入(逗號(hào)分隔):
katana -u https://tesla.com,https://google.com
文件輸入:
$ cat url_list.txt
https://tesla.com
https://google.com
katana -list url_list.txt
管道輸入:
echo https://tesla.com | katana
cat domains | httpx | katana
運(yùn)行實(shí)例:
katana -u https://youtube.com
__ __
/ /_____ _/ /____ ____ ___ _
/ '_/ _ / __/ _ / _ / _ /
/_/\_\_,_/\__/\_,_/_//_/\_,_/ v0.0.1
projectdiscovery.io
[WRN] Use with caution. You are responsible for your actions.
[WRN] Developers assume no liability and are not responsible for any misuse or damage.
https://www.youtube.com/
https://www.youtube.com/about/
https://www.youtube.com/about/press/
https://www.youtube.com/about/copyright/
https://www.youtube.com/t/contact_us/
https://www.youtube.com/creators/
https://www.youtube.com/ads/
https://www.youtube.com/t/terms
https://www.youtube.com/t/privacy
https://www.youtube.com/about/policies/
https://www.youtube.com/howyoutubeworks?utm_campaign=ytgen&utm_source=ythp&utm_medium=LeftNav&utm_content=txt&u=https%3A%2F%2Fwww.youtube.com%2Fhowyoutubeworks%3Futm_source%3Dythp%26utm_medium%3DLeftNav%26utm_campaign%3Dytgen
https://www.youtube.com/new
https://m.youtube.com/
https://www.youtube.com/s/desktop/4965577f/jsbin/desktop_polymer.vflset/desktop_polymer.js
https://www.youtube.com/s/desktop/4965577f/cssbin/www-main-desktop-home-page-skeleton.css
https://www.youtube.com/s/desktop/4965577f/cssbin/www-onepick.css
https://www.youtube.com/s/_/ytmainappweb/_/ss/k=ytmainappweb.kevlar_base.0Zo5FUcPkCg.L.B1.O/am=gAE/d=0/rs=AGKMywG5nh5Qp-BGPbOaI1evhF5BVGRZGA
https://www.youtube.com/opensearch?locale=en_GB
https://www.youtube.com/manifest.webmanifest
https://www.youtube.com/s/desktop/4965577f/cssbin/www-main-desktop-watch-page-skeleton.css
https://www.youtube.com/s/desktop/4965577f/jsbin/web-animations-next-lite.min.vflset/web-animations-next-lite.min.js
https://www.youtube.com/s/desktop/4965577f/jsbin/custom-elements-es5-adapter.vflset/custom-elements-es5-adapter.js
https://www.youtube.com/s/desktop/4965577f/jsbin/webcomponents-sd.vflset/webcomponents-sd.js
https://www.youtube.com/s/desktop/4965577f/jsbin/intersection-observer.min.vflset/intersection-observer.min.js
https://www.youtube.com/s/desktop/4965577f/jsbin/scheduler.vflset/scheduler.js
https://www.youtube.com/s/desktop/4965577f/jsbin/www-i18n-constants-en_GB.vflset/www-i18n-constants.js
https://www.youtube.com/s/desktop/4965577f/jsbin/www-tampering.vflset/www-tampering.js
https://www.youtube.com/s/desktop/4965577f/jsbin/spf.vflset/spf.js
https://www.youtube.com/s/desktop/4965577f/jsbin/network.vflset/network.js
https://www.youtube.com/howyoutubeworks/
https://www.youtube.com/trends/
https://www.youtube.com/jobs/
https://www.youtube.com/kids/
0x03 爬蟲模式
標(biāo)準(zhǔn)模式:
標(biāo)準(zhǔn)爬網(wǎng)模式使用底層的標(biāo)準(zhǔn) go http 庫來處理 HTTP 請求/響應(yīng)。這種模式要快得多,因?yàn)樗鼪]有瀏覽器開銷。盡管如此,它仍然按原樣分析 HTTP 響應(yīng)正文,沒有任何 javascript 或 DOM 渲染,可能會(huì)缺少 dom 渲染后的端點(diǎn)或異步端點(diǎn)調(diào)用,這些調(diào)用可能發(fā)生在復(fù)雜的 Web 應(yīng)用程序中,例如,依賴于特定于瀏覽器的事件。
無頭模式:
無頭模式掛鉤內(nèi)部無頭調(diào)用,以直接在瀏覽器上下文中處理 HTTP 請求/響應(yīng)。這有兩個(gè)優(yōu)點(diǎn):
-
HTTP 指紋(TLS 和用戶代理)將客戶端完全標(biāo)識(shí)為合法瀏覽器
-
更好的覆蓋范圍,因?yàn)槎它c(diǎn)是分析標(biāo)準(zhǔn)原始響應(yīng)的,就像在前面的模式中一樣,以及啟用了javascript的瀏覽器渲染的響應(yīng)。
以下是其他無頭 CLI 選項(xiàng) -
katana -h headless
Flags:
HEADLESS:
-hl, -headless enable headless hybrid crawling (experimental)
-sc, -system-chrome use local installed chrome browser instead of katana installed
-sb, -show-browser show the browser on the screen with headless mode
-ho, -headless-options string[] start headless chrome with additional options
-nos, -no-sandbox start headless chrome in --no-sandbox mode
-cdd, -chrome-data-dir string path to store chrome browser data
-scp, -system-chrome-path string use specified chrome browser for headless crawling
-noi, -no-incognito start headless chrome without incognito mode
無沙盒模式:
使用無沙盒選項(xiàng)運(yùn)行無頭 chrome 瀏覽器,在以 root 用戶身份運(yùn)行時(shí)很有用。
katana -u https://tesla.com -headless -no-sandbox
無運(yùn)行頭模式:
在沒有隱身模式的情況下運(yùn)行無頭 chrome 瀏覽器,這在使用本地瀏覽器時(shí)很有用。
katana -u https://tesla.com -headless -no-incognito
工具下載:
https://github.com/projectdiscovery/katana
-
HTTP
+關(guān)注
關(guān)注
0文章
520瀏覽量
32440 -
URL
+關(guān)注
關(guān)注
0文章
139瀏覽量
15778 -
爬蟲
+關(guān)注
關(guān)注
0文章
83瀏覽量
7346
原文標(biāo)題:新一代爬蟲工具 katana
文章出處:【微信號(hào):菜鳥學(xué)安全,微信公眾號(hào):菜鳥學(xué)安全】歡迎添加關(guān)注!文章轉(zhuǎn)載請注明出處。
發(fā)布評(píng)論請先 登錄
基于4G和Beyond 3G的新一代移動(dòng)通信系統(tǒng)討論
新一代音頻DAC的架構(gòu)介紹
爬蟲可以采集哪些數(shù)據(jù)
斯巴魯新一代安全系統(tǒng)搶先看
新一代納秒級(jí)高帶寬仿真工具平臺(tái)HAC Express的優(yōu)勢
如何去設(shè)計(jì)新一代自動(dòng)化測試系統(tǒng)?
如何去推進(jìn)新一代數(shù)據(jù)中心的發(fā)展?
爬蟲是如何實(shí)現(xiàn)數(shù)據(jù)的獲取爬蟲程序如何實(shí)現(xiàn)

評(píng)論