
उच्च गति वाला API और वेब सामग्री खोज उपकरण जो संकलित Swagger डेटासेट का उपयोग करके रूट्स को ब्रूटफोर्स करता है, जो डेप्थ स्कैनिंग, कस्टम वर्डलिस्ट और समवर्ती होस्ट स्कैनिंग का समर्थन करता है।

लंबे समय से, सामग्री खोज (content discovery) फ़ाइलों और फ़ोल्डरों को खोजने पर केंद्रित रही है। हालाँकि यह दृष्टिकोण पुराने वेब सर्वरों के लिए प्रभावी है जो स्थिर फ़ाइलें होस्ट करते हैं या आंशिक पथ पर 3xx का उत्तर देते हैं, लेकिन यह आधुनिक वेब अनुप्रयोगों, विशेष रूप से API के लिए प्रभावी नहीं है।
समय के साथ, हमने सामग्री खोज उपकरणों को तेज़ बनाने में बहुत समय निवेश किया है ताकि बड़ी वर्डलिस्ट का उपयोग किया जा सके, हालाँकि सामग्री खोज की कला में कोई नवाचार नहीं हुआ है।
Kiterunner एक ऐसा उपकरण है जो न केवल बिजली की तेज़ गति से पारंपरिक सामग्री खोज करने में सक्षम है, बल्कि आधुनिक अनुप्रयोगों में रूट्स/एंडपॉइंट्स की ब्रूटफोर्सिंग भी कर सकता है।
आधुनिक एप्लिकेशन फ्रेमवर्क जैसे Flask, Rails, Express, Django और अन्य स्पष्ट रूप से रूट्स को परिभाषित करने के प्रतिमान का पालन करते हैं, जो विशिष्ट HTTP विधियों, हेडर, पैरामीटर और मानों की अपेक्षा करते हैं।
पारंपरिक सामग्री खोज उपकरणों का उपयोग करने पर, ऐसे रूट्स अक्सर छूट जाते हैं और आसानी से खोजे नहीं जा सकते।
स्वैगर विनिर्देशों के एक डेटासेट को एकत्रित करके और इसे हमारे अपने स्कीमा में संक्षिप्त करके, Kiterunner इस डेटासेट का उपयोग API एंडपॉइंट्स की ब्रूटफोर्सिंग करने के लिए कर सकता है, प्रत्येक अनुरोध के लिए सही HTTP विधि, हेडर, पथ, पैरामीटर और मान भेजता है।
स्वैगर फ़ाइलें कई डेटा स्रोतों से एकत्रित की गईं, जिनमें 40 से अधिक सबसे सामान्य स्वैगर पथों के लिए एक इंटरनेट-व्यापी स्कैन शामिल था। अन्य डेटा स्रोतों में BigQuery के माध्यम से GitHub और APIs.guru शामिल हैं।
आप https://github.com/assetnote/kiterunner/releases से पूर्व-निर्मित प्रति डाउनलोड कर सकते हैं।
make build
ln -s $(pwd)/dist/kr /usr/local/bin/kr
kr kb compile routes.json routes.kite
kr scan hosts.txt -w routes.kite -x 20 -j 100 --ignore-length=1053
JSON डेटासेट नीचे दिए गए लिंक पर उपलब्ध हैं:
- [routes-large.json](https://wordlists-cdn.assetnote.io/rawdata/kiterunner/routes-large.json.tar.gz) (118MB संपीड़ित, 2.6GB डीकंप्रेस्ड)
- [routes-small.json](https://wordlists-cdn.assetnote.io/rawdata/kiterunner/routes-small.json.tar.gz) (14MB संपीड़ित, 228MB डीकंप्रेस्ड)
वैकल्पिक रूप से, नीचे दिए गए लिंक से संकलित `.kite` फ़ाइलें डाउनलोड करना संभव है:
- [routes-large.kite](https://wordlists-cdn.assetnote.io/data/kiterunner/routes-large.kite.tar.gz) (40MB संपीड़ित, 183M डीकंप्रेस्ड)
- [routes-small.kite](https://wordlists-cdn.assetnote.io/data/kiterunner/routes-small.kite.tar.gz) (2MB संपीड़ित, 35MB डीकंप्रेस्ड)
## AUR
आर्क-आधारित वितरण का उपयोग करने वाले उपयोगकर्ता [AUR](https://aur.archlinux.org/packages/kiterunner-bin/) से पूर्व-निर्मित बाइनरी डाउनलोड कर सकते हैं।
kiterunner को स्थापित करने के लिए आप `yay` जैसे "Aur Helper" का उपयोग कर सकते हैं।```
yay -S kiterunner-bin
kr [scan|brute] [flags]
- `<input>` एक फ़ाइल, डोमेन या URI हो सकता है। हम आपके लिए इसका पता लगा लेंगे। देखें [Input/Host Formatting](#inputhost-formatting) अधिक जानकारी के लिए।```
# Just have a list of hosts and no wordlist
kr scan hosts.txt -A=apiroutes-210328:20000 -x 5 -j 100 --fail-status-codes 400,401,404,403,501,502,426,411
# You have your own wordlist but you want assetnote wordlists too
kr scan target.com -w routes.kite -A=apiroutes-210328:20000 -x 20 -j 1 --fail-status-codes 400,401,404,403,501,502,426,411
# Bruteforce like normal but with the first 20000 words
kr brute https://target.com/subapp/ -A=aspx-210328:20000 -x 20 -j 1
# Use a dirsearch style wordlist with %EXT%
kr brute https://target.com/subapp/ -w dirsearch.txt -x 20 -j 1 -exml,asp,aspx,ashx -D
Usage: kite scan [flags]
Flags: -A, --assetnote-wordlist strings use the wordlists from wordlist.assetnote.io. specify the type/name to use, e.g. apiroutes-210228. You can specify an additional maxlength to use only the first N values in the wordlist, e.g. apiroutes-210228;20000 will only use the first 20000 lines in that wordlist --blacklist-domain strings domains that are blacklisted for redirects. We will not follow redirects to these domains --delay duration delay to place inbetween requests to a single host --disable-precheck whether to skip host discovery --fail-status-codes ints which status codes blacklist as fail. if this is set, this will override success-status-codes --filter-api strings only scan apis matching this ksuid --force-method string whether to ignore the methods specified in the ogl file and force this method -H, --header strings headers to add to requests (default [x-forwarded-for: 127.0.0.1]) -h, --help help for scan --ignore-length strings a range of content length bytes to ignore. you can have multiple. e.g. 100-105 or 1234 or 123,34-53. This is inclusive on both ends --kitebuilder-full-scan perform a full scan without first performing a phase scan. -w, --kitebuilder-list strings ogl wordlist to use for scanning -x, --max-connection-per-host int max connections to a single host (default 3) -j, --max-parallel-hosts int max number of concurrent hosts to scan at once (default 50) --max-redirects int maximum number of redirects to follow (default 3) -d, --preflight-depth int when performing preflight checks, what directory depth do we attempt to check. 0 means that only the docroot is checked (default 1) --profile-name string name for profile output file --progress a progress bar while scanning. by default enabled only on Stderr (default true) --quarantine-threshold int if the host return N consecutive hits, we quarantine the host as wildcard. Set to 0 to disable (default 10) --success-status-codes ints which status codes whitelist as success. this is the default mode -t, --timeout duration timeout to use on all requests (default 3s) --user-agent string user agent to use for requests (default "Chrome. Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36") --wildcard-detection can be set to false to disable wildcard redirect detection (default true)
Global Flags: --config string config file (default is $HOME/.kiterunner.yaml) -o, --output string output format. can be json,text,pretty (default "pretty") -q, --quiet quiet mode. will mute unecessarry pretty text -v, --verbose string level of logging verbosity. can be error,info,debug,trace (default "info")
bruteforce flags (ऊपर के सभी फ़्लैग +)```
-D, --dirsearch-compat this will replace %EXT% with the extensions provided. backwards compat with dirsearch because shubs loves him some dirsearch
-e, --extensions strings extensions to append while scanning
-w, --wordlist strings normal wordlist to use for scanning
जब kiterunner को इनपुट दिया जाता है, तो वह इनपुट को निम्नलिखित क्रम में हल करने का प्रयास करेगा:
यदि आप एक "डोमेन" प्रदान करते हैं, लेकिन वह एक फ़ाइल के रूप में मौजूद है, जैसे google.com लेकिन वर्तमान निर्देशिका में google.com एक txt फ़ाइल भी है, तो हम google.com टेक्स्ट फ़ाइल को लोड करेंगे, क्योंकि हमने इसे पहले पाया।
डोमेन पार्सिंग
यह पसंद किया जाता है कि आप इनपुट के रूप में एक पूर्ण URI प्रदान करें, हालांकि आप अपूर्ण URI प्रदान कर सकते हैं और हम यह अनुमान लगाने का प्रयास करेंगे कि आपका क्या मतलब है। आपके द्वारा प्रदान किए जा सकने वाले डोमेन की एक उदाहरण सूची नीचे दी गई है:
google.com
foo.bar/admin
admin.foo.bar``` one.com two.com:80 three.com:443 four.com:9447 https://five.com:9090 http://six.com:80/api
डोमेन की उपरोक्त सूची लक्ष्यों की बाद की सूची में विस्तारित हो जाएगी```
(two targets are created for one.com, since neither port nor protocol was specified)
http://one.com (port 80 implied)
https://one.com (port 443 implied)
http://two.com (port 80 implied)
https://three.com (port 443 implied)
http://four.com:9447 (non-tls port guessed)
https://five.com:9090
http://six.com/api (port 80 implied; basepath API appended)
हम जो नियम लागू करते हैं वे हैं:
जब आपके पास एक एकल लक्ष्य हो```bash
kr scan https://target.com:8443/ -w routes.kite -A=apiroutes-210228:20000 -x 10 --ignore-length=34
kr scan target.com -w routes.kite -A=apiroutes-210228:20000 -x 10 --ignore-length=34
kr scan targets.txt -w routes.kite -A=apiroutes-210228:20000 -x 10 --ignore-length=34
## सादा ब्रूटफोर्सिंग```bash
kr brute https://target.com -A=raft-large-words -A=apiroutes-210228:20000 -x 10 -d=0 --ignore-length=34 -ejson,txt
जब आपके पास एक पुरानी शैली की वर्डलिस्ट हो जिसमें अभी भी %EXT% मौजूद हो, तो आप -D का उपयोग कर सकते हैं। यह केवल उस स्थान पर एक्सटेंशन को प्रतिस्थापित करेगा जहाँ पथ में %EXT% मौजूद है।```bash
kr brute https://target.com -w dirsearch.txt -x 10 -d=0 --ignore-length=34 -ejson,txt -D
# तकनीकी विशेषताएँ
## गहराई स्कैनिंग
काइटरनर की एक प्रमुख विशेषता गहराई-आधारित स्कैनिंग है। यह वर्चुअल एप्लिकेशन पथ-आधारित रूटिंग को देखते हुए वाइल्डकार्ड का पता लगाने में सहायता करने का प्रयास करता है। गहराई यह परिभाषित करती है कि आधार जांचें कितनी डायरेक्टरी गहराई तक की जाती हैं, जैसे```bash
~/kiterunner $ cat wordlist.txt
/api/v1/user/create
/api/v1/user/delete
/api/v2/user/
/api/v2/admin/
/secrets/v1/
/secrets/v2/
/ पर वाइल्डकार्ड पहचान के लिए बेसलाइन जाँचें की जाएंगी/api और /secrets पर बेसलाइन जाँचें की जाएंगी; और ये जाँचें क्रमशः /api और /secrets के विरुद्ध उपयोग की जाएंगी/api/v1, /api/v2, /secrets/v1 और /secrets/v2 सभी पर बेसलाइन जाँचें की जाएंगी।डिफ़ॉल्ट रूप से, kr scan की गहराई 1 है, क्योंकि आंतरिक उपयोग से हमने अक्सर देखा है कि यह सबसे सामान्य गहराई है जहाँ वर्चुअल रूटिंग होती है। kr brute की डिफ़ॉल्ट गहराई 0 है, क्योंकि आप सामान्यतः स्थिर वर्डलिस्ट के साथ यह जाँच नहीं कराना चाहते।
स्वाभाविक रूप से, गहराई बढ़ाने से आपकी स्कैन की सटीकता बढ़ेगी, हालांकि इससे लक्ष्य पर अनुरोधों की संख्या भी बढ़ जाती है। (# of baseline checks * # of depth baseline directories). इसलिए, हम 1 से ऊपर जाने की अनुशंसा नहीं करते, और दुर्लभ मामलों में गहराई 2 तक जाने की सलाह देते हैं।
हम assetnote.io से वर्डलिस्ट के अंतर्निर्मित डाउनलोडिंग और कैशिंग प्रदान करते हैं। आप इनका उपयोग -A फ्लैग के साथ कर सकते हैं, जो अल्पविराम से अलग किए गए उपनामों या पूर्ण नामों की सूची प्राप्त करता है।
आप kr wordlist list के साथ सभी एसेटनोट वर्डलिस्ट की पूरी सूची प्राप्त कर सकते हैं।
उपयोग किए जाने पर वर्डलिस्ट ~/.cache/kiterunner/wordlists में कैश की जाती हैं। उपयोग किए जाने पर, इन्हें .txt -> .kite में संकलित किया जाता है।```
+-----------------------------------+-------------------------------------------------------+----------------+---------+----------+--------+
| ALIAS | FILENAME | SOURCE | COUNT | FILESIZE | CACHED |
+-----------------------------------+-------------------------------------------------------+----------------+---------+----------+--------+
| 2m-subdomains | 2m-subdomains.txt | manual.json | 2167059 | 28.0mb | false |
| asp_lowercase | asp_lowercase.txt | manual.json | 24074 | 1.1mb | false |
| aspx_lowercase | aspx_lowercase.txt | manual.json | 80293 | 4.4mb | false |
| bak | bak.txt | manual.json | 31725 | 634.8kb | false |
| best-dns-wordlist | best-dns-wordlist.txt | manual.json | 9996122 | 139.0mb | false |
| cfm | cfm.txt | manual.json | 12100 | 260.3kb | true |
| do | do.txt | manual.json | 173152 | 4.8mb | false |
| dot_filenames | dot_filenames.txt | manual.json | 3191712 | 71.3mb | false |
| html | html.txt | manual.json | 4227526 | 107.7mb | false |
| apiroutes-201120 | httparchive_apiroutes_2020_11_20.txt | automated.json | 953011 | 45.3mb | false |
| apiroutes-210128 | httparchive_apiroutes_2021_01_28.txt | automated.json | 225456 | 6.6mb | false |
| apiroutes-210228 | httparchive_apiroutes_2021_02_28.txt | automated.json | 223544 | 6.5mb | true |
| apiroutes-210328 | httparchive_apiroutes_2021_03_28.txt | automated.json | 215114 | 6.3mb | false |
| aspx-201118 | httparchive_aspx_asp_cfm_svc_ashx_asmx_2020_11_18.txt | automated.json | 63200 | 1.7mb | false |
| aspx-210128 | httparchive_aspx_asp_cfm_svc_ashx_asmx_2021_01_28.txt | automated.json | 46286 | 928.7kb | false |
| aspx-210228 | httparchive_aspx_asp_cfm_svc_ashx_asmx_2021_02_28.txt | automated.json | 43958 | 883.3kb | false |
| aspx-210328 | httparchive_aspx_asp_cfm_svc_ashx_asmx_2021_03_28.txt | automated.json | 45928 | 926.8kb | false |
| cgi-201118 | httparchive_cgi_pl_2020_11_18.txt | automated.json | 2637 | 44.0kb | false |
जब assetnote द्वारा प्रदान की गई वर्डलिस्ट का उपयोग कर रहे हों, तो हो सकता है कि आप पूरी वर्डलिस्ट का उपयोग नहीं करना चाहें, इसलिए आप head syntax का उपयोग करके किसी दी गई वर्डलिस्ट की पहली N पंक्तियों का उपयोग कर सकते हैं। वर्डलिस्ट निर्दिष्ट करते समय प्रारूप <wordlist_name>:<N lines> है।
Usage```
kr scan targets.txt -A=apiroutes-210228:20000 -x 10 --ignore-length=34
kr brute targets.txt -A=aspx-210228:10 -x 10 --ignore-length=34 -easp,aspx
## Concurrency Settings/तेज़ चलाना
Kiterunner को कई होस्टों पर तेज़ चलाने के लिए बनाया गया है। लेकिन, सिर्फ इसलिए कि आप kiterunner को 20000 goroutines पर चला सकते हैं, इसका मतलब यह नहीं है कि यह अच्छा विचार है। उच्च थ्रेड काउंट पर अड़चनें और प्रदर्शन में गिरावट आएगी क्योंकि नेटवर्क IO और कर्नेल कॉन्टेक्स्ट स्विचिंग पर प्रतीक्षा कर रहे goroutines को शेड्यूल करने में अधिक समय लगता है।
Kiterunner के लिए दो मुख्य concurrency सेटिंग्स हैं:
- `-x, --max-connection-per-host` - एक होस्ट पर हम अधिकतम कितने खुले कनेक्शन रख सकते हैं। प्रत्येक के लिए 1 goroutine नियंत्रित करता है। किसी होस्ट को DOS करने से बचने के लिए, हम इसे 5-10 के निचले स्तर पर रखने की सलाह देते हैं। टार्गेट की विलंबता के आधार पर, यह औसतन प्रति कनेक्शन प्रति सेकंड 1-5 अनुरोध (200ms - 1000ms/req) एक होस्ट को देगा।
- `-j, --max-parallel-hosts` - किसी भी समय स्कैन करने के लिए होस्टों की अधिकतम संख्या। प्रत्येक के लिए 1 goroutine supervisor नियंत्रित करता है
आप जिस हार्डवेयर से स्कैन कर रहे हैं, उसके आधार पर, आप जितने goroutines इष्टतम रूप से चला सकते हैं, उनकी "अधिकतम" संख्या भिन्न होगी। AWS t3.medium पर, हमने 2500 goroutines से अधिक जाने पर प्रदर्शन में गिरावट देखी। यानी, 500 होस्ट x 5 conn प्रति होस्ट (2500) शीर्ष प्रदर्शन देगा।
हम **अनुशंसा नहीं करते** कि आप kiterunner को अपने **macbook** से चलाएँ। macOS पर उच्च IO काउंट और Epoll syscalls के लिए खराब कर्नेल ऑप्टिमाइज़ेशन के कारण, हमने समान रूप से कॉन्फ़िगर किए गए linux इंस्टेंस पर kiterunner चलाने की तुलना में काफी खराब (0.3-0.5x) प्रदर्शन देखा।
एकल टार्गेट या बड़े अटैक सरफेस को स्कैन करते समय प्रदर्शन को अधिकतम करने के लिए, हम निम्नलिखित सुझाव देते हैं:
- उसी भौगोलिक क्षेत्र/डेटासेंटर में एक EC2 इंस्टेंस चालू करें जहाँ आप जिन टार्गेट(s) को स्कैन कर रहे हैं
- अपने टार्गेट सेट पर विभिन्न `-x` और `-j` विकल्पों के साथ कुछ प्रारंभिक बेंचमार्क करें। हम लगभग `-x 5 -j 100` के एक विशिष्ट प्रारंभिक बिंदु से शुरू करने और अपने CPU उपयोग/नेटवर्क प्रदर्शन की अनुमति के अनुसार `-j` को ऊपर ले जाने की सलाह देते हैं।
## फ़ाइल फ़ॉर्मेट के बीच रूपांतरण
Kiterunner आपको स्कीमा JSON, एक kite फ़ाइल और एक मानक txt वर्डलिस्ट के बीच रूपांतरण करने की भी अनुमति देगा।
**उपयोग**
फ़ॉर्मेट `<input>` और `<output>` फ़ील्ड द्वारा प्रदान किए गए फ़ाइल प्रकार एक्सटेंशन द्वारा तय किया जाता है। हम `txt`, `json` और `kite` का समर्थन करते हैं।```bash
kr kb convert wordlist.txt wordlist.kite
kr kb convert wordlist.kite wordlist.json
kr kb convert wordlist.kite wordlist.txt
❯ go run ./cmd/kiterunner kb convert -qh
convert an input file format into the specified output file format
this will determine the conversion based on the extensions of the input and the output
we support the following filetypes: txt, json, kite
You can convert any of the following into the corresponding types
-d Debug mode will attempt to convert the schema with error handling
-v=debug Debug verbosity will print out the errors for the schema
Usage:
kite kb convert <input> <output> [flags]
Flags:
-d, --debug debug the parsing
-h, --help help for convert
Global Flags:
--config string config file (default is $HOME/.kiterunner.yaml)
-o, --output string output format. can be json,text,pretty (default "pretty")
-q, --quiet quiet mode. will mute unecessarry pretty text
-v, --verbose string level of logging verbosity. can be error,info,debug,trace (default "info")``bigquery
जब आप kiterunner से बहुत सारा आउटपुट प्राप्त करते हैं, तो यह समझना मुश्किल हो सकता है कि कोई अनुरोध किसी विशिष्ट प्रतिक्रिया कोड/लंबाई क्यों उत्पन्न कर रहा है। Kiterunner शब्दसूचियों (wordlists) से उपयोग किए गए सभी हेडर और बॉडी पैरामीटर सहित अनुरोध को पुनर्निर्माण करने की एक विधि प्रदान करता है।
kb replay कमांड में कॉपी-पेस्ट करके एक अनुरोध को पुनः चला सकते हैं।--proxy निर्दिष्ट कर सकते हैं, ताकि आप चाहें तो तृतीय-पक्ष टूल का उपयोग करके अनुरोध को संशोधित/दोहरा/इंटरसेप्ट कर सकें।11:25AM INF Outbound request POST /dedalo/lib/dedalo/publication/server_api/v1/json/thesaurus_parents?ar_fields=48637466&code=66132381&db_name=08791392&lang=lg-eng&recursive=false&term_id=72336471 HTTP/1.1 Host: target.com User-Agent: Go-http-client/1.1 Content-Length: 0 Content-Type: any Accept-Encoding: gzip
11:25AM INF Response After Redirects HTTP/1.1 403 Forbidden Connection: close Content-Length: 45 Content-Type: application/json Date: Wed, 07 Apr 2021 01:25:28 GMT X-Amzn-Requestid: 7e6b2ea1-c662-4671-9eaa-e8cd31b463f2
User is not authorized to perform this action
# तकनीकी कार्यान्वयन
## मध्यवर्ती डेटा प्रकार (PRoutes)
हम kiterunner में वर्डलिस्ट और kitebuilder json स्कीमा के मध्यवर्ती प्रतिनिधित्व का उपयोग करते हैं। इसका उद्देश्य हमें वर्डलिस्ट में फ़ील्ड को गतिशील रूप से उत्पन्न करने और किसी दिए गए स्पेसिफिकेशन से अनुरोध निकायों/हेडर और क्वेरी पैरामीटर का पुनर्निर्माण करने की अनुमति देना है।
PRoute प्रकार हेडर, बॉडी, क्वेरी और कुकी पैरामीटर से बना होता है जो `pkg/proute.Crumb` में एन्कोडेड होते हैं। Crumb प्रकार एक इंटरफ़ेस है जो UUIDs, Floats, Ints, Random Strings आदि जैसे प्रकारों पर लागू किया जाता है।
txt, json और kite फ़ाइलों में और उनसे रूपांतरण करते समय, सभी रूपांतरण पहले `proute.API` मध्यवर्ती प्रकार में किए जाते हैं। फिर संबंधित एन्कोडिंग लिखी जाती है
## Kite फ़ाइल प्रारूप
हम kitebuilder से json स्कीमा को संग्रहीत करने के लिए एक अति गोपनीय kite फ़ाइल प्रारूप का उपयोग करते हैं। ये फ़ाइल में लिखे गए केवल protobuf एन्कोडेड `pkg/proute.APIS` होते हैं। संकलन का उपयोग हमें पहले से पार्स की गई वर्डलिस्ट को तेज़ी से डिसीरियलाइज़ करने की अनुमति देने के लिए किया जाता है। यह फ़ाइल प्रारूप स्थिर नहीं है, और केवल kiterunner के अंतर्निहित रूपांतरण उपकरणों का उपयोग करके ही इसके साथ इंटरैक्ट किया जाना चाहिए।
जब kite फ़ाइल प्रारूप का एक नया संस्करण जारी किया जाता है, तो आपको अपनी kite फ़ाइलों को पुनः संकलित करने की आवश्यकता हो सकती है