Archive for the ‘编程开发’ Category

python 里的hexdump

强悍程度略见一斑啊

  1. FILTER=''.join([(len(repr(chr(x)))==3) and chr(x) or '.' for x in range(256)])
  2.  
  3. def dump(src, length=8):
  4.     N=0; result=''
  5.     while src:
  6.         s,src = src[:length],src[length:]
  7.         hexa = ' '.join(["%02X"%ord(x) for x in s])
  8.         s = s.translate(FILTER)
  9.         result += "%04X   %-*s   %s\n" % (N, length*3, hexa, s)
  10.         N+=length
  11.     return result
  12.  
  13. def dump2(src, length=8):
  14.     result=[]
  15.     for i in xrange(0, len(src), length):
  16.         s = src[i:i+length]
  17.         hexa = ' '.join(["%02X"%ord(x) for x in s])
  18.         printable = s.translate(FILTER)
  19.         result.append("%04X   %-*s   %s\n" % (i, length*3, hexa, printable))
  20.     return ''.join(result)

软件项目管理项目计划思维导图

同事之作

Linux 下安装支持SSL连接的 Mysql

1. 安装 OpenSSL:
下载 OpenSSL Version 0.9.6 (www.openssl.org)

shell> zcat 0.96l.tar.gz | tar xvf -
shell> ./config
shell> make
shell> make install

Continue Reading »

解密 HtmlShip 加密的 html 文件

  1. #! /usr/bin/python   
  2. #coding=gb2312   
  3.  
  4. import sys   
  5. import webbrowser, os   
  6.  
  7. if len(sys.argv) < 2:   
  8.   print 'usage: UnHtmlShip.py encodehtml\n' 
  9.   print '运行后将弹出IE,点击允许activex\n' 
  10.   print "将在程序目录下生成 UnHtmlShip.htm" 
  11.   sys.exit(1)   
  12.  
  13.  
  14. pypath = os.path.abspath(os.path.dirname(sys.argv[0]))   
  15. pypath = pypath.replace('\\', '\\\\') 
  16. decodeHtmlpath = pypath + '\\\\UnHtmlShip.htm' 
  17.  
  18.  
  19. # 插入主要起作用的代码 
  20. add = """;var fso, ts;   
  21. fso = new ActiveXObject("Scripting.FileSystemObject"); """ + \ 
  22. """ts = fso.OpenTextFile(""" + '"' + decodeHtmlpath + '"' + """, 8, true); """ + \ 
  23. """ts.WriteLine(w); 
  24. ts.Close();""" 
  25.  
  26. # 获得文件大小,单位字节 
  27. filesize = os.path.getsize(sys.argv[1]) 
  28.  
  29.  
  30.         
  31.  
  32. substring = r',document.write(w);' 
  33. func = lambda(x): x.replace(substring, add) 
  34.  
  35. try
  36.     
  37.       f = open(sys.argv[1], 'rb') 
  38.       lines = f.readlines(filesize) 
  39.  
  40.       newlines = [func(x) for x in lines] 
  41.  
  42.       f = open(sys.argv[1], 'wb') 
  43.       f.writelines(newlines) 
  44.  
  45.       f.close() 
  46.                 
  47.       webbrowser.open(sys.argv[1]) 
  48. except
  49.   print 'error occur'   
  50.   sys.exit(0)

mysql password cracker v 1.0

提交时间:2006-12-30
提交用户:BITS
工具分类:扫 描 器
运行平台:Windows
工具大小:574509 Bytes
文件MD5 :8c452452cb97ed012f236906f61acf45
工具来源:http://forum.eviloctal.com

运行在 windows 平台下的mysql 数据库密码破解程序. 附源代码

J:\MySQL\examples\tests\Release>mysql_pwd_crack.exe
mysql password crack v 1.0
zhouzhenster@gmail.com http://www.6code.net

usage : mysql_pwd_crack [ip] [options]
options:
-u username specify the username of mysql
-x port specify the port of mysql
-p password specify the password of mysql
-d dict specify the dictionary
-a automode automatic crack the mysql password
Note: when u use the -a option, named the username dict user.dic
password dict pass.dic

example: mysql_pwd_crack 127.0.0.1 -x 3306 -u root -d passdict.txt
mysql_pwd_crack 127.0.0.1 -x 3306 -p root -d userdict.txt
mysql_pwd_crack 127.0.0.1 -x 3306 -a

下载