|
12 | 12 | from __future__ import print_function
|
13 | 13 | import re
|
14 | 14 | import sys
|
15 |
| -sys.path.append('files/') |
| 15 | +sys.path.append('files/signature-db/') |
| 16 | +import lxml |
16 | 17 | import time
|
17 | 18 | import requests
|
18 | 19 | from colors import *
|
| 20 | +urls = [] |
| 21 | +links = [] |
| 22 | +found = 0x00 |
| 23 | +from bs4 import BeautifulSoup |
| 24 | +from infodisc_signatures import EXPRESS_CARD_SIGNATURE |
| 25 | +from infodisc_signatures import VISA_MASTERCARD_SIGNATURE |
| 26 | +from infodisc_signatures import MASTERCARD_SIGNATURE, DISCOVER_CARD_SIGNATURE |
| 27 | +from infodisc_signatures import VISA_SIGNATURE, AMEX_CARD_SIGNATURE |
| 28 | +from requests.packages.urllib3.exceptions import InsecureRequestWarning |
| 29 | +requests.packages.urllib3.disable_warnings(InsecureRequestWarning) |
19 | 30 |
|
20 | 31 | def credit0x00(url):
|
21 | 32 |
|
22 |
| - print(R+'\n ========================') |
23 |
| - print(R+' CREDIT CARD DISCLOSURE') |
24 |
| - print(R+' ========================\n') |
| 33 | + print(G+' [+] Importing credit card signatures...') |
| 34 | + time.sleep(0.5) |
| 35 | + links = [url] |
| 36 | + po = url.split('//')[1] |
| 37 | + for w in links: |
| 38 | + print(GR+' [*] Scraping Page: '+O+url) |
| 39 | + req = requests.get(w).text |
| 40 | + check0x00(req) |
| 41 | + |
| 42 | + soup = BeautifulSoup(req,'lxml') |
| 43 | + for line in soup.find_all('a', href=True): |
| 44 | + newline = line['href'] |
| 45 | + try: |
| 46 | + if newline[:4] == "http": |
| 47 | + if po in newline: |
| 48 | + urls.append(str(newline)) |
| 49 | + elif newline[:1] == "/": |
| 50 | + combline = url+newline |
| 51 | + urls.append(str(combline)) |
| 52 | + except: |
| 53 | + print(R+' [-] Unhandled Exception Occured!') |
| 54 | + |
| 55 | + try: |
| 56 | + for uurl in urls: |
| 57 | + print(G+"\n [+] Scraping Page: "+O+uurl) |
| 58 | + req = requests.get(uurl).text |
| 59 | + check0x00(req) |
| 60 | + |
| 61 | + except requests.exceptions: |
| 62 | + print(R+' [-] Outbound Query Exception...') |
| 63 | + |
| 64 | + if found == 0x00: |
| 65 | + print(R+' [-] No Credit Cards found disclosed in plaintext in source code!') |
| 66 | + |
| 67 | + print(G+' [+] Scraping Done!') |
25 | 68 |
|
26 |
| - print(O+' [*] Making the request...') |
27 |
| - req = requests.get(url, verify=False) |
28 |
| - req_read = str(req).split() |
29 |
| - print(GR+' [*] Reading response...') |
30 |
| - time.sleep(1) |
31 |
| - append_name = str("".join(req_read)) |
32 |
| - AMEX = re.match(r"^3[47][0-9]{13}$", append_name) |
33 |
| - VISA = re.match(r"^4[0-9]{12}(?:[0-9]{3})?$", append_name) |
34 |
| - MASTERCARD = re.match(r'^(?:5[1-5][0-9]{2}|222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$', append_name) |
35 |
| - DISCOVER = re.match(r"^6(?:011|5[0-9]{2})[0-9]{12}$", append_name) |
36 |
| - EXPRESS = re.match(r'^[34|37][0-9]{14}$', append_name) |
37 |
| - VISA_MASTERCARD = re.match(r'^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14})$', append_name) |
| 69 | + |
| 70 | +def check0x00(req): |
| 71 | + |
| 72 | + try: |
| 73 | + append_name = ' '.join(req.encode('utf-8')).strip() |
| 74 | + except UnicodeDecodeError: |
| 75 | + append_name = ' '.join(req.decode('utf-8')).strip() |
| 76 | + print(O+' [!] Reading response...') |
| 77 | + print(GR+' [*] Searching for credit cards...') |
| 78 | + AMEX = re.match(AMEX_CARD_SIGNATURE, append_name) |
| 79 | + VISA = re.match(VISA_SIGNATURE, append_name) |
| 80 | + MASTERCARD = re.match(MASTERCARD_SIGNATURE, append_name) |
| 81 | + DISCOVER = re.match(DISCOVER_CARD_SIGNATURE, append_name) |
| 82 | + EXPRESS = re.match(EXPRESS_CARD_SIGNATURE, append_name) |
| 83 | + VISA_MASTERCARD = re.match(VISA_MASTERCARD_SIGNATURE, append_name) |
| 84 | + print(O+' [!] Matching signatures...') |
38 | 85 |
|
39 | 86 | try:
|
40 |
| - print(GR+' [*] Trying to find out existing American Express Cards...') |
41 |
| - time.sleep(1) |
42 | 87 | if EXPRESS.group():
|
43 | 88 | print(G+" [+] Website has American Express Cards!")
|
44 | 89 | print(O+' [!] Card : ' + GR+EXPRESS.group())
|
| 90 | + found = 0x01 |
45 | 91 |
|
46 | 92 | except:
|
47 |
| - print(R+" [-] No American Express Cards found!") |
| 93 | + pass |
48 | 94 |
|
49 | 95 | try:
|
50 |
| - print(GR+' [*] Trying to find out existing Visa-Master Cards...') |
51 |
| - time.sleep(1) |
52 | 96 | if VISA_MASTERCARD.group():
|
53 | 97 | print(G+" [+] Website has a Visa-Master Card!")
|
54 | 98 | print(O+' [!] Card : ' + GR+VISA_MASTERCARD.group())
|
| 99 | + found = 0x01 |
55 | 100 |
|
56 | 101 | except:
|
57 |
| - print(R+" [-] No Visa-MasterCard found!") |
| 102 | + pass |
58 | 103 |
|
59 | 104 | try:
|
60 |
| - print(GR+' [*] Trying to find out existing MasterCards...') |
61 |
| - time.sleep(1) |
62 | 105 | if MASTERCARD.group():
|
63 | 106 | print(G+" [+] Website has a Master Card!")
|
64 | 107 | print(O+' [!] Card : ' + GR+MASTERCARD.group())
|
| 108 | + found = 0x01 |
65 | 109 |
|
66 | 110 | except:
|
67 |
| - print(R+" [-] No MasterCard found!") |
| 111 | + pass |
68 | 112 |
|
69 | 113 | try:
|
70 |
| - print(GR+' [*] Trying to find out existing VISA credit cards...') |
71 |
| - time.sleep(1) |
72 | 114 | if VISA.group():
|
73 | 115 | print(G+" [+] Website has a VISA card!")
|
74 | 116 | print(O+' [!] Card : ' + GR+VISA.group())
|
| 117 | + found = 0x01 |
75 | 118 |
|
76 | 119 | except:
|
77 |
| - print(R+" [-] No VISA Cards found!") |
| 120 | + pass |
78 | 121 |
|
79 | 122 | try:
|
80 |
| - print(GR+' [*] Trying to find out existing AMEX Cards...') |
81 |
| - time.sleep(1) |
82 | 123 | if AMEX.group():
|
83 | 124 | print(G+" [+] Website has a AMEX card!")
|
84 | 125 | print(O+' [!] Card : ' + GR+AMEX.group())
|
| 126 | + found = 0x01 |
85 | 127 |
|
86 | 128 | except:
|
87 |
| - print(R+" [-] No Amex Cards found!") |
| 129 | + pass |
88 | 130 |
|
89 | 131 | try:
|
90 |
| - print(GR+' [*] Trying to find out existing Discover Cards...') |
91 |
| - time.sleep(1) |
92 | 132 | if DISCOVER.group():
|
93 | 133 | print(G+" [+] Website has a DISCOVER card!")
|
94 | 134 | print(O+' [!] Card : ' + GR+DISCOVER.group())
|
| 135 | + found = 0x01 |
95 | 136 |
|
96 | 137 | except:
|
97 |
| - print(R+" [-] No Discover Cards found!") |
| 138 | + pass |
98 | 139 |
|
99 | 140 | def credit(web):
|
100 | 141 |
|
101 |
| - print(GR+' [*] Initiating module...') |
102 |
| - time.sleep(0.5) |
103 |
| - credit0x00(web) |
104 |
| - |
| 142 | + print(GR+' [*] Initiating module...') |
| 143 | + time.sleep(0.5) |
| 144 | + print(R+'\n ========================') |
| 145 | + print(R+' CREDIT CARD DISCLOSURE') |
| 146 | + print(R+' ========================\n') |
| 147 | + credit0x00(web) |
| 148 | + |
0 commit comments