
Versión actual: v1.4 (20222.09.03)
Una herramienta avanzada de línea de comandos diseñada para realizar fuerza bruta en directorios y archivos de servidores web, también conocida como escáner de rutas web.
Idea por @maurosoria y @shelld3v
Developement-2022 está siendo desarrollado activamente por @nu11secur1ty
Requisito: python 3.10.5 o superior
Elige una de estas opciones de instalación:
git clone https://github.com/nu11secur1ty/insect.git --depth 1 (RECOMENDADO)docker build -t "insect:latest" . (más información se puede encontrar aquí)pip3 install dirsearchsudo apt-get install dirsearch (obsoleto)Resumen:
%EXT% con las extensiones de la opción -e.%EXT% (como SecLists), se requiere la opción -f | --force-extensions para añadir extensiones a cada palabra de la lista, así como la /.wordlist1.txt,wordlist2.txt.Ejemplos:
Extensiones normales:``` index.%EXT%
Pasar **asp** y **aspx** como extensiones generará el siguiente diccionario:```
index
index.asp
index.aspx
Al pasar **php** y **html** como extensiones con la bandera **-f**/**--force-extensions** se generará el siguiente diccionario:```
admin
admin.php
admin.html
admin/
Pasar **jsp** y **jspa** como extensiones con la bandera **-O**/**--overwrite-extensions** generará el siguiente diccionario:```
login.html
login.jsp
login.jspa
Opciones -------``` 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
Configuración
---------------
Los valores por defecto de los flags de dirsearch e insect se pueden editar en el archivo de configuración, que por defecto es `config.ini`, pero puedes seleccionar otro archivo con el flag `--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

Algunos ejemplos de cómo usar dirsearch e insect: esos son los argumentos más comunes. Si necesitas todos, solo usa el argumento -h.
python3 insect.py -u https://target
[No content provided in the INPUT section. Please paste the Markdown chunk you wish to have translated.]```
python3 insect.py -e php,html,js -u https://target
I'm ready to translate the content, but I notice that the input provided is empty. There is no actual text content in the INPUT: section to translate.
Please provide the Markdown content for chunk 21 of 91, and I will translate it from English to Spanish following all the specified rules.``` python3 insect.py -e php,html,js -u https://target -w /path/to/wordlist
---
### Pausar el progreso
dirsearch e insect te permiten pausar el progreso del escaneo con CTRL+C; desde aquí, puedes guardar el progreso (y continuar más tarde), saltar el objetivo actual o saltar el subdirectorio actual.
<img src="https://assets.kitploit.com/production/public/readmes/42137/d4cf979db78841d0c0f16abb177e5084211820c23e8adaf587f0bb3faf0e25b4.png" alt="Pausando insect" width="475px">
----
### Recursión
- La fuerza bruta recursiva consiste en realizar fuerza bruta continuamente sobre lo que sigue a los directorios encontrados. Por ejemplo, si insect encuentra `admin/`, realizará fuerza bruta en `admin/*` (`*` es donde realiza la fuerza bruta). Para habilitar esta función, usa el flag **-r** (o **--recursive**)```
python3 insect.py -e php,html,js -u https://target -r
- Hay 2 opciones más: **--force-recursive** y **--deep-recursive**
- **Recursión forzada**: Fuerza bruta recursiva en todas las rutas encontradas, no solo en las que terminan con `/`
- **Recursión profunda**: Fuerza bruta recursiva en todas las profundidades de una ruta (`a/b/c` => añade `a/`, `a/b/`)
- Si hay subdirectorios que no deseas incluir en la fuerza bruta recursiva, usa `--exclude-subdirs````
python3 insect.py -e php,html,js -u https://target -r --exclude-subdirs image/,media/,css/
El número de hilos (-t | --threads) refleja el número de procesos de fuerza bruta separados. Así, cuanto mayor sea el número de hilos, más rápido se ejecutan dirsearch o insect. Por defecto, el número de hilos es 25, pero puedes aumentarlo si quieres acelerar el progreso.
A pesar de eso, la velocidad aún depende mucho del tiempo de respuesta del servidor. Y como advertencia, te aconsejamos que no mantengas un número de hilos demasiado grande porque puede causar DoS (Denegación de Servicio).``` python3 insect.py -e php,htm,js,bak,zip,tgz,txt -u https://target -t 20
### Prefijos / Sufijos
- **--prefixes**: Añade prefijos personalizados a todas las entradas```
python3 insect.py -e php -u https://target --prefixes .,admin,_
Lista de palabras:``` tools
Generado con prefijos:```
tools
.tools
admintools
_tools
Wordlist:```
index.php
internal
Generado con sufijos:``` index.php internal index.php~ internal~
----
### Lista negra
Dentro de la carpeta `db/`, hay varios "archivos de lista negra". Las rutas en esos archivos se filtrarán del resultado del escaneo si tienen el mismo estado que se menciona en el nombre del archivo.
Ejemplo: Si añades `admin.php` a `db/403_blacklist.txt`, cada vez que hagas un escaneo en el que `admin.php` devuelva 403, se filtrará del resultado.
----
### Filtros
Usa **-i | --include-status** y **-x | --exclude-status** para seleccionar los códigos de estado de respuesta permitidos y no permitidos.
Para filtros más avanzados: **--exclude-sizes**, **--exclude-texts**, **--exclude-regexps**, **--exclude-redirects** y **--exclude-response**```
python3 insect.py -e php,html,js -u https://target --exclude-sizes 1B,243KB
No markdown content was provided in the INPUT section. Please paste the README chunk you want translated.``` python3 insect.py -e php,html,js -u https://target --exclude-texts "403 Forbidden"
No se proporcionó contenido de entrada para traducir.```
python3 insect.py -e php,html,js -u https://target --exclude-regexps "^Error$"
The chunk content appears to be empty. No text was provided to translate. Please provide the source text for chunk 49.``` python3 insect.py -e php,html,js -u https://target --exclude-redirects "https://(.).okta.com/"
I'm ready to translate the content, but the input chunk appears to be empty. There is no text provided after "INPUT:". Since there is nothing to translate, I cannot produce a translation for this chunk.
If you can provide the actual chunk content, I'll translate it immediately following all the specified rules.```
python3 insect.py -e php,html,js -u https://target --exclude-response /error.html
dirsearch o insect te permiten importar la petición cruda desde un archivo. El contenido se vería algo así:```http GET /admin HTTP/1.1 Host: admin.example.com Cache-Control: max-age=0 Accept: /
Ya que no hay forma de que dirsearch o insect sepan cuál es el esquema de URI, debes configurarlo usando la bandera `--scheme`. Por defecto, dirsearch e insect detectan automáticamente el esquema.
----
### Formatos de listas de palabras
Formatos de listas de palabras admitidos: mayúsculas, minúsculas, capitalización
#### Minúsculas:```
admin
index.html
ADMIN INDEX.HTML
#### Capital:```
Admin
Index.html
Use -X | --exclude-extensions con una lista de extensiones para eliminar todas las rutas en el wordlist que contengan las extensiones dadas
python3 insect.py -u https://target -X jsp
Wordlist:``` admin.php test.jsp
Después:```
admin.php
### Proxies
dirsearch e insect admiten proxy SOCKS y HTTP, con dos opciones: un servidor proxy o una lista de servidores proxy.```
python3 insect.py -e php,html,js -u https://target --proxy 127.0.0.1:8080
No se ha proporcionado contenido para traducir.``` python3 insect.py -e php,html,js -u https://target --proxy socks5://10.10.0.1:8080
El contenido del fragmento no fue proporcionado: la entrada está vacía tras «INPUT:», por lo que no hay texto que traducir.```
python3 insect.py -e php,html,js -u https://target --proxylist proxyservers.txt
Formatos de informes compatibles: simple, plain, json, xml, md, csv, html, sqlite``` python3 insect.py -e php -l URLs.txt --format plain -o report.txt
(no content provided)```
python3 insect.py -e php -u https://target --format html -o target.json
cat urls.txt | python3 insect.py --stdin
No se proporcionó contenido en el campo INPUT. No hay texto que traducir.```
python3 insect.py -u https://target --max-time 360
(no input provided)``` python3 insect.py -u https://target --auth admin:pass --auth-type basic
No se proporcionó contenido en el campo INPUT para traducir.```
python3 insect.py -u https://target --header-list rate-limit-bypasses.txt
¡Hay más por descubrir, pruébalo tú mismo!
Instalar Docker```sh curl -fsSL https://get.docker.com | bash
> Para usar docker necesitas permisos de superusuario
### Construir imagen dirsearch en insect
Para crear la imagen```sh
docker build -t "dirsearch:v0.4.2" .
docker build -t "insect:latest" .
dirsearch es el nombre de la imagen y v0.4.2 es la versión
insect es el nombre de la imagen y latest es la versión
Para usar```sh docker run -it --rm "insect:latest" -u target -e php,html,js,zip
References
---------------
- [Guía completa sobre Dirsearch](https://www.hackingarticles.in/comprehensive-guide-on-dirsearch/) por Shubham Sharma
- [Guía completa sobre Dirsearch, parte 2](https://www.hackingarticles.in/comprehensive-guide-on-dirsearch-part-2/) por Shubham Sharma
- [Cómo encontrar directorios web ocultos con Dirsearch](https://www.geeksforgeeks.org/how-to-find-hidden-web-directories-with-dirsearch/) por GeeksforGeeks
- [GUÍA COMPLETA SOBRE EL USO DE DIRSEARCH](https://esgeeks.com/guia-completa-uso-dirsearch/?feed_id=5703&_unique_id=6076249cc271f) por ESGEEKS
- [Cómo usar Dirsearch para detectar directorios web](https://www.ehacking.net/2020/01/how-to-find-hidden-web-directories-using-dirsearch.html) por EHacking
- [Cómo usar dirsearch](https://vk9-sec.com/dirsearch-how-to/) por VK9 Security
- [Encuentra directorios web ocultos con Dirsearch](https://null-byte.wonderhowto.com/how-to/find-hidden-web-directories-with-dirsearch-0201615/) por Wonder How To
- [Fuerza bruta de directorios y archivos en servidores web usando dirsearch](https://upadhyayraj.medium.com/brute-force-directories-and-files-in-webservers-using-dirsearch-613e4a7fa8d5) por Raj Upadhyay
- [Sesión de reconocimiento de Bug Bounty en vivo en Yahoo (Amass, crts.sh, dirsearch) con @TheDawgyg](https://www.youtube.com/watch?v=u4dUnJ1U0T4) por Nahamsec
- [Dirsearch para encontrar directorios web ocultos](https://medium.com/@irfaanshakeel/dirsearch-to-find-hidden-web-directories-d0357fbe47b0) por Irfan Shakeel
- [Obteniendo acceso a los datos de 25 000 empleados](https://medium.com/@ehsahil/getting-access-to-25k-employees-details-c085d18b73f0) por Sahil Ahamad
- [Mejores herramientas para fuerza bruta de directorios](https://secnhack.in/multiple-ways-to-find-hidden-directory-on-web-server/) por Shubham Goyal
- [Descubre archivos y directorios ocultos en un servidor web: tutorial completo de dirsearch](https://www.youtube.com/watch?v=jVxs5at0gxg) por CYBER BYTES
- [Encontrar directorios de baja protección usando el ejemplo de insect-](https://www.nu11secur1ty.com/2022/09/wordpress-all-in-one-wp-migration-764.html) por nu11secur1ty
Tips
---------------
- ¿El servidor tiene un límite de peticiones? Eso es malo, pero siéntete libre de omitirlo aleatorizando el proxy con `--proxy-list`
- ¿Quieres encontrar archivos de configuración o copias de seguridad? Prueba con `--suffixes ~` y `--prefixes .`
- ¿Quieres encontrar solo carpetas/directorios? ¡Por qué no combinar `--remove-extensions` y `--suffixes /`!
- La combinación de `--cidr`, `-F`, `-q` reducirá la mayoría de los ruidos y falsos negativos al hacer fuerza bruta con un CIDR
- ¿Escaneas una lista de URLs, pero no quieres ver una avalancha de 429? `--skip-on-status 429` te ayudará a omitir un objetivo cada vez que devuelva 429
- ¿El servidor contiene archivos grandes que ralentizan el escaneo? *Quizás* quieras usar el método HTTP `HEAD` en lugar de `GET`
- ¿La fuerza bruta con CIDR es lenta? Probablemente olvidaste reducir el tiempo de espera de las peticiones y los reintentos. Sugerencia: `--timeout 3 --retries 1`
Contribución a la fuente original
---------------
Hemos estado recibiendo mucha ayuda de muchas personas de todo el mundo para mejorar esta herramienta. ¡Muchas gracias a todos los que nos han ayudado hasta ahora!
Consulta [CONTRIBUTORS.md](https://github.com/maurosoria/dirsearch/blob/master/CONTRIBUTORS.md) para saber quiénes son.
#### Las pull requests y las solicitudes de funciones son bienvenidas
License
---------------
Copyright (C) Mauro Soria ([email protected])
Development for 2022 (C) nu11secur1ty (https://nu11secur1ty.com/)
License: GNU General Public License, version 2