Python crawler tutorial actual combat

After writing a blog for so long, I finally have my own nest. Welcome everyone to visit my personal website . We will communicate and make progress together in the future.

ChatGPT domestic mirror site https://gpt.huntersking.top

Bafangyun has run away, but if there are other similar bugs, it will be the same.

finished product

Invalid
download link
https://wwhz.lanzout.com/iURYe0v2xs0f
Password: 7bo8

Vulnerability analysis

*When Fang Yun registers, he does not need an email verification code to directly enter the email address and password to register

train of thought

1. Grab the package sending and return results during registration

Use the developer tools that come with the browser (press the key combination Ctrl+Shift+I in the browser to open)

Toggle with the network (network) column, clear the data
insert image description here
insert image description here
insert image description here

insert image description here

*Fangyun subscription link copied after login

http://sub.a335.sbs/api/v1/client/subscribe?token=f242c84a3a9d8653b60577e354a1d24e

We only need to save the url and payload of the request to build the contract. After the contract is issued, we only need to get the token to subscribe to Bafang Cloud Clash for 3 hours for free. The speed is excellent.

code writing

1. Randomly generate mailboxes

def generate_random_email():
    username_length = random.randint(8, 10)
    passwd_length = random.randint(8, 16)
    username = ''.join(random.choices(string.ascii_lowercase, k=username_length))
    passwd = ''.join(random.choices(string.ascii_letters + string.digits, k=passwd_length))
    return username+'@hwddoc.com', passwd

2. Register with a random email password

def generate_link():
    url = 'http://bafangcn.vip/api/v1/passport/auth/register'

    headers = {
    
    
        'User-Agent': 'Mozilla/5.0',
    }
    email, passwd = generate_random_email()
    payload = {
    
    
        "email": f"{
      
      email}",
        "password": f"{
      
      passwd}",
        "invite_code": "RucRVhB8",
        "email_code": ""
    }
    response = requests.post(url=url, headers=headers, data=payload)
    data = response.json()['data']
    token = data['token']

3. Construct subscription link (prefix + token)

link = f'http://www.1bbbaf.one/api/v1/client/subscribe?token={
      
      token}'

full code

import requests
import random
import string
import datetime


def generate_random_email():
    username_length = random.randint(8, 10)
    passwd_length = random.randint(8, 16)
    username = ''.join(random.choices(string.ascii_lowercase, k=username_length))
    passwd = ''.join(random.choices(string.ascii_letters + string.digits, k=passwd_length))
    return username+'@hello.com', passwd

url = 'http://bafangcn.vip/api/v1/passport/auth/register'

headers = {
    
    
    'User-Agent': 'Mozilla/5.0',
}
email, passwd = generate_random_email()
payload = {
    
    
    "email": f"{
      
      email}",
    "password": f"{
      
      passwd}",
    "invite_code": "RucRVhB8",
    "email_code": ""
}

response = requests.post(url=url, headers=headers, data=payload)
data = response.json()['data']
token = data['token']
link = f'http://www.1bbbaf.one/api/v1/client/subscribe?token={
      
      token}'
print(link)

The code after encapsulating graphics with tkinter

import tkinter as tk
import requests
import random
import string


def generate_random_email():
    username_length = random.randint(8, 10)
    passwd_length = random.randint(8, 16)
    username = ''.join(random.choices(string.ascii_lowercase, k=username_length))
    passwd = ''.join(random.choices(string.ascii_letters + string.digits, k=passwd_length))
    return username+'@helloworld1.com', passwd


def generate_link():
    url = 'http://bafangcn.vip/api/v1/passport/auth/register'

    headers = {
    
    
        'User-Agent': 'Mozilla/5.0',
    }
    email, passwd = generate_random_email()
    payload = {
    
    
        "email": f"{
      
      email}",
        "password": f"{
      
      passwd}",
        "invite_code": "RucRVhB8",
        "email_code": ""
    }
    response = requests.post(url=url, headers=headers, data=payload)
    data = response.json()['data']
    token = data['token']
    link = f'http://www.1bbbaf.one/api/v1/client/subscribe?token={
      
      token}'
    # response = requests.post(url=url, headers=headers, data=payload)
    # data = response.json()['data']
    # token = data['token']
    # link = f'http://www.1bbbaf.one/api/v1/client/subscribe?token={token}'
    link_entry.delete(0, tk.END)
    link_entry.insert(0, link)


root = tk.Tk()

label = tk.Label(root, text="点击按钮生成订阅链接(每个三小时)")
label.pack()

generate_button = tk.Button(root, text="生成订阅链接", command=generate_link)
generate_button.pack()

link_entry = tk.Entry(root, width=80)
link_entry.pack()
root.title("猎人资源网(https://www.huntersking.top)")
root.mainloop()

The above content is only used for learning and communication, please do not use it in any illegal way, otherwise you will bear the consequences.

Guess you like

Origin blog.csdn.net/godnightshao/article/details/130587632