1080 - Pentesting Socks

1080 - Socks Pentesting

AWS hacklemeyi sıfırdan kahramanla öğrenin htARTE (HackTricks AWS Kırmızı Takım Uzmanı)!

HackTricks'ı desteklemenin diğer yolları:

Temel Bilgiler

SOCKS, bir istemci ve sunucu arasında veri transferi için kullanılan bir protokoldür. Beşinci sürüm olan SOCKS5, yalnızca yetkili kullanıcıların sunucuya erişmesine izin veren isteğe bağlı bir kimlik doğrulama özelliği ekler. Temel olarak TCP bağlantılarının proxy'lenmesini ve UDP paketlerinin yönlendirilmesini işler ve OSI modelinin oturum katmanında (Katman 5) çalışır.

Varsayılan Port: 1080

Numaralandırma

Kimlik Doğrulama Kontrolü

nmap -p 1080 <ip> --script socks-auth-info

Temel kullanım

Brute Force saldırısı, bir hedefin şifresini veya kimlik doğrulama bilgilerini tahmin etmek için sürekli olarak farklı kombinasyonları denemek amacıyla kullanılan bir yöntemdir. Bu saldırı, genellikle oturum açma sayfaları veya kimlik doğrulama mekanizmaları gibi hedefin güvenlik önlemlerini aşmak için kullanılır.

Brute Force saldırısını gerçekleştirmek için, bir saldırgan genellikle bir kullanıcı adı ve şifre listesi kullanır. Ardından, bu listeyi hedef sistemdeki oturum açma sayfasına veya kimlik doğrulama mekanizmasına uygular. Saldırgan, doğru kullanıcı adı ve şifre kombinasyonunu bulana kadar farklı kombinasyonları denemeye devam eder.

Bu saldırı yöntemi, hedefin zayıf veya tahmin edilebilir bir şifre kullanması durumunda etkili olabilir. Ancak, güçlü şifreleme algoritmaları ve güvenlik önlemleri kullanıldığında Brute Force saldırıları daha zor hale gelir.

nmap --script socks-brute -p 1080 <ip>

Gelişmiş kullanım

In some cases, you may need to perform advanced tasks while using SOCKS proxies. Here are some techniques that can help you in such scenarios:

Bazı durumlarda, SOCKS proxy'leri kullanırken gelişmiş görevleri gerçekleştirmeniz gerekebilir. İşte böyle senaryolarda size yardımcı olabilecek bazı teknikler:

1. Chaining SOCKS proxies

1. SOCKS proxy zincirleme

You can chain multiple SOCKS proxies together to increase your anonymity and bypass certain restrictions. To do this, you need to configure each proxy to forward traffic to the next proxy in the chain. This can be done by specifying the next proxy's IP address and port in the configuration settings of each proxy.

Anonimliğinizi artırmak ve belirli kısıtlamaları aşmak için birden fazla SOCKS proxy'yi bir araya getirebilirsiniz. Bunun için her bir proxy'i zincirdeki bir sonraki proxy'e trafiği iletmek üzere yapılandırmanız gerekmektedir. Bu, her bir proxy'nin yapılandırma ayarlarında bir sonraki proxy'nin IP adresini ve portunu belirterek yapılabilir.

2. Using SOCKS proxies with other tools

2. Diğer araçlarla SOCKS proxy'lerini kullanma

You can use SOCKS proxies with other tools to enhance your capabilities during a penetration test. For example, you can use a SOCKS proxy with tools like Nmap or Burp Suite to scan or intercept network traffic. To do this, you need to configure the tool to use the SOCKS proxy by specifying its IP address and port.

Bir penetrasyon testi sırasında yeteneklerinizi artırmak için SOCKS proxy'leri diğer araçlarla kullanabilirsiniz. Örneğin, Nmap veya Burp Suite gibi araçları SOCKS proxy ile kullanarak ağ trafiğini taramak veya onu araya girmek için kullanabilirsiniz. Bunun için, aracı SOCKS proxy'yi kullanacak şekilde yapılandırmanız gerekmektedir. Bu, SOCKS proxy'nin IP adresini ve portunu belirterek yapılabilir.

3. Authenticating SOCKS proxies

3. SOCKS proxy'lerini kimlik doğrulama

Some SOCKS proxies support authentication to provide an additional layer of security. If you are using an authenticated SOCKS proxy, you need to provide the correct username and password in the proxy configuration settings. This ensures that only authorized users can access the proxy.

Bazı SOCKS proxy'leri, ek bir güvenlik katmanı sağlamak için kimlik doğrulamayı destekler. Eğer kimlik doğrulamalı bir SOCKS proxy kullanıyorsanız, proxy yapılandırma ayarlarında doğru kullanıcı adı ve şifreyi sağlamanız gerekmektedir. Bu, yalnızca yetkili kullanıcıların proxy'ye erişebileceğini sağlar.

By using these advanced techniques, you can maximize the benefits of SOCKS proxies and improve your penetration testing capabilities.

Bu gelişmiş teknikleri kullanarak, SOCKS proxy'lerin faydalarını maksimize edebilir ve penetrasyon testi yeteneklerinizi geliştirebilirsiniz.

nmap  --script socks-brute --script-args userdb=users.txt,passdb=rockyou.txt,unpwdb.timelimit=30m -p 1080 <ip>

Pentesting SOCKS

Introduction

SOCKS (Socket Secure) is a protocol that allows a client to establish a connection through a proxy server. It is commonly used for bypassing network restrictions and anonymizing internet traffic. In this section, we will explore various techniques for pentesting SOCKS servers.

Enumeration

Version Detection

To determine the version of the SOCKS server, we can send a SOCKS5 handshake request and analyze the response. The server will reply with its supported version and authentication methods.

$ nc -v <target_ip> <target_port>
> 05 01 00
< 05 00

If the server responds with 05 00, it indicates that it supports SOCKS5 without authentication.

User Enumeration

To enumerate valid usernames on a SOCKS server, we can use the USERAUTH command. By sending a USERAUTH request with a specific username, we can determine if the username is valid or not.

$ nc -v <target_ip> <target_port>
> 05 01 00
< 05 00
> 01 03 61 64 6d 69 6e 00
< 01 00

In the above example, we send a USERAUTH request with the username admin. If the server responds with 01 00, it means that the username is valid.

Exploitation

Proxy Chaining

Proxy chaining involves using multiple SOCKS servers in a chain to route traffic through different proxies. This technique can be used to bypass network restrictions and increase anonymity.

To set up proxy chaining, we need to configure each SOCKS server to forward traffic to the next server in the chain. This can be done by modifying the server's configuration file or using a proxy chaining tool.

Traffic Analysis

By analyzing the traffic between the client and the SOCKS server, we can gain valuable information about the network infrastructure and potential vulnerabilities. Tools like Wireshark can be used to capture and analyze network traffic.

Authentication Bypass

If the SOCKS server requires authentication, we can attempt to bypass it by exploiting vulnerabilities in the authentication mechanism. Common techniques include brute-forcing weak passwords, exploiting default credentials, or leveraging authentication bypass vulnerabilities.

Conclusion

Pentesting SOCKS servers involves enumerating server versions, enumerating valid usernames, exploiting proxy chaining, analyzing network traffic, and bypassing authentication. By understanding these techniques, we can effectively assess the security of SOCKS servers and identify potential vulnerabilities.

PORT     STATE SERVICE
1080/tcp open  socks
| socks-brute:
|   Accounts
|     patrik:12345 - Valid credentials
|   Statistics
|_    Performed 1921 guesses in 6 seconds, average tps: 320

Tünelleme ve Port Yönlendirme

Temel proxychains kullanımı

Proxy zincirini ayarlayarak socks proxy kullanın

nano /etc/proxychains4.conf

SOCKS Proxy

A SOCKS proxy is a protocol that allows a client to establish a connection through a firewall to a server located on the other side of the firewall. It can be used to bypass network restrictions and access resources that are otherwise blocked.

SOCKS Versions

There are several versions of the SOCKS protocol, with the most commonly used being SOCKS4 and SOCKS5.

SOCKS4

SOCKS4 is an older version of the protocol that only supports TCP connections. It does not support authentication, which means that anyone who can connect to the proxy can use it to access the internet.

SOCKS5

SOCKS5 is the latest version of the protocol and includes several improvements over SOCKS4. It supports both TCP and UDP connections and includes support for authentication. This means that the proxy can be configured to require a username and password before allowing connections.

Setting Up a SOCKS Proxy

To set up a SOCKS proxy, you will need a server that supports the SOCKS protocol. There are several options available, including both free and paid services.

Once you have a server, you will need to configure your client to use the proxy. This can usually be done through the network settings or by using a proxy client.

Using a SOCKS Proxy for Pentesting

A SOCKS proxy can be a useful tool for pentesting, as it allows you to route your traffic through a remote server. This can help to hide your identity and location, making it more difficult for defenders to detect and block your activities.

When using a SOCKS proxy for pentesting, it is important to ensure that the proxy is secure and trustworthy. Using an insecure or compromised proxy can expose your traffic to interception and manipulation.

Conclusion

A SOCKS proxy is a powerful tool that can be used to bypass network restrictions and access resources that are otherwise blocked. It is important to use a secure and trustworthy proxy when using it for pentesting purposes.

socks5 10.10.10.10 1080

Kimlik doğrulama ile

socks5 10.10.10.10 1080 username password

Daha fazla bilgi için: Tünel Oluşturma ve Port Yönlendirme

AWS hacklemeyi sıfırdan kahraman seviyesine öğrenin htARTE (HackTricks AWS Kırmızı Takım Uzmanı)!

HackTricks'i desteklemenin diğer yolları:

Last updated