python3爆破服务器_Python 3.5 之爆破二级域名.

本文介绍了使用Python 3.5进行二级域名爆破的方法,包括`Address.py`用于处理数据库操作,`Dns.py`负责DNS解析。通过多线程和自定义字典进行爆破,找到的二级域名会插入到数据库中。同时提供了代码示例和关键函数的解释。
摘要由CSDN通过智能技术生成

今天更新的是爆破二级域名

版本:Python 3.5

一共是两个文件1、Address.py  2、dns.py[附件配字典,如有不清楚的请联系我QQ]

下面有附件打包.

1、Address.py

import pymysql

class Address(object):

#domainName:www.baidu.com

#ip:192.168.0.1

#tableName:baidu.com

def __init__(self,domainName,ip,tableName):

self.domainName = domainName

self.ip = ip

self.tableName = tableName

#调用创建表的函数

self.createTable(tableName)

#如果这个IP地址存在,则不插入数据

if self.isHava(tableName,ip):

self.insertTable(domainName,ip,tableName)

def createTable(self,tableName):

#根据tableName的参数,创建表

coon = pymysql.connect(host = 'localhost',port = 3306, user = 'root', passwd = '',db = 'new',charset = 'UTF8')

cursor = coon.cursor()

#根据'.'对tableName进行拆分['baidu','com']   根据某一字符给它拆分

DM = tableName.split('.')

a = 'create table if not exists ' + DM[0] +' (id int primary key auto_increment,domainName varchar(1000),ip varchar(1000))'

cursor.execute(a)

coon.commit()

coon.close()

def insertTable(self,domainName,ip,tableName):

#根据table

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值