hacktricks/network-services-pentesting/1080-pentesting-socks.md

116 lines
4.6 KiB
Markdown
Raw Normal View History

2024-04-06 19:38:49 +00:00
# 1080 - Pentesting Socks
<details>
<summary><strong>Aprenda hacking na AWS do zero ao herói com</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (HackTricks AWS Red Team Expert)</strong></a><strong>!</strong></summary>
Outras maneiras de apoiar o HackTricks:
2022-04-28 16:01:33 +00:00
* Se você deseja ver sua **empresa anunciada no HackTricks** ou **baixar o HackTricks em PDF**, verifique os [**PLANOS DE ASSINATURA**](https://github.com/sponsors/carlospolop)!
* Adquira o [**swag oficial PEASS & HackTricks**](https://peass.creator-spring.com)
* Descubra [**A Família PEASS**](https://opensea.io/collection/the-peass-family), nossa coleção exclusiva de [**NFTs**](https://opensea.io/collection/the-peass-family)
2024-04-06 19:38:49 +00:00
* **Junte-se ao** 💬 [**grupo Discord**](https://discord.gg/hRep4RUj7f) ou ao [**grupo telegram**](https://t.me/peass) ou **siga-nos** no **Twitter** 🐦 [**@carlospolopm**](https://twitter.com/hacktricks\_live)**.**
* **Compartilhe seus truques de hacking enviando PRs para os** [**HackTricks**](https://github.com/carlospolop/hacktricks) e [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) repositórios do github.
</details>
## Informações Básicas
2022-04-28 16:01:33 +00:00
**SOCKS** é um protocolo usado para transferir dados entre um cliente e um servidor por meio de um proxy. A quinta versão, **SOCKS5**, adiciona um recurso de autenticação opcional, permitindo que apenas usuários autorizados acessem o servidor. Ele lida principalmente com a proxy de conexões TCP e o encaminhamento de pacotes UDP, operando na camada de sessão (Camada 5) do modelo OSI.
2022-04-28 16:01:33 +00:00
**Porta Padrão:** 1080
2023-06-06 18:56:34 +00:00
## Enumeração
### Verificação de Autenticação
2024-04-06 19:38:49 +00:00
```bash
nmap -p 1080 <ip> --script socks-auth-info
```
2024-04-06 19:38:49 +00:00
### Ataque de Força Bruta
2023-06-06 18:56:34 +00:00
#### Uso Básico
2024-04-06 19:38:49 +00:00
```bash
nmap --script socks-brute -p 1080 <ip>
```
2024-04-06 19:38:49 +00:00
2023-06-06 18:56:34 +00:00
#### Uso avançado
2024-04-06 19:38:49 +00:00
```bash
nmap --script socks-brute --script-args userdb=users.txt,passdb=rockyou.txt,unpwdb.timelimit=30m -p 1080 <ip>
```
2024-04-06 19:38:49 +00:00
2023-06-06 18:56:34 +00:00
#### Saída
2024-04-06 19:38:49 +00:00
2022-05-01 13:25:53 +00:00
```
PORT STATE SERVICE
1080/tcp open socks
| socks-brute:
| Accounts
| patrik:12345 - Valid credentials
| Statistics
|_ Performed 1921 guesses in 6 seconds, average tps: 320
```
2024-04-06 19:38:49 +00:00
## Tunelamento e Encaminhamento de Portas
2023-06-06 18:56:34 +00:00
### Uso básico do proxychains
Configurar o proxychains para usar um proxy socks
2024-04-06 19:38:49 +00:00
2022-05-01 13:25:53 +00:00
```
nano /etc/proxychains4.conf
```
2024-04-06 19:38:49 +00:00
### Using Socks Proxy
To use a SOCKS proxy during your penetration testing, you can utilize tools like Proxychains or ProxyCap. These tools allow you to route your traffic through a SOCKS proxy server, enabling you to mask your IP address and bypass network restrictions.
2023-06-06 18:56:34 +00:00
#### Proxychains Configuration
1. Edit the configuration file `/etc/proxychains.conf`.
2. Uncomment the line `dynamic_chain`.
2024-04-06 19:38:49 +00:00
3. Add your SOCKS proxy information at the end of the file in the following format:
```
socks5 127.0.0.1 1080
```
4. Save the file and exit.
#### ProxyCap Configuration
1. Open ProxyCap and go to `Proxy` > `Proxy Servers`.
2. Click on `Add Proxy Server` and enter your SOCKS proxy details.
3. Go to `Rules` > `Default Rules` and select the proxy server you added.
4. Save the configuration.
Now you can run your penetration testing tools through the SOCKS proxy you configured.
2024-04-06 19:38:49 +00:00
2022-05-01 13:25:53 +00:00
```
socks5 10.10.10.10 1080
```
2024-04-06 19:38:49 +00:00
2023-06-06 18:56:34 +00:00
Com autenticação
2024-04-06 19:38:49 +00:00
2022-05-01 13:25:53 +00:00
```
socks5 10.10.10.10 1080 username password
```
2024-04-06 19:38:49 +00:00
#### Mais informações: [Tunelamento e Encaminhamento de Porta](https://github.com/carlospolop/hacktricks/blob/pt/metodologias-e-recursos-gen%C3%A9ricos/tunelamento-e-encaminhamento-de-porta.md)
2022-04-28 16:01:33 +00:00
<details>
<summary><strong>Aprenda hacking AWS do zero ao herói com</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (HackTricks AWS Red Team Expert)</strong></a><strong>!</strong></summary>
2022-04-28 16:01:33 +00:00
Outras maneiras de apoiar o HackTricks:
2022-04-28 16:01:33 +00:00
* Se você deseja ver sua **empresa anunciada no HackTricks** ou **baixar o HackTricks em PDF**, verifique os [**PLANOS DE ASSINATURA**](https://github.com/sponsors/carlospolop)!
* Adquira o [**swag oficial PEASS & HackTricks**](https://peass.creator-spring.com)
* Descubra [**A Família PEASS**](https://opensea.io/collection/the-peass-family), nossa coleção exclusiva de [**NFTs**](https://opensea.io/collection/the-peass-family)
2024-04-06 19:38:49 +00:00
* **Junte-se ao** 💬 [**grupo Discord**](https://discord.gg/hRep4RUj7f) ou ao [**grupo telegram**](https://t.me/peass) ou **siga-nos** no **Twitter** 🐦 [**@carlospolopm**](https://twitter.com/hacktricks\_live)**.**
* **Compartilhe seus truques de hacking enviando PRs para os** [**HackTricks**](https://github.com/carlospolop/hacktricks) e [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) repositórios do github.
2022-04-28 16:01:33 +00:00
</details>