shellcode maker written in python

hello world… iseng iseng cari referensi tentang shellcoding, eh.. akhirnya mengisengkan diri untuk membuat program untuk otomatisasi membuat shellcode dari source.asm, berikut sourcecodenya, silahkan dikembangkan…

#!/usr/bin/env python
import os, sys, time
os.system("clear")
def banner():
    print "###################################################################"
    print "___________________________________________________________________"
    print "________/__\_|_|__/__//_______/__________________|__|______________"
    print "_______/___ \|_|_/__//__/_____/_____/_/_____\____|__|_/_____\______"
    print "______/__/\__|_|/__//______\_/__/____/__/\___\/_____|/______/______"
    print "_____/__/__\_|___<__\__\_____\__\____\__\/___/__/___|__<___________"
    print "____(________|_|\__\_\__\_____\_____\_\_____/\_______\_____\_______"
    print "_____________\_|_\__\_\__\_________________________________________"
    print "______________\/__\__\_________shellcode generator v.1_____________"
    print "_______________________________coder: -AKF-________________________"
    print "_______________________________requirements: linux, nasm, gcc______"
    print "_______________________________target : intel-32___________________"
    print "___________________________________________________________________"
    print "###################################################################"

if len(sys.argv) <= 1:
    banner()
    print "[+]usage: ./" + sys.argv[0] + " source.asm"   
    print "[+]ex: ./" + sys.argv[0] + " testshell.asm"
    sys.exit(1)

banner()
akf = sys.argv[1]
egg = akf[:-4]
greenblack="nasm -f elf " + akf
dop="ld -o egg"+ " " + egg + ".o"
print "[+]please wait while processing your program"
os.system(greenblack)
time.sleep(3)
print "[+]almost D0ne..."
os.system(dop)
time.sleep(3)	
print "[+]D0ne!!, the shellcode is:"
print ""
print "<-------save the code below in .c-------->"
print ""
print "//shellcode generator v.1"
print "//coder: -AKF- a.k.a redshadow"
print "//underattacks security research"
print "//akfcode"
print "#include <stdio.h>"
print "char shellcode[]="
minal = "egg"
lakov = "objdump -d ./"
qolbu = "|grep '[0-9a-f]:'|grep -v 'file'|cut -f2 -d:|cut -f1-6 -d' '|tr -s ' '|tr '\\t' ' '|sed 's/ $//g'|sed 's/ /\\\\x/g'|paste -d '' -s |sed 's/^/\"/'|sed 's/$/\"/g'"
likov = lakov+minal+qolbu
os.system(likov)
print ";"
print "int main(void) {"
print "((void (*)(void))shellcode)();"
print "return 0;"
print "}"
print ""
print "<----------------- EOF ------------------->"
print ""
print "[+]thanks for using!!!"
brengos = "rm egg"
masje = "rm " + egg + ".o"
os.system(brengos)
os.system(masje)

dan berikut contoh penggunaanya:
Read more of this post

Follow

Get every new post delivered to your Inbox.