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

102 lines
3.6 KiB
Markdown
Raw Normal View History

2022-05-01 13:25:53 +00:00
# 1080 - Pentesting Socks
2022-04-28 16:01:33 +00:00
<details>
<summary><strong>Support HackTricks and get benefits!</strong></summary>
Do you work in a **cybersecurity company**? Do you want to see your **company advertised in HackTricks**? or do you want to have access the **latest version of the PEASS or download HackTricks in PDF**? Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)!
Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family)
Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com)
**Join the** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** me on **Twitter** [**🐦**](https://github.com/carlospolop/hacktricks/tree/7af18b62b3bdc423e11444677a6a73d4043511e9/\[https:/emojipedia.org/bird/README.md)[**@carlospolopm**](https://twitter.com/carlospolopm)**.**
**Share your hacking tricks submitting PRs to the** [**hacktricks github repo**](https://github.com/carlospolop/hacktricks)**.**
</details>
2022-05-01 13:25:53 +00:00
## Basic Information
2022-04-28 16:01:33 +00:00
2022-05-01 13:25:53 +00:00
SOCKS is an Internet protocol that exchanges network packets between a client and server through a proxy server. SOCKS5 optionally provides authentication,\
so only authorized users may access a server.
2022-05-01 13:25:53 +00:00
Practically, a SOCKS server proxies TCP connections to an arbitrary IP address, and provides a means for UDP packets to be forwarded.\
SOCKS performs at Layer 5 of the OSI model
**Default Port:** 1080
2022-05-01 13:25:53 +00:00
## Enumeration
2022-05-01 13:25:53 +00:00
### Authentication Check
```bash
nmap -p 1080 <ip> --script socks-auth-info
```
2022-05-01 13:25:53 +00:00
### Brute Force
2022-05-01 13:25:53 +00:00
#### Basic usage
```bash
nmap --script socks-brute -p 1080 <ip>
```
2022-05-01 13:25:53 +00:00
#### Advanced usage
```bash
nmap --script socks-brute --script-args userdb=users.txt,passdb=rockyou.txt,unpwdb.timelimit=30m -p 1080 <ip>
```
2022-05-01 13:25:53 +00:00
#### Output
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
```
2022-05-01 13:25:53 +00:00
## Tunneling and Port Forwarding
2022-05-01 13:25:53 +00:00
### Basic proxychains usage
Setup proxy chains to use socks proxy
2022-05-01 13:25:53 +00:00
```
nano /etc/proxychains4.conf
```
Edit the bottom and add your proxy
2022-05-01 13:25:53 +00:00
```
socks5 10.10.10.10 1080
```
With auth
2022-05-01 13:25:53 +00:00
```
socks5 10.10.10.10 1080 username password
```
2022-05-01 13:25:53 +00:00
#### More info: [Tunneling and Port Forwarding](../generic-methodologies-and-resources/tunneling-and-port-forwarding.md)
2022-04-28 16:01:33 +00:00
<details>
<summary><strong>Support HackTricks and get benefits!</strong></summary>
Do you work in a **cybersecurity company**? Do you want to see your **company advertised in HackTricks**? or do you want to have access the **latest version of the PEASS or download HackTricks in PDF**? Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)!
Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family)
Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com)
**Join the** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** me on **Twitter** [**🐦**](https://github.com/carlospolop/hacktricks/tree/7af18b62b3bdc423e11444677a6a73d4043511e9/\[https:/emojipedia.org/bird/README.md)[**@carlospolopm**](https://twitter.com/carlospolopm)**.**
**Share your hacking tricks submitting PRs to the** [**hacktricks github repo**](https://github.com/carlospolop/hacktricks)**.**
</details>