@Dukebf
2017-07-12T00:12:52.000000Z
字数 1077
阅读 1154
python
前人轮子
不记得是从谁那里整理过来的了
>>> from urllib import *
>>> quote("union select null,null,null")
'union%20select%20null%2Cnull%2Cnull'
>>> unquote("union%20select%20null%2Cnull%2Cnull")
'union select null,null,null'
>>> urlencode({'x':'2333','y':'666'})
'y=666&x=2333'
>>> import base64
>>> base64.b64encode("admin")
'YWRtaW4='
>>> base64.b64decode('YWRtaW4=')
'admin'
>>> '<?php @eval($_POST[a]); ?>'.encode('hex')
'3c3f70687020406576616c28245f504f53545b615d293b203f3e'
>>>
>>> print '3c3f70687020406576616c28245f504f53545b615d293b203f3e'.decode('hex')
<?php @eval($_POST[a]); ?>
>>>
>>> map(ord, "<?php phpinfo() ?>")
[60, 63, 112, 104, 112, 32, 112, 104, 112, 105, 110, 102, 111, 40, 41, 32, 63, 62]
>>> print chr(112)
p
>>> l = [60, 63, 112, 104, 112, 32, 112, 104, 112, 105, 110, 102, 111, 40, 41, 32, 63, 62]
>>> print ''.join(map(chr,l)) #感谢pcat表哥指出的方法
<?php phpinfo() ?>
>>> from hashlib import md5
>>> m = md5()
>>> m.update('this is a secret')
>>> m.hexdigest()
'7dbbcee180ba4d456e4aa1cfbdad9c7b'
>>> m.hexdigest()[8:-8]
'80ba4d456e4aa1cf'
>>>
>>> print u"\u4f60\u9700\u8981\u91cd\u65b0\u767b\u9646"
你需要重新登陆