Advertisement
opexxx

plugin_base64.py

Mar 27th, 2015
347
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.73 KB | None | 0 0
  1. #!/usr/bin/env python
  2. __description__ = 'Base64 string decoder for oledump.py'
  3. __author__ = 'James Habben'
  4. __version__ = '0.0.1'
  5. __date__ = '2015/01/30'
  6. import re
  7. import base64
  8. def Decode (input) :
  9. return base64.b64decode(input)
  10. class cBase64Decoder(cPluginParent):
  11. macroOnly = True
  12. name = 'Base64 decoder'
  13. def __init__(self, name, stream, options):
  14. self.streamname = name
  15. self.stream = stream
  16. self.options = options
  17. self.ran = False
  18. def Analyze(self):
  19. self.ran = True
  20. result = []
  21. oREString = re.compile(r'"(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?"')
  22. for foundString in oREString.findall(self.stream):
  23. try:
  24. result.append(Decode(foundString))
  25. except:
  26. pass
  27. return result
  28. AddPlugin(cBase64Decoder)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement