-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoffline_iban.py
842 lines (668 loc) · 22.4 KB
/
offline_iban.py
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
#!/usr/bin/env python3
"""
BU ARAÇ OSINT CERCEVESİ İCERİSİNDE BİLGİ TOPLAMAK AMACIYLA YAZILMIS OLUP
KOTU AMACLI KULLANIM DURUMUNDA SORUMLULUK KISIYE AITTIR
AMACI DUNYA CAPINDA GECERLI OLAN IBAN NUMARASININ KENDİ İCERİSİNDE BARINDIRMI OLDUGU
BILGILERI KULLANARAK BILGI TOPLAMAKTIR INTERNET BAGLANTISINA GEREK DUYMAZ TAMAMEN
CEVRIM DISI OLARAK CALISABILMEKTEDIR
LİSANS: MIT
YAZAR: TheKoba-dev
TELEGRAM: @BayTapsan
BELGE DUZENLENME:07.11.2022
KULLANIM:
python3 dosya.py -i "çözümlenecek_iban"
UYARI: IBAN'I YAZARKEN BOSLUK KULLANMYAINIZ
"""
import argparse
from colorama import *
import os
import requests
try:
from bs4 import BeautifulSoup
except Exception:
try:
os.system("pip3 install bs4")
except Exception:
print("BeautifulSoup içe aktarılamadı")
arguman = argparse.ArgumentParser()
arguman.add_argument("-i","--iban",required=True,help="usage: -i \"TR330001000030570718255001\"")
argumanlar = vars(arguman.parse_args())
iban = argumanlar["iban"]
def country_detect (raw_1):
global max_leng
global account_control
global bank_branch
global status_sepa
try:
country_number = raw_1[0] + raw_1[1]
country_number = country_number.upper()
except Exception:
print(f"{Fore.RED}Eksik veri.!{Style.RESET_ALL}")
return exit(1)
if country_number == "TR":
country = "Turkey"
max_leng = 26
status_sepa = False
account_control = False
bank_branch = True
elif country_number == "DE":
country = "Almanya"
max_leng =22
status_sepa = True
account_control = True
bank_branch = True
elif country_number == "AD":
country = "Andora"
max_leng = 24
status_sepa = False
account_control = False
bank_branch = True
elif country_number == "AL":
country = "Arnavutluk"
max_leng = 28
status_sepa = False
account_control = False
bank_branch = True
elif country_number == "AT":
country = "Avusturya"
max_leng = 20
status_sepa = True
account_control = True
bank_branch = True
elif country_number == "AZ":
country = "Azerbaycan"
max_leng = 28
status_sepa = False
account_control = False
bank_branch = False
elif country_number == "BH":
country = "Bahreyn"
max_leng = 22
status_sepa = False
account_control = False
bank_branch = False
elif country_number == "BY":
country = "Belarus"
max_leng = 28
status_sepa = False
account_control = False
bank_branch = False
elif country_number == "BE":
country = "Belçika"
max_leng = 16
status_sepa = True
account_control = True
bank_branch = True
elif country_number == "AE":
country = "Birleşik Arap Emirlikleri"
max_leng = 23
status_sepa = False
account_control = False
bank_branch = False
elif country_number == "GB":
country = "Birleşik Krallık"
max_leng = 22
status_sepa = True
account_control = True
bank_branch = True
elif country_number == "BA":
country = "Bosna Hersek"
max_leng = 20
status_sepa = False
account_control = True
bank_branch = True
elif country_number == "BR":
country = "Brezilya"
max_leng = 29
status_sepa = False
account_control = False
bank_branch = True
elif country_number == "BG":
country = "Bulgaristan"
max_leng = 22
status_sepa = True
account_control = False
bank_branch = True
elif country_number == "GI":
country = "Cebelitarık"
max_leng = 23
status_sepa = True
account_control = False
bank_branch = True
elif country_number == "DK":
country = "Danimarka"
max_leng = 18
status_sepa = True
account_control = False
bank_branch = True
elif country_number == "DO":
country = "Dominik Cumhuriyeti"
max_leng = 28
status_sepa = False
account_control = False
bank_branch = True
elif country_number == "TL":
country = "Doğu Timor"
max_leng = 23
status_sepa = False
account_control = True
bank_branch = False
elif country_number == "SV":
country = "El Salvador"
max_leng = 28
status_sepa = False
account_control = False
bank_branch = False
elif country_number == "EE":
country = "Estonya"
max_leng = 20
status_sepa = True
account_control = True
bank_branch = True
elif country_number == "FO":
country = "Faroe Adaları"
max_leng = 18
status_sepa = True
account_control = False
bank_branch = True
elif country_number == "PS":
country = "Filistin"
max_leng = 29
status_sepa = False
account_control = False
bank_branch = False
elif country_number == "FI":
country = "Finlandiya"
max_leng = 18
status_sepa = True
account_control = True
bank_branch = True
elif country_number == "FR":
country = "Fransa"
max_leng = 27
status_sepa = True
account_control = True
bank_branch = True
elif country_number == "GL":
country = "Grönland"
max_leng = 18
status_sepa = True
account_control = False
bank_branch = True
elif country_number == "GT":
country = "Guatemala"
max_leng = 28
status_sepa = False
account_control = False
bank_branch = False
elif country_number == "GE":
country = "Gürcistan"
max_leng = 22
status_sepa = False
account_control = False
bank_branch = False
elif country_number == "NL":
country = "Hollanda"
max_leng = 18
status_sepa = True
account_control = True
bank_branch = True
elif country_number == "HR":
country == "Hırvatistan"
max_leng = 21
status_sepa = True
account_control = True
bank_branch = False
elif country_number == "IE":
country = "İrlanda"
max_leng = 22
status_sepa = True
account_control = True
bank_branch = True
elif country_number == "ES":
country = "İspanya"
max_leng = 24
status_sepa = True
account_control = True
bank_branch = True
elif country_number == "IL":
country = "İsrail"
max_leng = 23
status_sepa = False
account_control = False
bank_branch = True
elif country_number == "SE":
country = "İsveç"
max_leng = 24
status_sepa = True
account_control = True
bank_branch = True
elif country_number == "CH":
country = "İsviçre"
max_leng = 21
status_sepa = True
account_control = True
bank_branch = True
elif country_number == "IT":
country = "İtalya"
max_leng = 27
status_sepa = True
account_control = True
bank_branch = True
elif country_number == "IS":
country = "İzlanda"
max_leng = 26
status_sepa = True
account_control = True
bank_branch = True
elif country_number == "ME":
country = "Karadağ"
max_leng = 22
status_sepa = False
account_control = True
bank_branch = False
elif country_number == "QA":
country = "Katar"
max_leng = 29
status_sepa = False
account_control = False
bank_branch = False
elif country_number == "KZ":
country = "Kazakistan"
max_leng = 20
status_sepa = False
account_control = False
bank_branch = False
elif country_number == "XK":
country = "Kosova"
max_leng = 20
status_sepa = False
account_control = True
bank_branch = True
elif country_number == "CR":
country = "Kostarika"
max_leng = 22
status_sepa = False
account_control = True
bank_branch = False
elif country_number == "KW":
country = "Kuveyt"
max_leng = 30
status_sepa = False
account_control = False
bank_branch = False
elif country_number == "CY":
country = "Kıbrıs"
max_leng = 28
status_sepa = True
account_control = False
bank_branch = True
elif country_number == "LV":
country = "Letonya"
max_leng = 21
status_sepa = True
account_control = False
bank_branch = False
elif country_number == "LI":
country = "Lihtenştayn"
max_leng = 21
status_sepa = True
account_control = True
bank_branch = True
elif country_number == "LT":
country = "Litvanya"
max_leng = 20
status_sepa = True
account_control = False
bank_branch = True
elif country_number == "LB":
country = "Lübnan"
max_leng = 28
status_sepa = False
account_control = False
bank_branch = False
elif country_number == "LU":
country = "Lüksemburg"
max_leng = 20
status_sepa = True
account_control = False
bank_branch = False
elif country_number == "HU":
country = "Macaristan"
max_leng = 28
status_sepa = True
account_control = True
bank_branch = True
elif country_number == "MK":
country = "Makedonya"
max_leng = 19
status_sepa = False
account_control = True
bank_branch = False
elif country_number == "MT":
country = "Malta"
max_leng = 31
status_sepa = True
account_control = False
bank_branch = True
elif country_number == "MU":
country = "Mauritius"
max_leng = 30
status_sepa = False
account_control = False
bank_branch = True
elif country_number == "MD":
country = "Moldova"
max_leng = 24
status_sepa = False
account_control = False
bank_branch = False
elif country_number == "MC":
country = "Monako"
max_leng = 27
status_sepa = True
account_control = True
bank_branch = True
elif country_number == "MR":
country = "Moritanya"
max_leng = 27
status_sepa = False
account_control = True
bank_branch = True
elif country_number == "PK":
country = "Pakistan"
max_leng = 24
status_sepa = False
account_control = False
bank_branch = False
elif country_number == "PL":
country = "Polonya"
max_leng = 28
status_sepa = True
account_control = True
bank_branch = True
elif country_number == "PT":
country = "Portekiz"
max_leng = 25
status_sepa = True
account_control = True
bank_branch = True
elif country_number == "RO":
country = "Romanya"
max_leng = 24
status_sepa = True
account_control = False
bank_branch = False
elif country_number == "LC":
country = "Saint Lucia"
max_leng = 32
status_sepa = False
account_control = False
bank_branch = False
elif country_number == "SM":
country = "San Marino"
max_leng = 27
status_sepa = True
account_control = True
bank_branch = True
elif country_number == "ST":
country = "Sao Tome ve Principe"
max_leng = 25
status_sepa = False
account_control = False
bank_branch = False
elif country_number == "SC":
country = "Seyşeller"
max_leng = 31
status_sepa = False
account_control = False
bank_branch = False
elif country_number == "SK":
country = "Slovak Cumhuriyeti"
max_leng = 24
status_sepa = True
account_control = True
bank_branch = False
elif country_number == "SI":
country = "Slovenya"
max_leng = 19
status_sepa = True
account_control = True
bank_branch = True
elif country_number == "SA":
country = "Suudi Arabistan"
max_leng = 24
status_sepa = False
account_control = False
bank_branch = False
elif country_number == "RS":
country = "Sırbistan"
max_leng = 22
status_sepa = False
account_control = True
bank_branch = False
elif country_number == "TN":
country = "Tunus"
max_leng = 24
status_sepa = False
account_control = True
bank_branch = True
elif country_number == "UA":
country = "Ukrayna"
max_leng = 29
status_sepa = False
account_control = False
bank_branch = True
elif country_number == "VG":
country = "Virgin Adaları, İngiliz"
max_leng = 24
status_sepa = False
account_control = False
bank_branch = False
elif country_number == "GR":
country = "Yunanistan"
max_leng = 27
status_sepa = True
account_control = False
bank_branch = True
elif country_number == "CZ":
country = "Çek Cumhuriyeti"
max_leng = 24
status_sepa = True
account_control = True
bank_branch = False
elif country_number == "JO":
country = "Ürdün"
max_leng = 30
status_sepa = False
account_control = False
bank_branch = True
elif country_number == "IQ":
country = "Irak"
max_leng = 23
status_sepa = False
account_control = False
bank_branch = False
else :
country = "Not detected...!"
error_satut = True
return country , max_leng , status_sepa , account_control , bank_branch , country_number
def iban_parametres(iban_1):
global control_number_global
global bank_code_local
global rezerve_code
if country_detect(iban_1)[0] == "Turkey":
try:
control_number_global = iban_1[2] + iban_1[3]
bank_code_local = iban_1[4] + iban_1[5] + iban_1[6] + iban_1[7] + iban_1[8]
rezerve_code = iban_1[9]
account_number = iban_1[10:26]
sube_kodu = iban_1[10:14]
müşteri_nosu_raw = iban_1[13:22]
hesap_eki_kodu = iban_1[22:]
except Exception:
print(f"{Fore.RED}Eksik veri.!{Style.RESET_ALL}")
return exit(1)
if bank_code_local == "00001":
bank_name = "TC Merkez Bankası"
elif bank_code_local == "00004":
bank_name = "İller Bankası"
elif bank_code_local == "00010":
bank_name = "Ziraat Bankası"
elif bank_code_local == "00012":
bank_name = "Halkbank"
elif bank_code_local == "00015":
bank_name = "Vakıflar Bankası"
elif bank_code_local == "00017":
bank_name = "Kalkınma Bankası"
elif bank_code_local == "00029":
bank_name = "Birleşik Fon Bankası"
elif bank_code_local == "00032":
bank_name = "Türk Ekonomi Bankası"
elif bank_code_local == "00046":
bank_name = "Akbank"
elif bank_code_local == "00059":
bank_name = "Şekerbank"
elif bank_code_local == "00062":
bank_name = "Garanti Bankası"
elif bank_code_local == "00064":
bank_name = "İş Bankası"
elif bank_code_local == "00067":
bank_name = "Yapı ve Kredi Bankası"
elif bank_code_local == "00099":
bank_name = "ING Bank"
elif bank_code_local == "00100":
bank_name = "Adabank"
elif bank_code_local == "00111":
bank_name = "Finansbank"
elif bank_code_local == "00123":
bank_name = "HSBC"
elif bank_code_local == "00132":
bank_name = "Takasbank"
elif bank_code_local == "00134":
bank_name = "Denizbank"
elif bank_code_local == "00135":
bank_name = "Anadolu Bank"
elif bank_code_local == "00137":
bank_name = "Rabobank"
elif bank_code_local == "00138":
bank_name = "Dilerbank"
elif bank_code_local == "00139":
bank_name = "GSD Bank"
elif bank_code_local == "00141":
bank_name = "Nurol Yatırım Bankası"
elif bank_code_local == "00142":
bank_name = "Bankpozitif Kredi ve Kalkınma Bankası"
elif bank_code_local == "00143":
bank_name = "Aktif Yatırım Bankası"
elif bank_code_local == "00146":
bank_name = "Odea Bank"
elif bank_code_local == "00147":
bank_name = "Bank of Tokyo-Mitsubishi UFJ Turkey"
elif bank_code_local == "00203":
bank_name = "Albaraka Türk Katılım Bankası"
elif bank_code_local == "00205":
bank_name = "Kuveyt Türk Katılım Bankası"
elif bank_code_local == "00206":
bank_name = "Türkiye Finans Katılım Bankası"
elif bank_code_local == "00209":
bank_name = "Ziraat Katılım Bankası"
elif bank_code_local == "00210":
bank_name = "Vakıf Katılım Bankası"
elif bank_code_local == "00806":
bank_name = "Merkezi Kayıt Kuruluşu"
elif bank_code_local == "00109":
bank_name = "ICBC Turkey Bank"
else:
else_proc = "0"
return else_proc
#16
else:
control_number_global = "DESTEKLENMİYOR"
bank_code_local = "DESTEKLENMİYOR"
rezerve_code = "DESTEKLENMİYOR"
account_number = "DESTEKLENMİYOR"
sube_kodu = "DESTEKLENMİYOR"
müşteri_nosu_raw = "DESTEKLENMİYOR"
hesap_eki_kodu = "DESTEKLENMİYOR"
bank_name = "DESTEKLENMİYOR"
return control_number_global, bank_code_local, rezerve_code, account_number , bank_name ,sube_kodu , müşteri_nosu_raw, hesap_eki_kodu
iban = str(iban)
iban = iban.replace(" ","")
ulke = country_detect(iban)
others_data = iban_parametres(iban)
raw_iban_leng = len(iban)
standart_leng = ulke[1]
mavi = Fore.BLUE
temiz = Style.RESET_ALL
yesil = Fore.GREEN
if os.name == 'nt':
try:
os.system("clear")
except Exception:
try:
os.system("cls")
except Exception:
pass
else:
try:
os.system("clear")
except Exception:
pass
scrap_url=url=f"https://iban.gen.tr/iban-cozumleme-ve-dogrulama?kod={iban}"
try:
sorgulama=requests.get(url=scrap_url)
ayıklamanmıs_data=BeautifulSoup(sorgulama.content,"html.parser")
data_1=ayıklamanmıs_data.find(attrs={"class":"table table-bordered table-sm table-resolve-verify"})
data_1=data_1.find_all('td')
hata_durumu=False
try:
iban_il=data_1[2]
iban_ilce=data_1[1]
except Exception:
iban_il,iban_ilce=">> ALINAMADI <<"
iban_il = str(iban_il)
iban_ilce = str(iban_ilce)
iban_il = iban_il.strip('<td>')
iban_il= iban_il.strip('</td>')
iban_ilce= iban_ilce.strip('<td>')
iban_ilce = iban_ilce.strip('</td>')
except Exception:
hata_durumu=True
print(f"{mavi} >> By PRIME.{temiz}")
if raw_iban_leng == standart_leng:
if iban_parametres(iban) != 0:
print (f"{mavi}|-------------------------")
print (f"| Tam iban:{temiz}{yesil} {iban}{temiz}")
print (f"{mavi}| Ülke:{yesil} {ulke[0]}{temiz}")
print (f"{mavi}| Max iban uzunluğu:{yesil} {ulke[1]}")
print (f"{mavi}| SEPA desteği:{yesil} {ulke[2]}")
print (f"{mavi}| Hesap kontrolu:{yesil} {ulke[2]}")
print (f"{mavi}| Şube kontrolu:{yesil} {ulke[4]}")
print (f"{mavi}| Ülke kodu:{yesil} {ulke[5]}")
print (f"{mavi}| Global kontrol kodu:{yesil} {others_data[0]}")
print (f"{mavi}| Banka kodu:{yesil} {others_data[1]}")
print (f"{mavi}| Rezerv numrası:{yesil} {others_data[2]}")
print (f"{mavi}| Hesap numarası:{yesil} {others_data[3]}")
print (f"{mavi}| Banka adı:{yesil} {others_data[4]}")
print (f"{mavi}| Şube kodu:{yesil} {others_data[5]} - bankanın il/ilçe/sokak bilgisini verir")
print (f"{mavi}| müşteri numarası (saf):{yesil} {others_data[6]}")
print (f"{mavi}| Hesap ek nosu:{yesil} {others_data[7]}")
print (f"{mavi}|-------------------------{temiz}")
if hata_durumu != True and sorgulama.status_code == 200:
print (f"{mavi}| WEB sonuçları: {temiz}")
print (f"{mavi}| Kayıtlı olduğu il: {yesil}{iban_il}")
print (f"{mavi}| Kayıtlı olduğu ilçe: {yesil}{iban_ilce}")
print (f"{mavi}|-------------------------{temiz}")
else:
print(f"{mavi}| Web'den sonuçlar alınamadı...!{temiz}")
else:
print (f"{Fore.RED}İban geçersizdir...!{temiz}")
elif raw_iban_leng > standart_leng:
print (f"{Fore.RED}İban olması gerekenden uzun...!")
print (f"Bu iban geçersizdir...!{temiz}")
elif raw_iban_leng < standart_leng:
print (f"{Fore.RED}İban olması gerekenden kısa...!")
print (f"Bu iban geçersizdir...!{temiz}")
else:
print (f"{Fore.RED}Bilinmeyen hata...!{temiz}")