https://reality-gaming.fr/proxy.php?image=http%3A%2F%2Fiamswitch.fr%2Fipwc.png&hash=2e37a67a2baed63fb2bc556524b85af3
Bonsoir à tous , je voulais vous partager un petit script que j'ai écrit vite fait en python.
Il permet de convertir une chaine héxadécimale en bytecode (instruction directement éxécutable).
En gros il vous évite de mettre un "\x" entre chaque octet
Code:
#!/usr/bin/python3.4
import sys
string = sys.argv[1]
shellcode = []
shell = ["\\x"]
x = 0
for i in string:
if i != " ":
if i !="\n":
shellcode.append(i)
while x < len(shellcode):
shell.append(shellcode[x])
if x % 2 :
if not x == 0:
shell.append("\\x")
x+= 1
if(shell[len(shell)-1] == " "):
del shell[len(shell)-1]
if(shell[len(shell)-1] == "\\x"):
del shell[len(shell)-1]
shell = "".join(shell)
print(shell)
copier le script et faite un cp /bin/tohex par exemple et passé lui votre chaine (sans oublier les "") en argument. Vous pouvez rediriger la sortie standard vers un fichier ou simplement fait un c/c
exemple d'utilisation
