来源:自学PHP网 时间:2015-04-17 13:03 作者: 阅读:次
[导读] 在网上看了一些,发现拿过来不能使用,于是网上查了一下,改了最后一行 ,就可以使用了。#39;#39;#39;Python XSS payload encoderAuthor: BGS (rstcenter.com)Contributor cmiN (rstcenter.com)Date:......
在网上看了一些,发现拿过来不能使用,于是网上查了一下,改了最后一行 ,就可以使用了。 ''' Python XSS payload encoder Author: BGS (rstcenter.com) Contributor cmiN (rstcenter.com) Date: 13 August 2011 Version: Python 2.7 ''' #!/usr/bin/env python import time import sys import urllib2 import base64 def main(): try: if sys.argv[1] == "help": print '[-]'+time.ctime() print'''[-]Instructions: encoder.py <encoding type> "<string>" Available encodings: ascii b64 hex url [-]Exiting... ''' elif sys.argv[1] == "b64": b64_encode() elif sys.argv[1] == "ascii": ascii_encode() elif sys.argv[1] == "hex": hex_encode() elif sys.argv[1] == "url": url_encode() else: sys.exit(1) except Exception, e: print 'Type "encoder.py help" for instructions! ' sys.exit(1) def b64_encode(): payload = sys.argv[2] encoded = base64.standard_b64encode(payload) print ' ################## B64 String #######################' print '' print 'String:' + encoded print '' print "#################### >>EOF<< #########################" def ascii_encode(): payload = sys.argv[2] string = '' for w in payload: string += str(ord(w)) + "," print ' ################## ASCII String #####################' print '' print 'string.fromCharCode(' + string.strip(",") +')' print '' print "#################### >>EOF<< #########################" def hex_encode(): payload = sys.argv[2] encoded = payload.encode('hex') print ' ################## HEX String www.2cto.com #######################' print '' print 'String:' + encoded print '' print "#################### >>EOF<< #########################" def url_encode(): payload = sys.argv[2] encoded = urllib2.quote(payload.encode("utf8")) print ' ################## URL String #######################' print '' print 'String:' + encoded print '' print "#################### >>EOF<< #########################" if __name__ == '__main__': main() 本文来源于独自等待博客 |
自学PHP网专注网站建设学习,PHP程序学习,平面设计学习,以及操作系统学习
京ICP备14009008号-1@版权所有www.zixuephp.com
网站声明:本站所有视频,教程都由网友上传,站长收集和分享给大家学习使用,如由牵扯版权问题请联系站长邮箱904561283@qq.com