← retour aux outils back to tools

# Proxychains

Router n'importe quel trafic TCP à travers des chaînes de proxys SOCKS4/5 ou HTTP. Indispensable pour le pivoting à travers des hôtes compromis. Route any TCP traffic through SOCKS4/5 or HTTP proxy chains. Essential for pivoting through compromised hosts.

↗ https://github.com/haad/proxychains

## Overview

Proxychains forces TCP connections of any tool through a proxy chain. It works by intercepting system calls via `LD_PRELOAD`, making any dynamically-linked tool proxy-aware without modifying it.

## Configuration

    # Edit config
    sudo nano /etc/proxychains4.conf
    # or
    nano ~/.proxychains/proxychains.conf

    # /etc/proxychains4.conf

    # Chain type
    dynamic_chain     # Skip dead proxies (recommended)
    # strict_chain    # All proxies must be up
    # random_chain    # Random order

    proxy_dns         # Resolve DNS through the proxy

    [ProxyList]
    socks5  127.0.0.1  1080   # Chisel / Ligolo SOCKS
    socks4  127.0.0.1  1080
    http    127.0.0.1  8080

## Usage

    # Prefix any command with proxychains
    proxychains nmap -sT -Pn 10.10.20.1
    proxychains curl http://10.10.20.10
    proxychains ssh user@10.10.20.10
    proxychains netexec smb 10.10.20.0/24

Quiet mode (suppress connection output)

    proxychains -q nmap -sT -Pn 10.10.20.1

## Common Proxy Combinations

    # Chisel SOCKS5 tunnel
    socks5  127.0.0.1  1080

    # SSH dynamic port forward
    # ssh -D 1080 user@jump-host
    socks5  127.0.0.1  1080

    # Burp as upstream proxy
    http    127.0.0.1  8080

Help / Man page

    proxychains4 [options] <program> [args]

    OPTIONS:
      -q        Quiet mode (suppress output)
      -f FILE   Use specific config file

    CONFIG OPTIONS (/etc/proxychains4.conf):

    CHAIN TYPES:
      strict_chain    All proxies used in order
      dynamic_chain   Skip unavailable proxies
      round_robin_chain  Rotate proxies
      random_chain    Random order

    PROXY_DNS:
      proxy_dns       Resolve DNS through proxy (prevent leaks)

    TIMEOUT:
      tcp_read_time_out 15000   Read timeout (ms)
      tcp_connect_time_out 8000 Connect timeout (ms)

    [ProxyList] FORMAT:
      type  host  port  [user  password]
      socks4  host  port
      socks5  host  port  [user  pass]
      http    host  port  [user  pass]

    NOTE: Only TCP is proxied. UDP and ICMP bypass proxychains.
    Use -sT with nmap (TCP Connect scan) instead of -sS (SYN).

## Vue d’ensemble

Proxychains force les connexions TCP de n’importe quel outil à travers une chaîne de proxys. Il fonctionne en interceptant les appels système via `LD_PRELOAD`, rendant n’importe quel outil lié dynamiquement compatible avec les proxys sans le modifier.

## Configuration

    # Modifier la configuration
    sudo nano /etc/proxychains4.conf
    # ou
    nano ~/.proxychains/proxychains.conf

    # /etc/proxychains4.conf

    # Type de chaîne
    dynamic_chain     # Ignorer les proxys inactifs (recommandé)
    # strict_chain    # Tous les proxys doivent être actifs
    # random_chain    # Ordre aléatoire

    proxy_dns         # Résoudre le DNS à travers le proxy

    [ProxyList]
    socks5  127.0.0.1  1080   # Chisel / Ligolo SOCKS
    socks4  127.0.0.1  1080
    http    127.0.0.1  8080

## Utilisation

    # Préfixer n'importe quelle commande avec proxychains
    proxychains nmap -sT -Pn 10.10.20.1
    proxychains curl http://10.10.20.10
    proxychains ssh user@10.10.20.10
    proxychains netexec smb 10.10.20.0/24

    # Mode silencieux (supprimer la sortie de connexion)
    proxychains -q nmap -sT -Pn 10.10.20.1

## Combinaisons de proxys courantes

    # Tunnel SOCKS5 Chisel
    socks5  127.0.0.1  1080

    # Redirection de port dynamique SSH
    # ssh -D 1080 user@jump-host
    socks5  127.0.0.1  1080

    # Burp comme proxy en amont
    http    127.0.0.1  8080

Aide / Page de manuel

    proxychains4 [options] <program> [args]

    OPTIONS:
      -q        Quiet mode (suppress output)
      -f FILE   Use specific config file

    CONFIG OPTIONS (/etc/proxychains4.conf):

    CHAIN TYPES:
      strict_chain    All proxies used in order
      dynamic_chain   Skip unavailable proxies
      round_robin_chain  Rotate proxies
      random_chain    Random order

    PROXY_DNS:
      proxy_dns       Resolve DNS through proxy (prevent leaks)

    TIMEOUT:
      tcp_read_time_out 15000   Read timeout (ms)
      tcp_connect_time_out 8000 Connect timeout (ms)

    [ProxyList] FORMAT:
      type  host  port  [user  password]
      socks4  host  port
      socks5  host  port  [user  pass]
      http    host  port  [user  pass]

    NOTE: Only TCP is proxied. UDP and ICMP bypass proxychains.
    Use -sT with nmap (TCP Connect scan) instead of -sS (SYN).