53 lines
1.8 KiB
Python
Executable File
53 lines
1.8 KiB
Python
Executable File
import psycopg2
|
|
import sys
|
|
import argparse
|
|
import random
|
|
import time
|
|
|
|
# Configuration DB
|
|
DB_PARAMS = "host=localhost dbname=adx_system user=admin password=admin123"
|
|
|
|
def get_viable_resource(target_type):
|
|
try:
|
|
conn = psycopg2.connect(DB_PARAMS)
|
|
cur = conn.cursor()
|
|
|
|
# 1. Sélection d'un Persona 'frais' (non utilisé récemment)
|
|
cur.execute("SELECT first_name, last_name, email, city FROM admin.personas WHERE status = 'active' ORDER BY RANDOM() LIMIT 1")
|
|
persona = cur.fetchone()
|
|
|
|
# 2. Sélection d'une CVC avec solde suffisant
|
|
cur.execute("SELECT card_number, expiry, cvv FROM admin.cvc_manager WHERE is_active = true LIMIT 1")
|
|
cvc = cur.fetchone()
|
|
|
|
cur.close()
|
|
conn.close()
|
|
return persona, cvc
|
|
except Exception as e:
|
|
return None, None
|
|
|
|
def start_forge(target):
|
|
persona, cvc = get_viable_resource(target)
|
|
|
|
if not persona or not cvc:
|
|
print(f"❌ Erreur : Ressources insuffisantes pour {target}.")
|
|
return
|
|
|
|
print(f"👤 Persona sélectionné : {persona[0]} {persona[1]} ({persona[3]})")
|
|
print(f"💳 CVC engagée : {cvc[0][:4]} **** **** ****")
|
|
print(f"⚙️ Lancement du moteur de rendu Selenium pour {target}...")
|
|
|
|
# Simulation des étapes de création
|
|
time.sleep(1)
|
|
print("🛰️ Connexion via Proxy Résidentiel : OK")
|
|
time.sleep(1)
|
|
print(f"📝 Remplissage du formulaire {target} : En cours...")
|
|
time.sleep(2)
|
|
print(f"✅ Succès : Compte {target} créé pour {persona[2]}")
|
|
|
|
if __name__ == "__main__":
|
|
parser = argparse.ArgumentParser()
|
|
parser.add_argument("--type", help="Type de compte à créer"); parser.add_argument("--test-mode", action="store_true", help="Activer le mode test")
|
|
args = parser.parse_args()
|
|
start_forge(args.type)
|