
एक अगली पीढ़ी का क्रॉलिंग और स्पाइडरिंग फ्रेमवर्क।
विशेषताएँ • स्थापना • उपयोग • दायरा • कॉन्फ़िग • फ़िल्टर • Discord में शामिल हों

katana को सफलतापूर्वक स्थापित करने के लिए Go 1.26+ की आवश्यकता है। यदि आपको कोई स्थापना समस्या आती है, तो हम Go के नवीनतम उपलब्ध संस्करण के साथ प्रयास करने की सलाह देते हैं, क्योंकि न्यूनतम आवश्यक संस्करण बदल गया हो सकता है। नीचे दिया गया कमांड चलाएँ या रिलीज़ पेज से पूर्व-संकलित बाइनरी डाउनलोड करें।```console CGO_ENABLED=1 go install github.com/projectdiscovery/katana/cmd/katana@latest
**कटाना को स्थापित / चलाने के और विकल्प-**
<details>
<summary>Docker</summary>
> डॉकर को नवीनतम टैग पर स्थापित / अपडेट करने के लिए -```sh
docker pull projectdiscovery/katana:latest
katana को मानक मोड में docker का उपयोग करके चलाने के लिए -```sh docker run projectdiscovery/katana:latest -u https://tesla.com
> Katana को हेडलेस मोड में डॉकर का उपयोग करके चलाने के लिए -```sh
docker run projectdiscovery/katana:latest -u https://tesla.com -system-chrome -headless
निम्नलिखित पूर्वापेक्षाएँ स्थापित करने की अनुशंसा की जाती है -```sh sudo apt update sudo apt install zip curl wget git snapd sudo snap refresh sudo snap install golang --classic
sudo install -d -m 0755 /etc/apt/keyrings
curl -fsSL https://dl.google.com/linux/linux_signing_key.pub
| sudo gpg --dearmor -o /etc/apt/keyrings/google-chrome.gpg
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/google-chrome.gpg]
http://dl.google.com/linux/chrome/deb/ stable main"
| sudo tee /etc/apt/sources.list.d/google-chrome.list > /dev/null
sudo apt update sudo apt install google-chrome-stable
> install katana -```sh
go install github.com/projectdiscovery/katana/cmd/katana@latest
katana -h
यह टूल के लिए सहायता प्रदर्शित करेगा। यहाँ वे सभी स्विच हैं जो यह समर्थन करता है।```console
Katana is a fast crawler focused on execution in automation
pipelines offering both headless and non-headless crawling.
Usage:
./katana [flags]
Flags:
INPUT:
-u, -list string[] target url / list to crawl
-resume string resume scan using resume.cfg
-e, -exclude string[] exclude host matching specified filter ('cdn', 'private-ips', cidr, ip, regex)
CONFIGURATION:
-r, -resolvers string[] list of custom resolver (file or comma separated)
-d, -depth int maximum depth to crawl (default 3)
-jc, -js-crawl enable endpoint parsing / crawling in javascript file
-jsl, -jsluice enable jsluice parsing in javascript file (memory intensive)
-ct, -crawl-duration value maximum duration to crawl the target for (s, m, h, d) (default s)
-kf, -known-files string enable crawling of known files (all,robotstxt,sitemapxml), a minimum depth of 3 is required to ensure all known files are properly crawled.
-mrs, -max-response-size int maximum response size to read (default 4194304)
-timeout int time to wait for request in seconds (default 10)
-aff, -automatic-form-fill enable automatic form filling (experimental)
-fx, -form-extraction extract form, input, textarea & select elements in jsonl output
-retry int number of times to retry the request (default 1)
-proxy string http/socks5 proxy to use
-td, -tech-detect enable technology detection
-H, -headers string[] custom header/cookie to include in all http request in header:value format (file)
-config string path to the katana configuration file
-fc, -form-config string path to custom form configuration file
-flc, -field-config string path to custom field configuration file
-s, -strategy string Visit strategy (depth-first, breadth-first) (default "depth-first")
-iqp, -ignore-query-params Ignore crawling same path with different query-param values
-fsu, -filter-similar filter crawling of similar looking URLs (e.g., /users/123 and /users/456)
-fst, -filter-similar-threshold int number of distinct values before a path position is treated as parameter (default 10)
-tlsi, -tls-impersonate enable experimental client hello (ja3) tls randomization
-dr, -disable-redirects disable following redirects (default false)
-kb, -knowledge-base enable knowledge base classification
-kb-secrets enable secrets extractor in the knowledge base
-kb-validate-secrets validate detected secrets against their provider (sends live API calls)
-kb-endpoints enable endpoints extractor (classifies REST/GraphQL/SOAP/XHR requests)
-mdp, -max-domain-pages int maximum number of pages to crawl per domain (default unlimited)
DEBUG:
-health-check, -hc run diagnostic check up
-elog, -error-log string file to write sent requests error log
-pprof-server enable pprof server
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
-cwu, -chrome-ws-url string use chrome browser instance launched elsewhere with the debugger listening at this URL
-xhr, -xhr-extraction extract xhr request url,method in jsonl output
-pls, -page-load-strategy string page load strategy (heuristic, load, domcontentloaded, networkidle, none) (default "heuristic")
-dwt, -dom-wait-time int time in seconds to wait after page load when using domcontentloaded strategy (default 5)
-csp, -captcha-solver-provider string captcha solver provider (e.g. capsolver)
-csk, -captcha-solver-key string captcha solver provider api key
SCOPE:
-cs, -crawl-scope string[] in scope url regex to be followed by crawler
-cos, -crawl-out-scope string[] out of scope url regex to be excluded by crawler
-fs, -field-scope string pre-defined scope field (dn,rdn,fqdn) or custom regex (e.g., '(company-staging.io|company.com)') (default "rdn")
-ns, -no-scope disables host based default scope
-do, -display-out-scope display external endpoint from scoped crawling
FILTER:
-mr, -match-regex string[] regex or list of regex to match on output url (cli, file)
-fr, -filter-regex string[] regex or list of regex to filter on output url (cli, file)
-f, -field string field to display in output (url,path,fqdn,rdn,rurl,qurl,qpath,file,ufile,key,value,kv,dir,udir) (Deprecated: use -output-template instead)
-sf, -store-field string field to store in per-host output (url,path,fqdn,rdn,rurl,qurl,qpath,file,ufile,key,value,kv,dir,udir)
-em, -extension-match string[] match output for given extension (eg, -em php,html,js,none)
-ef, -extension-filter string[] filter output for given extension (eg, -ef png,css)
-ndef, -no-default-ext-filter bool remove default extensions from the filter list
-mdc, -match-condition string match response with dsl based condition
-fdc, -filter-condition string filter response with dsl based condition
-duf, -disable-unique-filter disable duplicate content filtering
-filter-page-type string[] filter response with page type (e.g. error,captcha,parked)
RATE-LIMIT:
-c, -concurrency int number of concurrent fetchers to use (default 10)
-p, -parallelism int number of concurrent inputs to process (default 10)
-rd, -delay int request delay between each request in seconds
-rl, -rate-limit int maximum requests to send per second (default 150)
-rlm, -rate-limit-minute int maximum number of requests to send per minute
-hrl, -host-rate-limit int maximum requests to send per second per host
-hrlm, -host-rate-limit-minute int maximum number of requests to send per minute per host
UPDATE:
-up, -update update katana to latest version
-duc, -disable-update-check disable automatic katana update check
OUTPUT:
-o, -output string file to write output to
-output-template string custom output template
-sr, -store-response store http requests/responses
-srd, -store-response-dir string store http requests/responses to custom directory
-ncb, -no-clobber do not overwrite output file
-sfd, -store-field-dir string store per-host field to custom directory
-or, -omit-raw omit raw requests/responses from jsonl output
-ob, -omit-body omit response body from jsonl output
-lof, -list-output-fields list available fields for jsonl output format
-eof, -exclude-output-fields exclude fields from jsonl output
-j, -jsonl write output in jsonl format
-nc, -no-color disable output content coloring (ANSI escape codes)
-silent display output only
-v, -verbose display verbose output
-debug display debug output
-version display project version
katana को क्रॉल करने के लिए url या endpoint की आवश्यकता होती है और यह एकल या एकाधिक इनपुट स्वीकार करता है।
इनपुट URL -u विकल्प का उपयोग करके प्रदान किया जा सकता है, और अल्पविराम से अलग किए गए इनपुट का उपयोग करके एकाधिक मान प्रदान किए जा सकते हैं, इसी प्रकार -list विकल्प का उपयोग करके फ़ाइल इनपुट समर्थित है और इसके अतिरिक्त पाइप्ड इनपुट (stdin) भी समर्थित है।
katana -u https://tesla.com
#### एकाधिक URL इनपुट (अल्पविराम-पृथक्कृत)```sh
katana -u https://tesla.com,https://google.com
$ cat url_list.txt
https://tesla.com https://google.com
**एक मॉड्यूल की जांच करें और प्रिंट करें**
कोड: `fmt.Println(color.HiCyanString("\n check scan results"))`
<p align="center">
<img src="https://raw.githubusercontent.com/projectdiscovery/katana/HEAD/static/img/28.png" width="1100" />
</p>
**सभी मॉड्यूल्स को स्कैन करें**
कोड: `fmt.Println(color.HiCyanString("\n Scan all modules"))`
<p align="center">
<img src="https://raw.githubusercontent.com/projectdiscovery/katana/HEAD/static/img/29.png" width="1100" />
</p>
**परिणाम प्रिंट करें**
कोड: `fmt.Println(color.HiCyanString("\n Print all scan results"))`
<p align="center">
<img src="https://raw.githubusercontent.com/projectdiscovery/katana/HEAD/static/img/30.png" width="1100" />
</p>
</details>```
katana -list url_list.txt
echo https://tesla.com | katana
# 🏁 निष्कर्ष
**Mallocybers** आक्रामक सुरक्षा क्षेत्र में एक विशेष उपकरण का प्रतिनिधित्व करता है, जो विशेष रूप से Mali GPU परिवार की अद्वितीय वास्तुकला के साथ काम करने के लिए डिज़ाइन किया गया है। हालांकि यह एक विशिष्ट उपकरण है, इसका प्रभाव ARM Mali GPU के साथ काम करने वाले सुरक्षा पेशेवरों, मोबाइल डिवाइस पेनिट्रेशन परीक्षकों और GPU-आधारित हमले की सतहों की खोज करने वाले शोधकर्ताओं के लिए महत्वपूर्ण है।
इस उपकरण की ताकत पारंपरिक कर्नेल सुरक्षा और सुरक्षा तंत्रों को बायपास करने की क्षमता में निहित है, जो उस स्तर पर काम करता है जहां मानक निगरानी उपकरण इसकी गतिविधियों का पता नहीं लगा सकते। हालांकि, इसका यह अर्थ भी है कि Mallocybers का उपयोग करने के लिए कर्नेल आंतरिक कार्यप्रणाली, GPU प्रोग्रामिंग और निम्न-स्तरीय सिस्टम शोषण की गहरी समझ की आवश्यकता होती है।
सुरक्षा शोधकर्ताओं के लिए, **Mallocybers** प्रदान करता है:
- GPU-आधारित हमला वेक्टर का अध्ययन करने के लिए एक अनूठा मंच
- नए कोणों से मोबाइल डिवाइस सुरक्षा का परीक्षण करने की क्षमताएं
- Mali GPU विशिष्ट सुभेद्यता वर्गों की समझ
- पारंपरिक कर्नेल सुरक्षा उपायों को बायपास करने के उपकरण
ओपन-सोर्स प्रकृति निरंतर सुधार, समुदाय योगदान और पारदर्शिता सुनिश्चित करती है - आक्रामक सुरक्षा उपकरणों में महत्वपूर्ण कारक जहां विश्वास और सत्यापनीयता सर्वोपरि हैं।
याद रखें: यह उपकरण केवल अधिकृत सुरक्षा परीक्षण के लिए डिज़ाइन किया गया है। Mallocybers के साथ किसी भी सिस्टम का परीक्षण करने से पहले हमेशा सुनिश्चित करें कि आपके पास उचित प्राधिकरण है।```sh
cat domains | httpx | katana
उदाहरण katana चलाना -```console 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
## क्रॉलिंग मोड
### मानक मोड
मानक क्रॉलिंग विधा HTTP अनुरोधों/प्रतिक्रियाओं को संभालने के लिए अंतर्निहित रूप से मानक go http लाइब्रेरी का उपयोग करती है। यह विधा बहुत तेज़ है क्योंकि इसमें ब्राउज़र का ओवरहेड नहीं होता है। फिर भी, यह HTTP प्रतिक्रिया निकाय का विश्लेषण यथावत रूप से करती है, बिना किसी जावास्क्रिप्ट या DOM रेंडरिंग के, संभावित रूप से पोस्ट-DOM-रेंडर किए गए एंडपॉइंट या अतुल्यकालिक एंडपॉइंट कॉल को खो सकती है जो जटिल वेब अनुप्रयोगों में हो सकते हैं, उदाहरण के लिए, ब्राउज़र-विशिष्ट घटनाओं पर निर्भर करते हुए।
### हेडलेस मोड
हेडलेस मोड HTTP अनुरोधों/प्रतिक्रियाओं को सीधे ब्राउज़र संदर्भ के भीतर संभालने के लिए आंतरिक हेडलेस कॉल को हुक करता है। यह दो लाभ प्रदान करता है:
- HTTP फ़िंगरप्रिंट (TLS और उपयोगकर्ता एजेंट) पूरी तरह से क्लाइंट को एक वैध ब्राउज़र के रूप में पहचानता है
- बेहतर कवरेज क्योंकि एंडपॉइंट की खोज पिछली विधा की तरह मानक कच्ची प्रतिक्रिया और जावास्क्रिप्ट सक्षम के साथ ब्राउज़र-रेंडर की गई प्रतिक्रिया दोनों का विश्लेषण करके की जाती है।
हेडलेस क्रॉलिंग वैकल्पिक है और इसे `-headless` विकल्प का उपयोग करके सक्षम किया जा सकता है।
यहाँ अन्य हेडलेस CLI विकल्प हैं -```console
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
-cwu, -chrome-ws-url string use chrome browser instance launched elsewhere with the debugger listening at this URL
-xhr, -xhr-extraction extract xhr requests
-pls, -page-load-strategy string page load strategy (heuristic, load, domcontentloaded, networkidle, none) (default "heuristic")
-dwt, -dom-wait-time int time in seconds to wait after page load when using domcontentloaded strategy (default 5)
-csp, -captcha-solver-provider string captcha solver provider (e.g. capsolver)
-csk, -captcha-solver-key string captcha solver provider api key
-no-sandboxहेडलेस क्रोम ब्राउज़र को no-sandbox विकल्प के साथ चलाता है, जो रूट उपयोगकर्ता के रूप में चलने पर उपयोगी है।```console katana -u https://tesla.com -headless -no-sandbox
*`-no-incognito`*
----
बिना इन्कॉग्निटो मोड के हेडलेस क्रोम ब्राउज़र चलाता है, स्थानीय ब्राउज़र का उपयोग करते समय उपयोगी है।```console
katana -u https://tesla.com -headless -no-incognito
To preserve cookies and other browser session data across runs, combine -no-incognito with -chrome-data-dir so Katana reuses your chosen Chrome profile directory instead of an isolated temporary one.```console
katana -u https://tesla.com -headless -no-incognito -chrome-data-dir /tmp/katana-profile
*`-headless-options`*
----
जब हेडलेस मोड में क्रॉलिंग कर रहे हों, तो `-headless-options` का उपयोग करके अतिरिक्त क्रोम विकल्प निर्दिष्ट किए जा सकते हैं, उदाहरण के लिए -```console
katana -u https://tesla.com -headless -system-chrome -headless-options --disable-gpu,proxy-server=http://127.0.0.1:8080
-page-load-strategyहेडलेस मोड में पेज लोड होने के लिए कटाना कैसे प्रतीक्षा करता है, इसे नियंत्रित करता है। विभिन्न प्रकार के वेब एप्लिकेशन के लिए अलग-अलग रणनीतियाँ उपयोगी होती हैं:
The `domcontentloaded` strategy विशेष रूप से Single Page Applications (SPAs) के लिए उपयोगी है जो निरंतर बैकग्राउंड अनुरोधों (websockets, polling आदि) के कारण कभी पूरी तरह से लोड नहीं होती हैं।
*`-dom-wait-time`*
----
जब `domcontentloaded` पेज लोड रणनीति का उपयोग किया जाता है, तो यह विकल्प निर्दिष्ट करता है कि DOMContentLoaded इवेंट फायर होने के बाद कितने सेकंड प्रतीक्षा करनी है। इससे JavaScript को इंटरएक्टिव एलिमेंट्स रेंडर करने का समय मिलता है। डिफ़ॉल्ट 5 सेकंड है।```console
katana -u https://tesla.com -headless -pls domcontentloaded -dwt 10
Katana हेडलेस क्रॉलिंग के दौरान स्वचालित कैप्चा पहचान और समाधान का समर्थन करता है। जब कोई कैप्चा पेज सामना होता है, तो katana कैप्चा प्रदाता की पहचान करता है, इसे बाहरी सेवा के माध्यम से हल करता है, और क्रॉलिंग जारी रखता है।
समर्थित कैप्चा प्रकार: reCAPTCHA v2, reCAPTCHA v3, reCAPTCHA Enterprise, Cloudflare Turnstile, hCaptcha
-captcha-solver-providerकैप्चा सॉल्वर प्रदाता निर्दिष्ट करने का विकल्प. वर्तमान में समर्थित: capsolver।
-captcha-solver-keyकैप्चा सॉल्वर प्रदाता के लिए API कुंजी.```console katana -u https://example.com -headless -csp capsolver -csk YOUR_API_KEY
प्रदाता और कुंजी को पर्यावरण चर के माध्यम से भी सेट किया जा सकता है:```console
export CAPTCHA_SOLVER_PROVIDER=capsolver
export CAPTCHA_SOLVER_KEY=YOUR_API_KEY
katana -u https://example.com -headless
यदि स्कोप परिभाषित नहीं किया गया तो क्रॉलिंग अंतहीन हो सकती है, इसलिए katana क्रॉल स्कोप को परिभाषित करने के लिए कई समर्थन के साथ आता है।
-field-scopeपूर्वनिर्धारित फ़ील्ड नाम के साथ स्कोप परिभाषित करने का सबसे आसान विकल्प, rdn फ़ील्ड स्कोप के लिए डिफ़ॉल्ट विकल्प है।
rdn - क्रॉलिंग रूट डोमेन नाम और सभी सबडोमेन तक सीमित है (e.g. *example.com) (default)fqdn - क्रॉलिंग दिए गए सबडोमेन तक सीमित है (e.g. www.example.com or api.example.com)dn - क्रॉलिंग डोमेन नाम कीवर्ड तक सीमित है (e.g. example)```console
katana -u https://tesla.com -fs dn*`-crawl-scope`*
------
उन्नत स्कोप नियंत्रण के लिए, `-cs` विकल्प का उपयोग किया जा सकता है जो **regex** समर्थन के साथ आता है।```console
katana -u https://tesla.com -cs login
कई दायरे में नियमों के लिए, मल्टीलाइन स्ट्रिंग / रेगेक्स के साथ फ़ाइल इनपुट पास किया जा सकता है।```bash $ cat in_scope.txt
login/ admin/ app/ wordpress/

```console
katana -u https://tesla.com -cs in_scope.txt
-crawl-out-scopecrawl न करने के लिए परिभाषित करने हेतु, -cos विकल्प का उपयोग किया जा सकता है और यह regex इनपुट का भी समर्थन करता है।```console
katana -u https://tesla.com -cos logout
कई आउट ऑफ़ स्कोप नियमों के लिए, मल्टीलाइन स्ट्रिंग / रेगेक्स के साथ फ़ाइल इनपुट पास किया जा सकता है।```bash
$ cat out_of_scope.txt
/logout
/log_out
कस्टम स्क्रिप्ट्स को डेटा संरचनाओं में फ़िल्टर करना।```console katana -u https://tesla.com -cos out_of_scope.txt
*`-no-scope`*
----
Katana डिफ़ॉल्ट रूप से `*.domain` को स्कोप करता है, इसे अक्षम करने के लिए `-ns` विकल्प का उपयोग किया जा सकता है और इंटरनेट को क्रॉल करने के लिए भी।```console
katana -u https://tesla.com -ns
-display-out-scopeडिफ़ॉल्ट रूप से, जब स्कोप विकल्प का उपयोग किया जाता है, यह आउटपुट के रूप में प्रदर्शित होने वाले लिंक पर भी लागू होता है, जैसे कि बाहरी URL को डिफ़ॉल्ट रूप से बाहर रखा जाता है और इस व्यवहार को ओवरराइट करने के लिए, -do विकल्प का उपयोग उन सभी बाहरी URL को प्रदर्शित करने के लिए किया जा सकता है जो लक्ष्य के स्कोप किए गए URL/एंडपॉइंट में मौजूद हैं।```
katana -u https://tesla.com -do
यहां स्कोप नियंत्रण के लिए सभी CLI विकल्प हैं -```console
katana -h scope
Flags:
SCOPE:
-cs, -crawl-scope string[] in scope url regex to be followed by crawler
-cos, -crawl-out-scope string[] out of scope url regex to be excluded by crawler
-fs, -field-scope string pre-defined scope field (dn,rdn,fqdn) (default "rdn")
-ns, -no-scope disables host based default scope
-do, -display-out-scope display external endpoint from scoped crawling
Katana के पास क्रॉल को हमारी इच्छानुसार कॉन्फ़िगर और नियंत्रित करने के लिए कई विकल्प हैं।
-depthक्रॉलिंग के लिए urls का अनुसरण करने के लिए depth परिभाषित करने का विकल्प, जितनी अधिक depth होगी, उतने अधिक endpoint क्रॉल होंगे + क्रॉल का समय।```
katana -u https://tesla.com -d 5
*`-js-crawl`*
----
जावास्क्रिप्ट फ़ाइल पार्सिंग को सक्षम करने + जावास्क्रिप्ट फ़ाइलों में खोजे गए एंडपॉइंट्स को क्रॉल करने का विकल्प, डिफ़ॉल्ट रूप से अक्षम।```
katana -u https://tesla.com -jc
-crawl-durationक्रॉल अवधि को पूर्वनिर्धारित करने का विकल्प, डिफ़ॉल्ट रूप से अक्षम।``` katana -u https://tesla.com -ct 2
*`-known-files`*
----
`robots.txt` और `sitemap.xml` फ़ाइलों को क्रॉल करने का विकल्प, डिफ़ॉल्ट रूप से अक्षम।```
katana -u https://tesla.com -kf robotstxt,sitemapxml
-automatic-form-fillज्ञात/अज्ञात फ़ील्ड के लिए स्वचालित फ़ॉर्म भरने को सक्षम करने का विकल्प, ज्ञात फ़ील्ड मानों को फ़ॉर्म कॉन्फ़िग फ़ाइल $HOME/.config/katana/form-config.yaml को अपडेट करके आवश्यकतानुसार अनुकूलित किया जा सकता है।
स्वचालित फ़ॉर्म भरना एक प्रयोगात्मक सुविधा है।``` katana -u https://tesla.com -aff
फ़ॉर्म कॉन्फ़िग वैल्यू डायनामिक डेटा जनरेशन के लिए DSL हेल्पर फ़ंक्शंस का समर्थन करती हैं। [projectdiscovery/dsl](https://github.com/projectdiscovery/dsl) लाइब्रेरी के सभी `rand_*` फ़ंक्शंस उपलब्ध हैं:```yaml
# $HOME/.config/katana/form-config.yaml
email: "rand_email()"
phone: "rand_phone()"
placeholder: "rand_first_name()"
password: 'rand_base(16, "")'
color: "#e66465"
-filter-similarसमान दिखने वाले URL की क्रॉलिंग को फ़िल्टर करने का विकल्प, परिवर्तनीय पथ खंडों को सामान्य करके। यह आईडी, UUID, हैश, तिथियाँ और अन्य गतिशील मानों का पता लगाता है, और रनटाइम पर दोहराए जाने वाले पैटर्न को भी सीखता है। उदाहरण के लिए, /users/123 और /users/456 को एक ही एंडपॉइंट माना जाता है।```
katana -u https://tesla.com -fsu
प्रमोशन थ्रेशोल्ड (किसी पथ स्थिति पर कितने अलग-अलग मान होने पर इसे पैरामीटर के रूप में माना जाता है) को `-fst` के साथ ट्यून किया जा सकता है। कम मान अधिक आक्रामक होते हैं (कम URLs क्रॉल किए जाते हैं), अधिक मान अधिक अनुमति देने वाले होते हैं। डिफ़ॉल्ट `10` है।```
katana -u https://tesla.com -fsu -fst 5
-max-domain-pagesप्रति डोमेन क्रॉल किए जाने वाले पृष्ठों की संख्या सीमित करने का विकल्प। किसी एक डोमेन को पूरे क्रॉल बजट का उपभोग करने से रोकता है, बड़ी साइटों या क्रॉलर ट्रैप सुरक्षा के लिए उपयोगी।``` katana -u https://tesla.com -mdp 100
## नॉलेज बेस वर्गीकरण
Katana क्रॉल परिणामों को **नॉलेज बेस** से समृद्ध कर सकता है — प्रत्येक क्रॉल किए गए पृष्ठ का मशीन-लर्निंग वर्गीकरण जो [dit](https://github.com/HappyHackingSpace/dit) द्वारा संचालित है। सक्षम होने पर, प्रत्येक प्रतिक्रिया को **पृष्ठ प्रकार** (जैसे `login`, `error`, `captcha`, `parked`) द्वारा वर्गीकृत किया जाता है और पृष्ठ पर किसी भी फॉर्म की पहचान की जाती है, जिसके परिणाम को JSONL आउटपुट के `knowledgebase` फ़ील्ड से जोड़ा जाता है। यह **सभी इंजनों** (मानक और हेडलेस) पर काम करता है।
> **नोट**: वर्गीकरण मॉडल पहले उपयोग पर स्वचालित रूप से `~/.dit/model.json` पर डाउनलोड किया जाता है ([Hugging Face](https://huggingface.co/datasets/happyhackingspace/dit) से)। यह एक बार का, प्रति-मशीन लागत है — बाद के रन कैश्ड मॉडल का पुन: उपयोग करते हैं। `dit` की कोई मैन्युअल स्थापना आवश्यक नहीं है।
*`-knowledge-base`*
----
नॉलेज बेस वर्गीकरण सक्षम करें। पृष्ठ-प्रकार और फॉर्म वर्गीकरण प्रत्येक परिणाम के `knowledgebase` फ़ील्ड में जोड़ा जाता है।```console
katana -u https://example.com -kb -jsonl
Note: The -serveroption is required when accessing environments that are not listed in the public environments registry. The agent uses this parameter to send the registration request. You can override the configured value in real-time using the-i` option for interactive selection (see below).````json
{
"timestamp": "...",
"request": { "...": "..." },
"response": {
"...": "...",
"knowledgebase": {
"PageType": "login",
"Forms": [{ "type": "login", "fields": { "username": "username or email", "password": "password" } }]
}
}
}
*`-filter-page-type`*
----
परिणामों को केवल दिए गए पृष्ठ प्रकार(प्रकारों) में फ़िल्टर करें। इसे सक्षम करने का अर्थ है `-kb` (वर्गीकरणकर्ता स्वचालित रूप से आरंभ होता है)।```console
katana -u https://example.com -fpt login,error
-kb-secretsज्ञानकोष में रहस्य निकालने वाले उपकरण को सक्षम करें, जिससे पहचाने गए रहस्य (API कुंजियाँ, टोकन, आदि) secrets कुंजी के अंतर्गत प्रदर्शित होते हैं। पहचाने गए रहस्यों को उनके प्रदाता के विरुद्ध सत्यापित करने के लिए -kb-validate-secrets जोड़ें — ध्यान दें कि यह लाइव API कॉल भेजता है।```console
katana -u https://example.com -kb-secrets
*`-kb-endpoints`*
----
एंडपॉइंट्स एक्सट्रैक्टर को सक्षम करें, जो अनुरोधों को `endpoints` कुंजी के अंतर्गत REST, GraphQL, SOAP, या XHR के रूप में वर्गीकृत करता है।```console
katana -u https://example.com -kb-endpoints
प्रमाणीकृत क्रॉलिंग में संरक्षित संसाधनों तक पहुँचने के लिए HTTP अनुरोधों में कस्टम हेडर या कुकीज़ शामिल करना शामिल है। ये हेडर प्रमाणीकरण या प्राधिकरण जानकारी प्रदान करते हैं, जिससे आप प्रमाणीकृत सामग्री/एंडपॉइंट को क्रॉल कर सकते हैं। आप कमांड लाइन पर सीधे हेडर निर्दिष्ट कर सकते हैं या प्रमाणीकृत क्रॉलिंग करने के लिए katana के साथ उन्हें एक फ़ाइल के रूप में प्रदान कर सकते हैं।
नोट: उपयोगकर्ता को katana के साथ उपयोग करने के लिए मैन्युअल रूप से प्रमाणीकरण करना और सत्र कुकी/हेडर को फ़ाइल में निर्यात करना होगा।
-headersअनुरोध में कस्टम हेडर या कुकी जोड़ने का विकल्प।
HTTP विनिर्देश में हेडर का सिंटैक्स
अनुरोध में कुकी जोड़ने का एक उदाहरण यहाँ दिया गया है:``` katana -u https://tesla.com -H 'Cookie: usrsess=AmljNrESo'
हेडर या कुकीज़ को फ़ाइल के रूप में प्रदान करना भी संभव है। उदाहरण के लिए:```
$ cat cookie.txt
Cookie: PHPSESSIONID=XXXXXXXXX
X-API-KEY: XXXXX
TOKEN=XX
``` katana -u https://tesla.com -H cookie.txt
जरूरत पड़ने पर कॉन्फ़िगर करने के लिए और भी विकल्प हैं, यहाँ सभी config से संबंधित CLI विकल्प दिए गए हैं -```console
katana -h config
Flags:
CONFIGURATION:
-r, -resolvers string[] list of custom resolver (file or comma separated)
-d, -depth int maximum depth to crawl (default 3)
-jc, -js-crawl enable endpoint parsing / crawling in javascript file
-ct, -crawl-duration int maximum duration to crawl the target for
-kf, -known-files string enable crawling of known files (all,robotstxt,sitemapxml)
-mrs, -max-response-size int maximum response size to read (default 9223372036854775807)
-timeout int time to wait for request in seconds (default 10)
-aff, -automatic-form-fill enable automatic form filling (experimental)
-fx, -form-extraction enable extraction of form, input, textarea & select elements
-retry int number of times to retry the request (default 1)
-proxy string http/socks5 proxy to use
-H, -headers string[] custom header/cookie to include in request
-config string path to the katana configuration file
-fc, -form-config string path to custom form configuration file
-flc, -field-config string path to custom field configuration file
-s, -strategy string Visit strategy (depth-first, breadth-first) (default "depth-first")
-iqp, -ignore-query-params Ignore crawling same path with different query-param values
-fsu, -filter-similar filter crawling of similar looking URLs (e.g., /users/123 and /users/456)
-fst, -filter-similar-threshold int number of distinct values before a path position is treated as parameter (default 10)
-mdp, -max-domain-pages int maximum number of pages to crawl per domain (default unlimited)
Katana एक सक्रिय ब्राउज़र सत्र से भी कनेक्ट हो सकता है जहाँ उपयोगकर्ता पहले से लॉग इन और प्रमाणित है, और इसे क्रॉलिंग के लिए उपयोग कर सकता है। इसके लिए एकमात्र आवश्यकता है कि ब्राउज़र को रिमोट डीबगिंग सक्षम करके शुरू किया जाए।
यहाँ रिमोट डीबगिंग सक्षम करके क्रोम ब्राउज़र शुरू करने और इसे katana के साथ उपयोग करने का एक उदाहरण है -
चरण 1) पहले क्रोम एक्जीक्यूटेबल का पथ ज्ञात करें
चरण 2) क्रोम को रिमोट डीबगिंग सक्षम करके शुरू करें, जिससे वेबसॉकेट URL वापस मिलेगा। उदाहरण के लिए, MacOS पर, आप निम्नलिखित कमांड का उपयोग करके क्रोम को रिमोट डीबगिंग सक्षम करके शुरू कर सकते हैं -
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222
``````console
$ /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222
DevTools listening on ws://127.0.0.1:9222/devtools/browser/c5316c9c-19d6-42dc-847a-41d1aeebf7d6
अब उस वेबसाइट में लॉगिन करें जिसे आप क्रॉल करना चाहते हैं और ब्राउज़र को खुला रखें।
चरण 3) अब कटाना के साथ वेबसॉकेट यूआरएल का उपयोग करके सक्रिय ब्राउज़र सत्र से कनेक्ट करें और वेबसाइट को क्रॉल करें```console katana -headless -u https://tesla.com -cwu ws://127.0.0.1:9222/devtools/browser/c5316c9c-19d6-42dc-847a-41d1aeebf7d6 -no-incognito
> **नोट**: आप `-cdd` विकल्प का उपयोग करके कस्टम क्रोम डेटा निर्देशिका निर्दिष्ट कर सकते हैं ताकि ब्राउज़र डेटा और कुकीज़ संग्रहीत हों, लेकिन यदि कुकी को केवल `Session` पर सेट किया गया है या निश्चित समय के बाद समाप्त हो जाती है तो यह सत्र डेटा सहेजता नहीं है।
## फ़िल्टर
*`-field`*
----
> [!चेतावनी]
> अप्रचलित: इसके बजाय [**`-output-template`**](#-output-template) का उपयोग करें। पश्चगामी संगतता के लिए फ़ील्ड ध्वज अभी भी समर्थित है।
Katana में अंतर्निहित फ़ील्ड्स होते हैं जिनका उपयोग आउटपुट को वांछित जानकारी के लिए फ़िल्टर करने के लिए किया जा सकता है, `-f` विकल्प का उपयोग किसी भी उपलब्ध फ़ील्ड को निर्दिष्ट करने के लिए किया जा सकता है।```
-f, -field string field to display in output (url,path,fqdn,rdn,rurl,qurl,qpath,file,key,value,kv,dir,udir)
यहाँ प्रत्येक फ़ील्ड और उपयोग के समय अपेक्षित आउटपुट के उदाहरणों वाली एक तालिका है -
यहाँ केवल क्वेरी पैरामीटर वाले सभी URL प्रदर्शित करने के लिए फ़ील्ड विकल्प का उपयोग करने का एक उदाहरण है -``` katana -u https://tesla.com -f qurl -silent
https://shop.tesla.com/en_au?redirect=no https://shop.tesla.com/en_nz?redirect=no https://shop.tesla.com/product/men_s-raven-lightweight-zip-up-bomber-jacket?sku=1740250-00-A https://shop.tesla.com/product/tesla-shop-gift-card?sku=1767247-00-A https://shop.tesla.com/product/men_s-chill-crew-neck-sweatshirt?sku=1740176-00-A https://www.tesla.com/about?redirect=no https://www.tesla.com/about/legal?redirect=no https://www.tesla.com/findus/list?redirect=no
### कस्टम फ़ील्ड्स
आप पेज प्रतिक्रियाओं से regex नियमों का उपयोग करके विशिष्ट जानकारी निकालने और संग्रहीत करने के लिए कस्टम फ़ील्ड बना सकते हैं। ये कस्टम फ़ील्ड YAML कॉन्फ़िग फ़ाइल का उपयोग करके परिभाषित किए जाते हैं और डिफ़ॉल्ट स्थान `$HOME/.config/katana/field-config.yaml` से लोड होते हैं। वैकल्पिक रूप से, आप किसी भिन्न स्थान से कस्टम फ़ील्ड कॉन्फ़िग फ़ाइल लोड करने के लिए `-flc` विकल्प का उपयोग कर सकते हैं।
यहाँ कस्टम फ़ील्ड का उदाहरण है।```yaml
- name: email
type: regex
regex:
- '([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9_-]+)'
- '([a-zA-Z0-9+._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9_-]+)'
- name: phone
type: regex
regex:
- '\d{3}-\d{8}|\d{4}-\d{7}'
कस्टम फ़ील्ड परिभाषित करते समय, निम्नलिखित विशेषताएँ समर्थित हैं:
name विशेषता का मान
-fieldक्ली विकल्प मान के रूप में उपयोग किया जाता है।
कस्टम विशेषता का प्रकार, वर्तमान में समर्थित विकल्प -
regex
वह भाग जिससे जानकारी निकाली जानी है। डिफ़ॉल्ट मान
responseहै, जिसमें हेडर और बॉडी दोनों शामिल हैं। अन्य संभावित मानheaderऔरbodyहैं।
आप इस विशेषता का उपयोग रेजेक्स में किसी विशिष्ट मैच किए गए समूह को चुनने के लिए कर सकते हैं, उदाहरण:
group: 1
katana -u https://tesla.com -f email,phone
*`-store-field`*
---
`field` विकल्प के पूरक के रूप में, जो रन टाइम पर आउटपुट को फ़िल्टर करने के लिए उपयोगी है, `-sf, -store-fields` विकल्प है जो फ़ील्ड विकल्प के समान ही काम करता है, सिवाय इसके कि फ़िल्टर करने के बजाय, यह सारी जानकारी `katana_field` निर्देशिका में डिस्क पर संग्रहीत करता है, जो लक्ष्य URL द्वारा क्रमबद्ध होती है। डेटा को किसी भिन्न स्थान पर संग्रहीत करने के लिए `-sfd` या `-store-field-dir` का उपयोग करें।```
katana -u https://tesla.com -sf key,fqdn,qurl -silent
| Flag | Description |
|---|---|
| vmx | Intel हार्डवेयर वर्चुअलाइजेशन |
| svm | AMD हार्डवेयर वर्चुअलाइजेशन |
| $ ls katana_field/ |
https_www.tesla.com_fqdn.txt https_www.tesla.com_key.txt https_www.tesla.com_qurl.txt
`-store-field` विकल्प लक्षित वर्डलिस्ट बनाने के लिए जानकारी इकट्ठा करने में उपयोगी हो सकता है, जिसमें विभिन्न उद्देश्य शामिल हैं, लेकिन इन्हीं तक सीमित नहीं:
- सबसे अधिक उपयोग किए जाने वाले पैरामीटर्स की पहचान करना
- बार-बार उपयोग किए जाने वाले पथों की खोज करना
- सामान्यतः उपयोग की जाने वाली फाइलें ढूँढना
- संबंधित या अज्ञात उपडोमेन की पहचान करना
### Katana फिल्टर
*`-extension-match`*
---
क्रॉल आउटपुट को विशिष्ट एक्सटेंशन के लिए `-em` विकल्प का उपयोग करके आसानी से मैच किया जा सकता है ताकि केवल दिए गए एक्सटेंशन वाला आउटपुट प्रदर्शित हो सके।```
katana -u https://tesla.com -silent -em js,jsp,json
आउटपुट में फ़ाइल एक्सटेंशन के बिना URL शामिल करने के लिए विशेष मान none का उपयोग करें:```
katana -u https://tesla.com -silent -em js,jsp,json,none
*`-extension-filter`*
---
क्रॉल आउटपुट को विशिष्ट एक्सटेंशन के लिए `-ef` विकल्प का उपयोग करके आसानी से फ़िल्टर किया जा सकता है, जो दिए गए एक्सटेंशन वाले सभी url को हटाना सुनिश्चित करता है।```
katana -u https://tesla.com -silent -ef css,txt,md
-no-default-ext-filterKatana डिफ़ॉल्ट रूप से कई एक्सटेंशन को फ़िल्टर करता है। इसे -ndef विकल्प के साथ अक्षम किया जा सकता है।```
katana -u https://tesla.com -silent -ndef
*`-match-regex`*
---
`-match-regex` या `-mr` फ़्लैग आपको रेगुलर एक्सप्रेशन का उपयोग करके आउटपुट URL को फ़िल्टर करने की अनुमति देता है। इस फ़्लैग का उपयोग करते समय, केवल वे URL आउटपुट में मुद्रित होंगे जो निर्दिष्ट रेगुलर एक्सप्रेशन से मेल खाते हैं।```
katana -u https://tesla.com -mr 'https://shop\.tesla\.com/*' -silent
-filter-regex-filter-regex या -fr फ़्लैग आपको रेगुलर एक्सप्रेशन का उपयोग करके आउटपुट URL को फ़िल्टर करने की अनुमति देता है। इस फ़्लैग का उपयोग करते समय, यह उन URL को छोड़ देगा जो निर्दिष्ट रेगुलर एक्सप्रेशन से मेल खाते हैं।```
katana -u https://tesla.com -fr 'https://www\.tesla\.com/*' -silent
### उन्नत फ़िल्टरिंग
Katana DSL-आधारित अभिव्यक्तियों को उन्नत मिलान और फ़िल्टरिंग क्षमताओं के लिए समर्थन करता है:
- 200 स्टेटस कोड वाले एंडपॉइंट्स को मिलाने के लिए:```shell
katana -u https://www.hackerone.com -mdc 'status_code == 200'
- PHP प्रौद्योगिकियों के साथ एंडपॉइंट्स मिलाने के लिए:```shell
katana -u https://www.hackerone.com -mdc 'contains(to_lower(technologies), "php")'
DSL फ़ंक्शंस को jsonl आउटपुट में किसी भी कुंजी पर लागू किया जा सकता है। उपलब्ध DSL फ़ंक्शंस के बारे में अधिक जानकारी के लिए, कृपया [dsl project](https://github.com/projectdiscovery/dsl) पर जाएं।
यहाँ अतिरिक्त फ़िल्टर विकल्प हैं -```console
katana -h filter
Flags:
FILTER:
-mr, -match-regex string[] regex or list of regex to match on output url (cli, file)
-fr, -filter-regex string[] regex or list of regex to filter on output url (cli, file)
-f, -field string field to display in output (url,path,fqdn,rdn,rurl,qurl,qpath,file,ufile,key,value,kv,dir,udir)
-sf, -store-field string field to store in per-host output (url,path,fqdn,rdn,rurl,qurl,qpath,file,ufile,key,value,kv,dir,udir)
-em, -extension-match string[] match output for given extension (eg, -em php,html,js,none)
-ef, -extension-filter string[] filter output for given extension (eg, -ef png,css)
-ndef, -no-default-ext-filter bool remove default extensions from the filter list
-mdc, -match-condition string match response with dsl based condition
-fdc, -filter-condition string filter response with dsl based condition
-duf, -disable-unique-filter disable duplicate content filtering
यदि लक्ष्य वेबसाइटों की सीमाओं का पालन नहीं किया जाता है तो क्रॉलिंग के दौरान ब्लॉक / प्रतिबंधित होना आसान है, katana क्रॉल को हम जितनी तेज़ / धीमी चाहते हैं उतनी गति से चलाने के लिए कई विकल्पों के साथ आता है।
-delayक्रॉलिंग के दौरान katana द्वारा किए जाने वाले प्रत्येक नए अनुरोध के बीच सेकंड में विलंब जोड़ने का विकल्प, डिफ़ॉल्ट रूप से अक्षम।``` katana -u https://tesla.com -delay 20
*`-concurrency`*
-----
प्रति लक्ष्य पर एक ही समय में लाने के लिए urls की संख्या को नियंत्रित करने का विकल्प।```
katana -u https://tesla.com -c 20
-parallelismसूची इनपुट से एक साथ प्रोसेस करने के लिए लक्ष्यों की संख्या निर्धारित करने का विकल्प।``` katana -u https://tesla.com -p 20
*`-rate-limit`*
-----
प्रति सेकंड अधिकतम अनुरोध, सभी होस्ट पर वैश्विक रूप से लागू।```
katana -u https://tesla.com -rl 100
-rate-limit-minuteप्रति मिनट अधिकतम अनुरोध, सभी होस्टों पर वैश्विक रूप से लागू।``` katana -u https://tesla.com -rlm 500
*`-host-rate-limit`*
-----
प्रति होस्ट प्रति सेकंड अधिकतम अनुरोध। प्रत्येक होस्ट को अपनी स्वयं की दर-सीमा बाल्टी मिलती है, ताकि धीमा होस्ट तेज़ होस्ट को सीमित न करे। सेट होने पर यह वैश्विक दर-सीमा को बदल देता है। जब कोई होस्ट 429 या 503 लौटाता है, तो Katana एक्सपोनेंशियल विलंब और जिटर के साथ स्वचालित रूप से बैक ऑफ भी करता है।```console
katana -u https://tesla.com -hrl 50
-host-rate-limit-minuteप्रति होस्ट प्रति मिनट अधिकतम अनुरोध।```console katana -u https://tesla.com -hrlm 200
यहाँ दर सीमा नियंत्रण के लिए सभी लंबे/छोटे CLI विकल्प हैं -```console
katana -h rate-limit
Flags:
RATE-LIMIT:
-c, -concurrency int number of concurrent fetchers to use (default 10)
-p, -parallelism int number of concurrent inputs to process (default 10)
-rd, -delay int request delay between each request in seconds
-rl, -rate-limit int maximum requests to send per second (default 150)
-rlm, -rate-limit-minute int maximum number of requests to send per minute
-hrl, -host-rate-limit int maximum requests to send per second per host
-hrlm, -host-rate-limit-minute int maximum number of requests to send per minute per host
Katana दोनों प्रकार के आउटपुट को सपोर्ट करता है: सादा टेक्स्ट फॉर्मेट के साथ-साथ JSON भी, जिसमें खोजे गए एंडपॉइंट को सह-संबंधित करने के लिए source, tag, और attribute नाम जैसी अतिरिक्त जानकारी शामिल होती है।
-outputडिफ़ॉल्ट रूप से, katana क्रॉल किए गए एंडपॉइंट को सादा टेक्स्ट फॉर्मेट में आउटपुट करता है। परिणामों को -output विकल्प का उपयोग करके एक फ़ाइल में लिखा जा सकता है।```console
katana -u https://example.com -no-scope -output example_endpoints.txt
*`-output-template`*
---
`-output-template` विकल्प आपको टेम्पलेट का उपयोग करके आउटपुट प्रारूप को अनुकूलित करने की अनुमति देता है, जिससे आउटपुट संरचना को परिभाषित करने में लचीलापन मिलता है। यह विकल्प आउटपुट को फ़िल्टर करने के लिए पुराने `-field` फ़्लैग को बदलता है। पूर्वनिर्धारित फ़ील्ड पर निर्भर रहने के बजाय, आप कमांड लाइन में सीधे एक कस्टम टेम्पलेट निर्दिष्ट कर सकते हैं ताकि नियंत्रित किया जा सके कि निकाले गए डेटा को कैसे प्रस्तुत किया जाए।
`-output-template` विकल्प का उपयोग करने का उदाहरण:```sh
katana -u https://example.com -output-template '{{email}} - {{url}}'
इस उदाहरण में, email एक कस्टम फ़ील्ड को दर्शाता है जो स्रोत url के भीतर पाए गए ईमेल पतों को निकालता और प्रदर्शित करता है।
[!NOTE] यदि कोई निर्दिष्ट फ़ील्ड मौजूद नहीं है या उसमें कोई मान नहीं है, तो इसे आउटपुट से हटा दिया जाएगा।
यह विकल्प आउटपुट को इस प्रकार संरचित कर सकता है जो आपके उपयोग के मामले के लिए सबसे उपयुक्त हो, जिससे डेटा निष्कर्षण अधिक सहज और अनुकूलन योग्य हो जाता है।
-jsonl
---```console
katana -u https://example.com -jsonl | jq .
पारदर्शी निगरानी। यह आपको अपने वेब अनुप्रयोगों द्वारा संसाधित सभी MySQL, MariaDB, और Percona Server अनुरोधों को लॉग करने की अनुमति देता है, जबकि इन अनुप्रयोगों के व्यवहार को बनाए रखता है।```json
{
"timestamp": "2023-03-20T16:23:58.027559+05:30",
"request": {
"method": "GET",
"endpoint": "https://example.com",
"raw": "GET / HTTP/1.1\r\nHost: example.com\r\nUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36\r\nAccept-Encoding: gzip\r\n\r\n"
},
"response": {
"status_code": 200,
"headers": {
"accept_ranges": "bytes",
"expires": "Mon, 27 Mar 2023 10:53:58 GMT",
"last_modified": "Thu, 17 Oct 2019 07:18:26 GMT",
"content_type": "text/html; charset=UTF-8",
"server": "ECS (dcb/7EA3)",
"vary": "Accept-Encoding",
"etag": "\"3147526947\"",
"cache_control": "max-age=604800",
"x_cache": "HIT",
"date": "Mon, 20 Mar 2023 10:53:58 GMT",
"age": "331239"
},
"body": "<!doctype html>\n<html>\n<head>\n <title>Example Domain</title>\n\n <meta charset=\"utf-8\" />\n <meta http-equiv=\"Content-type\" content=\"text/html; charset=utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <style type=\"text/css\">\n body {\n background-color: #f0f0f2;\n margin: 0;\n padding: 0;\n font-family: -apple-system, system-ui, BlinkMacSystemFont, \"Segoe UI\", \"Open Sans\", \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n \n }\n div {\n width: 600px;\n margin: 5em auto;\n padding: 2em;\n background-color: #fdfdff;\n border-radius: 0.5em;\n box-shadow: 2px 3px 7px 2px rgba(0,0,0,0.02);\n }\n a:link, a:visited {\n color: #38488f;\n text-decoration: none;\n }\n @media (max-width: 700px) {\n div {\n margin: 0 auto;\n width: auto;\n }\n }\n </style> \n</head>\n\n<body>\n<div>\n <h1>Example Domain</h1>\n <p>This domain is for use in illustrative examples in documents. You may use this\n domain in literature without prior coordination or asking for permission.</p>\n <p><a href=\"https://www.iana.org/domains/example\">More information...</a></p>\n</div>\n</body>\n</html>\n",
"technologies": [
"Azure",
"Amazon ECS",
"Amazon Web Services",
"Docker",
"Azure CDN"
],
"raw": "HTTP/1.1 200 OK\r\nContent-Length: 1256\r\nAccept-Ranges: bytes\r\nAge: 331239\r\nCache-Control: max-age=604800\r\nContent-Type: text/html; charset=UTF-8\r\nDate: Mon, 20 Mar 2023 10:53:58 GMT\r\nEtag: \"3147526947\"\r\nExpires: Mon, 27 Mar 2023 10:53:58 GMT\r\nLast-Modified: Thu, 17 Oct 2019 07:18:26 GMT\r\nServer: ECS (dcb/7EA3)\r\nVary: Accept-Encoding\r\nX-Cache: HIT\r\n\r\n<!doctype html>\n<html>\n<head>\n <title>Example Domain</title>\n\n <meta charset=\"utf-8\" />\n <meta http-equiv=\"Content-type\" content=\"text/html; charset=utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <style type=\"text/css\">\n body {\n background-color: #f0f0f2;\n margin: 0;\n padding: 0;\n font-family: -apple-system, system-ui, BlinkMacSystemFont, \"Segoe UI\", \"Open Sans\", \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n \n }\n div {\n width: 600px;\n margin: 5em auto;\n padding: 2em;\n background-color: #fdfdff;\n border-radius: 0.5em;\n box-shadow: 2px 3px 7px 2px rgba(0,0,0,0.02);\n }\n a:link, a:visited {\n color: #38488f;\n text-decoration: none;\n }\n @media (max-width: 700px) {\n div {\n margin: 0 auto;\n width: auto;\n }\n }\n </style> \n</head>\n\n<body>\n<div>\n <h1>Example Domain</h1>\n <p>This domain is for use in illustrative examples in documents. You may use this\n domain in literature without prior coordination or asking for permission.</p>\n <p><a href=\"https://www.iana.org/domains/example\">More information...</a></p>\n</div>\n</body>\n</html>\n"
}
}
-store-response-store-response विकल्प सभी क्रॉल किए गए एंडपॉइंट अनुरोधों और प्रतिक्रियाओं को एक टेक्स्ट फ़ाइल में लिखने की अनुमति देता है। जब इस विकल्प का उपयोग किया जाता है, तो अनुरोध और प्रतिक्रिया सहित टेक्स्ट फ़ाइलें katana_response निर्देशिका में लिखी जाएँगी। यदि आप कोई कस्टम निर्देशिका निर्दिष्ट करना चाहते हैं, तो आप -store-response-dir विकल्प का उपयोग कर सकते हैं।```console
katana -u https://example.com -no-scope -store-response
वर्तमान में 2 अन्य खुले मुद्दे हैं।```bash
$ cat katana_response/index.txt
katana_response/example.com/327c3fda87ce286848a574982ddd0b7c7487f816.txt https://example.com (200 OK)
katana_response/www.iana.org/bfc096e6dd93b993ca8918bf4c08fdc707a70723.txt http://www.iana.org/domains/reserved (200 OK)
नोट:
-store-response विकल्प -headless मोड में समर्थित नहीं है।
-list-output-fields-list-output-fields या -lof फ़्लैग JSONL आउटपुट प्रारूप में उपयोग किए जा सकने वाले सभी उपलब्ध फ़ील्ड्स प्रदर्शित करता है। यह समझने के लिए उपयोगी है कि कस्टम आउटपुट टेम्पलेट का उपयोग करते समय या विशिष्ट फ़ील्ड्स को बाहर करते समय कौन सा डेटा उपलब्ध है।```console
katana -lof
*`-exclude-output-fields`*
----
`-exclude-output-fields` या `-eof` फ़्लैग आपको JSONL आउटपुट से विशिष्ट फ़ील्ड्स को बाहर करने की अनुमति देता है। यह आउटपुट का आकार कम करने या अवांछित फ़ील्ड्स को हटाकर विशिष्ट डेटा पर ध्यान केंद्रित करने के लिए उपयोगी है।```console
katana -u https://example.com -jsonl -eof raw,body
यहाँ आउटपुट से संबंधित अतिरिक्त CLI विकल्प दिए गए हैं -```console katana -h output
OUTPUT: -o, -output string file to write output to -sr, -store-response store http requests/responses -srd, -store-response-dir string store http requests/responses to custom directory -lof, -list-output-fields list available fields for jsonl output format -eof, -exclude-output-fields exclude fields from jsonl output -j, -json write output in JSON Lines format -nc, -no-color disable output content coloring (ANSI escape codes) -silent display output only -v, -verbose display verbose output -version display project version
## कटाना एक लाइब्रेरी के रूप में
`katana` को एक लाइब्रेरी के रूप में उपयोग किया जा सकता है, `Option` struct का एक इंस्टेंस बनाकर और उसे उन्हीं विकल्पों से भरकर जो CLI के माध्यम से निर्दिष्ट किए जाएंगे। विकल्पों का उपयोग करके आप `crawlerOptions` और फिर मानक या हाइब्रिड `crawler` बना सकते हैं। इनपुट को क्रॉल करने के लिए `crawler.Crawl` विधि को कॉल किया जाना चाहिए।```go
package main
import (
"math"
"github.com/projectdiscovery/gologger"
"github.com/projectdiscovery/katana/pkg/engine/standard"
"github.com/projectdiscovery/katana/pkg/output"
"github.com/projectdiscovery/katana/pkg/types"
)
func main() {
options := &types.Options{
MaxDepth: 3, // Maximum depth to crawl
FieldScope: "rdn", // Crawling Scope Field
BodyReadSize: math.MaxInt, // Maximum response size to read
Timeout: 10, // Timeout is the time to wait for request in seconds
Concurrency: 10, // Concurrency is the number of concurrent crawling goroutines
Parallelism: 10, // Parallelism is the number of urls processing goroutines
Delay: 0, // Delay is the delay between each crawl requests in seconds
RateLimit: 150, // Maximum requests to send per second
Strategy: "depth-first", // Visit strategy (depth-first, breadth-first)
OnResult: func(result output.Result) { // Callback function to execute for result
gologger.Info().Msg(result.Request.URL)
},
}
crawlerOptions, err := types.NewCrawlerOptions(options)
if err != nil {
gologger.Fatal().Msg(err.Error())
}
defer crawlerOptions.Close()
crawler, err := standard.New(crawlerOptions)
if err != nil {
gologger.Fatal().Msg(err.Error())
}
defer crawler.Close()
var input = "https://www.hackerone.com"
err = crawler.Crawl(input)
if err != nil {
gologger.Warning().Msgf("Could not crawl %s: %s", input, err.Error())
}
}
समस्या ट्रैकिंग को बनाए रखने और ट्राइएज दक्षता में सुधार के लिए:
सभी रिपोर्ट्स GitHub Discussions से शुरू होती हैं
पहले चर्चा क्यों?
अनुरक्षक उचित समीक्षा के बाद उपयुक्त होने पर चर्चाओं को मुद्दों में परिवर्तित करेंगे।
katana को ❤️ के साथ projectdiscovery टीम ने बनाया है और MIT License के तहत वितरित किया गया है।
| रणनीति | विवरण |
|---|
heuristic | (डिफ़ॉल्ट) स्मार्ट प्रतीक्षा जो पेज के व्यवहार के अनुसार ढल जाती है - लोड इवेंट, नेटवर्क आइडल और DOM स्थिरता की प्रतीक्षा करता है |
load | केवल ब्राउज़र के लोड इवेंट की प्रतीक्षा करता है |
domcontentloaded | DOMContentLoaded इवेंट के साथ-साथ JavaScript रेंडरिंग के लिए अतिरिक्त समय (-dwt के माध्यम से कॉन्फ़िगर करने योग्य) की प्रतीक्षा करता है |
networkidle | नेटवर्क गतिविधि रुकने तक प्रतीक्षा करता है |
none | कोई प्रतीक्षा नहीं - नेविगेशन शुरू होने के तुरंत बाद लौटता है |
| katana -u https://tesla.com -headless -pls domcontentloaded |
| ऑपरेटिंग सिस्टम | क्रोमियम एक्जीक्यूटेबल स्थान | गूगल क्रोम एक्जीक्यूटेबल स्थान |
|---|
| विंडोज (64-बिट) | C:\Program Files (x86)\Google\Chromium\Application\chrome.exe | C:\Program Files (x86)\Google\Chrome\Application\chrome.exe |
| विंडोज (32-बिट) | C:\Program Files\Google\Chromium\Application\chrome.exe | C:\Program Files\Google\Chrome\Application\chrome.exe |
| macOS | /Applications/Chromium.app/Contents/MacOS/Chromium | /Applications/Google Chrome.app/Contents/MacOS/Google Chrome |
| लिनक्स | /usr/bin/chromium | /usr/bin/google-chrome |
| फ़ील्ड | विवरण | उदाहरण |
|---|
url | URL एंडपॉइंट | https://admin.projectdiscovery.io/admin/login?user=admin&password=admin |
qurl | क्वेरी पैरामीटर सहित URL | https://admin.projectdiscovery.io/admin/login.php?user=admin&password=admin |
qpath | क्वेरी पैरामीटर सहित पथ | /login?user=admin&password=admin |
path | URL पथ | https://admin.projectdiscovery.io/admin/login |
fqdn | पूरी तरह से योग्य डोमेन नाम | admin.projectdiscovery.io |
rdn | मूल डोमेन नाम | projectdiscovery.io |
rurl | मूल URL | https://admin.projectdiscovery.io |
ufile | फ़ाइल सहित URL | https://admin.projectdiscovery.io/login.js |
file | URL में फ़ाइल का नाम | login.php |
key | URL में पैरामीटर कुंजियाँ | user,password |
value | URL में पैरामीटर मान | admin,admin |
kv | URL में कुंजी=मान | user=admin&password=admin |
dir | URL निर्देशिका नाम | /admin/ |
udir | निर्देशिका सहित URL | https://admin.projectdiscovery.io/admin/ |