
현재 릴리스: v1.4 (20222.09.03)
웹 서버의 디렉터리와 파일을 무차별 대입(brute force)하도록 설계된 고급 명령줄 도구, 일명 웹 경로 스캐너
아이디어 by @maurosoria and @shelld3v
Developement-2022는 @nu11secur1ty에 의해 활발히 개발되고 있습니다
요구 사항: python 3.10.5 이상
다음 설치 옵션 중 하나를 선택하세요:
git clone https://github.com/nu11secur1ty/insect.git --depth 1 (권장)docker build -t "insect:latest" . (자세한 정보는 여기에서 확인할 수 있습니다)pip3 install dirsearchsudo apt-get install dirsearch (지원 중단됨)요약:
%EXT% 키워드를 -e 플래그의 확장자로만 대체합니다.%EXT%가 없는 워드리스트(예: SecLists)의 경우, -f | --force-extensions 스위치를 사용하여 워드리스트의 모든 단어와 /에 확장자를 추가해야 합니다.wordlist1.txt,wordlist2.txt.예시:
확장자로 **asp**와 **aspx**를 전달하면 다음 사전이 생성됩니다:```
index
index.asp
index.aspx
**-f**/**--force-extensions** 플래그와 함께 **php** 및 **html**을 확장자로 전달하면 다음 사전이 생성됩니다:```
admin
admin.php
admin.html
admin/
**jsp** 및 **jspa**를 **-O**/**--overwrite-extensions** 플래그와 함께 확장자로 전달하면 다음 사전이 생성됩니다:```
login.html
login.jsp
login.jspa
옵션 -------``` Usage: insect.py [-u|--url] target [-e|--extensions] extensions [options]
Options: --version show program's version number and exit -h, --help show this help message and exit
Mandatory:
-u URL, --url=URL Target URL(s), support multiple flags
-l PATH, --url-file=PATH
URL list file
--stdin Read URL(s) from STDIN
--cidr=CIDR Target CIDR
--raw=PATH Load raw HTTP request from file (use --scheme flag
to set the scheme)
-s SESSION_FILE, --session=SESSION_FILE
Session file
--config=PATH Full path to config file, see 'config.ini' for
example (Default: config.ini)
Dictionary Settings:
-w WORDLISTS, --wordlists=WORDLISTS
Customize wordlists (separated by commas)
-e EXTENSIONS, --extensions=EXTENSIONS
Extension list separated by commas (e.g. php,asp)
-f, --force-extensions
Add extensions to the end of every wordlist entry. By
default insect only replaces the %EXT% keyword with
extensions
-O, --overwrite-extensions
Overwrite other extensions in the wordlist with your
extensions (selected via -e)
--exclude-extensions=EXTENSIONS
Exclude extension list separated by commas (e.g.
asp,jsp)
--remove-extensions
Remove extensions in all paths (e.g. admin.php ->
admin)
--prefixes=PREFIXES
Add custom prefixes to all wordlist entries (separated
by commas)
--suffixes=SUFFIXES
Add custom suffixes to all wordlist entries, ignore
directories (separated by commas)
-U, --uppercase Uppercase wordlist
-L, --lowercase Lowercase wordlist
-C, --capital Capital wordlist
General Settings: -t THREADS, --threads=THREADS Number of threads -r, --recursive Brute-force recursively --deep-recursive Perform recursive scan on every directory depth (e.g. api/users -> api/) --force-recursive Do recursive brute-force for every found path, not only directories -R DEPTH, --max-recursion-depth=DEPTH Maximum recursion depth --recursion-status=CODES Valid status codes to perform recursive scan, support ranges (separated by commas) --subdirs=SUBDIRS Scan sub-directories of the given URL[s] (separated by commas) --exclude-subdirs=SUBDIRS Exclude the following subdirectories during recursive scan (separated by commas) -i CODES, --include-status=CODES Include status codes, separated by commas, support ranges (e.g. 200,300-399) -x CODES, --exclude-status=CODES Exclude status codes, separated by commas, support ranges (e.g. 301,500-599) --exclude-sizes=SIZES Exclude responses by sizes, separated by commas (e.g. 0B,4KB) --exclude-texts=TEXTS Exclude responses by texts, separated by commas (e.g. 'Not found', 'Error') --exclude-regex=REGEX Exclude responses by regex (e.g. '^Error$') --exclude-redirect=STRING Exclude responses if this regex (or text) matches redirect URL (e.g. '/index.html') --exclude-response=PATH Exclude responses similar to response of this page, path as input (e.g. 404.html) --skip-on-status=CODES Skip target whenever hit one of these status codes, separated by commas, support ranges --min-response-size=LENGTH Minimum response length --max-response-size=LENGTH Maximum response length --max-time=SECONDS Maximum runtime for the scan
Request Settings: -m METHOD, --http-method=METHOD HTTP method (default: GET) -d DATA, --data=DATA HTTP request data --data-file=PATH File contains HTTP request data -H HEADERS, --header=HEADERS HTTP request header, support multiple flags --header-file=PATH File contains HTTP request headers -F, --follow-redirects Follow HTTP redirects --random-agent Choose a random User-Agent for each request --auth=CREDENTIAL Authentication credential (e.g. user:password or bearer token) --auth-type=TYPE Authentication type (basic, digest, bearer, ntlm, jwt, oauth2) --cert-file=PATH File contains client-side certificate --key-file=PATH File contains client-side certificate private key (unencrypted) --user-agent=USERAGENT --cookie=COOKIE
Connection Settings: --timeout=TIMEOUT Connection timeout --delay=DELAY Delay between requests --proxy=PROXY Proxy URL, support HTTP and SOCKS proxies (e.g. localhost:8080, socks5://localhost:8088) --proxy-file=PATH File contains proxy servers --proxy-auth=CREDENTIAL Proxy authentication credential --replay-proxy=PROXY Proxy to replay with found paths --tor Use Tor network as proxy --scheme=SCHEME Scheme for raw request or if there is no scheme in the URL (Default: auto-detect) --max-rate=RATE Max requests per second --retries=RETRIES Number of retries for failed requests --ip=IP Server IP address --exit-on-error Exit whenever an error occurs
Advanced Settings: --crawl Crawl for new paths in responses
View Settings: --full-url Full URLs in the output (enabled automatically in quiet mode) --redirects-history Show redirects history --no-color No colored output -q, --quiet-mode Quiet mode
Output Settings: -o PATH, --output=PATH Output file --format=FORMAT Report format (Available: simple, plain, json, xml, md, csv, html, sqlite) --log=PATH Log file
구성
---------------
dirsearch 및 insect 플래그의 기본값은 구성 파일에서 편집할 수 있습니다. 기본값은 `config.ini`이지만 `--config` 플래그를 사용하여 다른 파일을 선택할 수 있습니다.```ini
# If you want to edit dirsearch or insect default configurations, you can
# edit values in this file. Everything after `#` is a comment
# and won't be applied
[general]
threads = 25
recursive = False
deep-recursive = False
force-recursive = False
recursion-status = 200-399,401,403
max-recursion-depth = 0
exclude-subdirs = %%ff/,.;/,..;/,;/,./,../,%%2e/,%%2e%%2e/
random-user-agents = False
max-time = 0
# subdirs = /,api/
# include-status = 200-299,401
# exclude-status = 400,500-999
# exclude-sizes = 0b,123gb
# exclude-texts = "Not found"
# exclude-regex = "^403$"
# exclude-redirect = "*/error.html"
# exclude-response = 404.html
# skip-on-status = 429,999
[dictionary]
default-extensions = php,aspx,jsp,html,js
force-extensions = False
overwrite-extensions = False
lowercase = False
uppercase = False
capitalization = False
# exclude-extensions = old,log
# prefixes = .,admin
# suffixes = ~,.bak
# wordlists = /path/to/wordlist1.txt,/path/to/wordlist2.txt
[request]
httpmethod = get
follow-redirects = False
# headers-file = /path/to/headers.txt
# user-agent = MyUserAgent
# cookie = SESSIONID=123
[connection]
timeout = 7.5
delay = 0
max-rate = 0
max-retries = 1
exit-on-error = False
## By disabling `scheme` variable, insect will automatically identify the URI scheme
# scheme = http
# proxy = localhost:8080
# proxy-file = /path/to/proxies.txt
# replay-proxy = localhost:8000
[advanced]
crawl = False
[view]
full-url = False
quiet-mode = False
color = True
show-redirects-history = False
[output]
## Support: plain, simple, json, xml, md, csv, html, sqlite
report-format = plain
autosave-report = True
# log-file = /path/to/insect.log
# report-output-folder = /path/to/reports

dirsearch와 insect를 사용하는 몇 가지 예제입니다. 가장 일반적인 인자들입니다. 모두 필요하다면 -h 인자를 사용하세요.
python3 insect.py -u https://target
I don't see any input content after "INPUT:" in your message. Please provide the Markdown chunk you'd like translated, and I'll translate it from English to Korean following your rules.```
python3 insect.py -e php,html,js -u https://target
I'm ready to translate the chunk. However, the input content appears to be empty—no text was provided after "INPUT:". Please provide the chunk content you'd like translated into Korean.``` python3 insect.py -e php,html,js -u https://target -w /path/to/wordlist
---
### 진행 일시 중지
dirsearch와 insect를 사용하면 CTRL+C로 스캔 진행을 일시 중지할 수 있습니다. 여기에서 진행 상황을 저장(나중에 계속 가능)하거나, 현재 대상을 건너뛰거나, 현재 하위 디렉터리를 건너뛸 수 있습니다.
<img src="https://assets.kitploit.com/production/public/readmes/42137/d4cf979db78841d0c0f16abb177e5084211820c23e8adaf587f0bb3faf0e25b4.png" alt="insect 일시 중지" width="475px">
----
### 재귀 (Recursion)
- 재귀적 무차별 대입(brute-force)은 발견된 디렉터리 이후를 계속해서 무차별 대입하는 것입니다. 예를 들어, insect가 `admin/`을 찾으면 `admin/*`을 무차별 대입합니다 (`*`는 무차별 대입이 수행되는 위치입니다). 이 기능을 활성화하려면 **-r** (또는 **--recursive**) 플래그를 사용하세요.```
python3 insect.py -e php,html,js -u https://target -r
- 더 많은 옵션이 2개 있습니다: **--force-recursive** 및 **--deep-recursive**
- **Force recursive**: 발견된 모든 경로를 재귀적으로 무차별 대입(brute force)하며, `/`로 끝나는 경로만이 아니라 모두 시도합니다.
- **Deep recursive**: 경로의 모든 깊이를 재귀적으로 무차별 대입합니다 (`a/b/c` => `a/`, `a/b/` 추가)
- 재귀적으로 무차별 대입하고 싶지 않은 하위 디렉터리가 있다면 `--exclude-subdirs`를 사용하세요.```
python3 insect.py -e php,html,js -u https://target -r --exclude-subdirs image/,media/,css/
스레드 수(-t | --threads)는 분리된 무차별 대입 프로세스의 수를 반영합니다. 따라서 스레드 수가 많을수록 dirsearch 또는 insect가 더 빠르게 실행됩니다. 기본적으로 스레드 수는 25이지만, 진행 속도를 높이고 싶다면 늘릴 수 있습니다.
그럼에도 불구하고 속도는 여전히 서버의 응답 시간에 크게 의존합니다. 그리고 경고로, 스레드 수를 너무 크게 설정하지 않는 것을 권장합니다. DoS(서비스 거부)를 유발할 수 있기 때문입니다.``` python3 insect.py -e php,htm,js,bak,zip,tgz,txt -u https://target -t 20
### 접두사 / 접미사
- **--prefixes**: 모든 항목에 사용자 정의 접두사를 추가합니다```
python3 insect.py -e php -u https://target --prefixes .,admin,_
단어 목록:``` tools
접두사로 생성됨:```
tools
.tools
admintools
_tools
Wordlist:```
index.php
internal
접미사로 생성됨:``` index.php internal index.php~ internal~
----
### 블랙리스트
`db/` 폴더 안에는 여러 "블랙리스트 파일"이 있습니다. 해당 파일에 있는 경로는 파일 이름에 언급된 것과 동일한 상태 코드를 가질 경우 스캔 결과에서 필터링됩니다.
예시: `admin.php`를 `db/403_blacklist.txt`에 추가하면, 스캔 시 `admin.php`가 403을 반환할 때마다 결과에서 필터링됩니다.
----
### 필터
허용 및 비허용 응답 상태 코드를 선택하려면 **-i | --include-status** 및 **-x | --exclude-status**를 사용하세요.
더 고급 필터: **--exclude-sizes**, **--exclude-texts**, **--exclude-regexps**, **--exclude-redirects** 및 **--exclude-response**```
python3 insect.py -e php,html,js -u https://target --exclude-sizes 1B,243KB
입력 내용이 비어 있습니다. 번역할 원문(chunk 45)이 제공되지 않았으므로 번역을 진행할 수 없습니다. 원문을 다시 제공해 주시기 바랍니다.``` python3 insect.py -e php,html,js -u https://target --exclude-texts "403 Forbidden"
The input content is empty — no Markdown text was provided to translate. Please supply the actual chunk content so it can be translated.```
python3 insect.py -e php,html,js -u https://target --exclude-regexps "^Error$"
번역할 Markdown 내용을 입력해 주세요.``` python3 insect.py -e php,html,js -u https://target --exclude-redirects "https://(.).okta.com/"
I apologize, but it appears the chunk content is missing from your message. The input ends at "INPUT:" with no actual Markdown content to translate.
Please provide the chunk text and I'll translate it immediately.```
python3 insect.py -e php,html,js -u https://target --exclude-response /error.html
dirsearch 또는 insect를 사용하면 파일에서 원시 요청을 가져올 수 있습니다. 내용은 대략 다음과 같습니다:```http GET /admin HTTP/1.1 Host: admin.example.com Cache-Control: max-age=0 Accept: /
dirsearch나 insect가 URI 스킴을 알 수 있는 방법이 없으므로, `--scheme` 플래그를 사용하여 설정해야 합니다. 기본적으로 dirsearch와 insect는 스킴을 자동으로 감지합니다.
----
### 워드리스트 형식
지원되는 워드리스트 형식: 대문자, 소문자, 첫 글자 대문자
#### 소문자:```
admin
index.html
ADMIN INDEX.HTML
#### 수도:```
Admin
Index.html
-X | --exclude-extensions와 확장자 목록을 사용하면 워드리스트에서 해당 확장자를 포함하는 모든 경로가 제거됩니다.
python3 insect.py -u https://target -X jsp
워드리스트:``` admin.php test.jsp
이후:```
admin.php
### Proxies
dirsearch와 insect는 SOCKS 및 HTTP 프록시를 지원하며, 두 가지 옵션이 있습니다: 프록시 서버 또는 프록시 서버 목록입니다.```
python3 insect.py -e php,html,js -u https://target --proxy 127.0.0.1:8080
certwatcher를 --config 인수 없이 처음 실행하면 $HOME/.config/certwatcher/config.yaml에 기본 구성을 기록합니다.
또는 아래에서 기본 구성 설정을 볼 수 있습니다:
# CertWatcher Config
domains:
- example.com
file_extensions:
- crt
- pem
log_file: certwatcher.log
slack_webhook: none
discord_webhook: none
telegram_bot_token: none
telegram_chat_id: none
interval: 60
domains 목록을 빈 목록으로 설정하여 certwatcher를 인증서 가져오기 없이 실행할 수 있습니다. 이는 알림을 위해 웹훅 서비스만 실행하려는 경우에 유용합니다.```
python3 insect.py -e php,html,js -u https://target --proxy socks5://10.10.0.1:8080
The input chunk is empty—no source text was provided to translate. Please resend chunk 71 with its content included.```
python3 insect.py -e php,html,js -u https://target --proxylist proxyservers.txt
지원되는 보고서 형식: simple, plain, json, xml, md, csv, html, sqlite``` python3 insect.py -e php -l URLs.txt --format plain -o report.txt
I received no source text in the `INPUT:` section of your message, so there is nothing to translate.
If this was an error (for example, the Markdown chunk was accidentally omitted), please re-send the message including the full content for chunk 75 of 91, and I will translate it from English to Korean right away.```
python3 insect.py -e php -u https://target --format html -o target.json
cat urls.txt | python3 insect.py --stdin
Please provide the Markdown content to translate.```
python3 insect.py -u https://target --max-time 360
I'm unable to translate this chunk because no content was provided. The input after "INPUT:" is empty. Please provide the actual Markdown text for chunk 81 of 91.``` python3 insect.py -u https://target --auth admin:pass --auth-type basic
Please provide the Markdown content to translate.```
python3 insect.py -u https://target --header-list rate-limit-bypasses.txt
더 발견할 것이 많습니다. 직접 시도해 보세요!
Docker 설치```sh curl -fsSL https://get.docker.com | bash
> docker를 사용하려면 슈퍼유저 권한이 필요합니다
### insect에서 dirsearch 이미지 빌드
이미지를 생성하려면```sh
docker build -t "dirsearch:v0.4.2" .
docker build -t "insect:latest" .
dirsearch는 이미지의 이름이고 v0.4.2는 버전입니다
insect는 이미지의 이름이고 latest는 버전입니다
사용을 위해```sh docker run -it --rm "insect:latest" -u target -e php,html,js,zip
참고 자료
---------------
- [Dirsearch 종합 가이드](https://www.hackingarticles.in/comprehensive-guide-on-dirsearch/) - Shubham Sharma
- [Dirsearch 종합 가이드 2부](https://www.hackingarticles.in/comprehensive-guide-on-dirsearch-part-2/) - Shubham Sharma
- [Dirsearch로 숨겨진 웹 디렉터리를 찾는 방법](https://www.geeksforgeeks.org/how-to-find-hidden-web-directories-with-dirsearch/) - GeeksforGeeks
- [DIRSEARCH 사용에 관한 완전한 가이드](https://esgeeks.com/guia-completa-uso-dirsearch/?feed_id=5703&_unique_id=6076249cc271f) - ESGEEKS
- [Dirsearch로 웹 디렉터리를 탐지하는 방법](https://www.ehacking.net/2020/01/how-to-find-hidden-web-directories-using-dirsearch.html) - EHacking
- [dirsearch 사용법](https://vk9-sec.com/dirsearch-how-to/) - VK9 Security
- [Dirsearch로 숨겨진 웹 디렉터리 찾기](https://null-byte.wonderhowto.com/how-to/find-hidden-web-directories-with-dirsearch-0201615/) - Wonder How To
- [dirsearch를 사용하여 웹 서버의 디렉터리와 파일 무차별 대입](https://upadhyayraj.medium.com/brute-force-directories-and-files-in-webservers-using-dirsearch-613e4a7fa8d5) - Raj Upadhyay
- [Yahoo 대상 라이브 버그 바운티 정찰 세션 (Amass, crts.sh, dirsearch) w/ @TheDawgyg](https://www.youtube.com/watch?v=u4dUnJ1U0T4) - Nahamsec
- [Dirsearch로 숨겨진 웹 디렉터리 찾기](https://medium.com/@irfaanshakeel/dirsearch-to-find-hidden-web-directories-d0357fbe47b0) - Irfan Shakeel
- [25,000명의 직원 세부 정보에 접근하기](https://medium.com/@ehsahil/getting-access-to-25k-employees-details-c085d18b73f0) - Sahil Ahamad
- [디렉터리 무차별 대입을 위한 최고의 도구](https://secnhack.in/multiple-ways-to-find-hidden-directory-on-web-server/) - Shubham Goyal
- [웹 서버에서 숨겨진 파일 및 디렉터리 발견 - dirsearch 전체 튜토리얼](https://www.youtube.com/watch?v=jVxs5at0gxg) - CYBER BYTES
- [보호 수준이 낮은 디렉터리를 insect 예제로 찾기](https://www.nu11secur1ty.com/2022/09/wordpress-all-in-one-wp-migration-764.html) - nu11secur1ty
팁
---------------
- 서버에 요청 제한이 있나요? 안타깝지만 `--proxy-list`로 프록시를 무작위화하여 우회해도 됩니다.
- 설정 파일이나 백업 파일을 찾고 싶으신가요? `--suffixes ~`와 `--prefixes .`를 사용해 보세요.
- 폴더/디렉터리만 찾고 싶으신가요? `--remove-extensions`와 `--suffixes /`를 조합해 보세요!
- `--cidr`, `-F`, `-q`의 조합은 CIDR로 무차별 대입할 때 대부분의 노이즈와 오탐(false negative)을 줄여 줍니다.
- URL 목록을 스캔하는데 429 플러드(flood)를 보고 싶지 않으신가요? `--skip-on-status 429`를 사용하면 대상이 429를 반환할 때마다 건너뜁니다.
- 서버에 대용량 파일이 있어 스캔 속도가 느려지나요? `GET` 대신 `HEAD` HTTP 메서드를 사용하는 것이 좋을 *수도* 있습니다.
- CIDR 무차별 대입이 느린가요? 아마도 요청 타임아웃과 재시도 횟수를 줄이는 것을 잊으셨을 겁니다. `--timeout 3 --retries 1`을 권장합니다.
원본 소스에 기여하기
---------------
우리는 이 도구를 개선하기 위해 전 세계 많은 사람들로부터 많은 도움을 받아 왔습니다. 지금까지 도움을 주신 모든 분들께 정말 감사드립니다!
기여자들이 누구인지 확인하려면 [CONTRIBUTORS.md](https://github.com/maurosoria/dirsearch/blob/master/CONTRIBUTORS.md)를 참조하세요.
#### 풀 리퀘스트(Pull request)와 기능 요청을 환영합니다
라이선스
---------------
Copyright (C) Mauro Soria ([email protected])
2022년 개발 (C) nu11secur1ty (https://nu11secur1ty.com/)
라이선스: GNU General Public License, version 2