Page 1 of 1

Shellcode encoder.

PostPosted: Thu Jun 03, 2010 1:14 pm
by TOSH
Voici un petit outil de ma réalisation, permettant d'effectuer un cryptage XOR sur un shellcode de votre choix.

Ça augmente un peu la taille du shellcode, mais d'après ce que j'ai compris, ça permet d'éviter de se faire détecter par un IDS lorsqu'il voit un paquet avec /bin/sh :D

Je me demandais : l'IDS ne peut pas établir un filtrage directement sur le code du "décrypteur"? (Même question pour les anti-virus, car il me semble que ce genre de polymorphisme existe aussi chez les virus)

Voilà, j'attends de voir ce que vous en pensez, et éventuellement si il y a des bugs :)
Je suppose aussi que je ne suis pas le premier à avoir réalisé un tel outil...

Pour télécharger la source : http://tosh-codes.tuxfamily.org/Documents/shellCrypt.c

PostPosted: Thu Jun 03, 2010 1:38 pm
by ZADYREE
La team 3LRVS en avait fait un similaire: http://3lrvs.tuxfamily.org/releases/polymot.html

PostPosted: Thu Jun 03, 2010 2:01 pm
by TOSH
Merci pour l'info!

Je viens de regarder, et j'ai trouvé l'interface pas très bien faîte (Bon, moi y'en a pas du tout :roll: ), et il faut rentrer le shellcode de base, puis le shellcode crypté pour avoir le shellcode complet. (Mon outil fait tout à la fois)

Intéressant quand même ;)

PostPosted: Thu Jun 03, 2010 2:31 pm
by ROOTBSD
Metasploit permet de faire ce genre de truc :

[code:1:c727d3bae2]
msf > show encoders

Encoders
========

Name Rank Description
---- ---- -----------
cmd/generic_sh good Generic Shell Variable Substitution Command Encoder
cmd/ifs low Generic ${IFS} Substitution Command Encoder
generic/none normal The "none" Encoder
mipsbe/longxor normal XOR Encoder
mipsle/longxor normal XOR Encoder
php/base64 normal PHP Base64 encoder
ppc/longxor normal PPC LongXOR Encoder
ppc/longxor_tag normal PPC LongXOR Encoder
sparc/longxor_tag normal SPARC DWORD XOR Encoder
x64/xor normal XOR Encoder
x86/alpha_mixed low Alpha2 Alphanumeric Mixedcase Encoder
x86/alpha_upper low Alpha2 Alphanumeric Uppercase Encoder
x86/avoid_utf8_tolower manual Avoid UTF8/tolower
x86/call4_dword_xor normal Call+4 Dword XOR Encoder
x86/countdown normal Single-byte XOR Countdown Encoder
x86/fnstenv_mov normal Variable-length Fnstenv/mov Dword XOR Encoder
x86/jmp_call_additive normal Jump/Call XOR Additive Feedback Encoder
x86/nonalpha low Non-Alpha Encoder
x86/nonupper low Non-Upper Encoder
x86/shikata_ga_nai excellent Polymorphic XOR Additive Feedback Encoder
x86/single_static_bit manual Single Static Bit
x86/unicode_mixed manual Alpha2 Alphanumeric Unicode Mixedcase Encoder
x86/unicode_upper manual Alpha2 Alphanumeric Unicode Uppercase Encoder
[/code:1:c727d3bae2]

Regarde aussi du cote msfpayload | msfencode pour bypass les IDS (exemple : [url]http://carnal0wnage.blogspot.com/2010/03/msfencode-msfpayload-into-existing.html[/url])