Advertisement
dc5553

msf2bin.py

Jul 10th, 2011
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. #!/usr/bin/python
  2.  
  3. import sys,re,binascii  
  4.  
  5. def decode():
  6.   """Converts Metaspoit Ruby Script byte code to BIN files"""
  7.   (open(sys.argv[1][:-2]+'bin','wb')).write(binascii.a2b_hex(''.join(re.findall(r'\\x(\w\w)',''.join(open(sys.argv[1],'r').readlines())))))
  8.  
  9. def main():
  10.   if len(sys.argv) < 2:
  11.     print 'Proper syntax requires at least one argument...exiting'
  12.     sys.exit()
  13.   decode()
  14.    
  15. if __name__ == '__main__':
  16.  
  17.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement