-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLive-Generator.py
217 lines (190 loc) · 6.96 KB
/
Live-Generator.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
#!/usr/bin/env python
#-*- coding: iso-8859-1 -*-
import getopt
import time
import os
import sys
import datetime
from random import randint
version = "1.0.0"
#Mensaje
os.system ("clear")
print("\033[1;32m+\033[1;36m LIVE-GENERATOR")
time.sleep(1.2)
#Informacion de ayuda
def dexter1999():
print("\033[1;32m ______________")
print("\033[1;32m ,===:'., `-._")
print("\033[1;32m `:.`---.__ `-._")
print("\033[1;32m `:. `--. `.")
print("\033[1;32m \. `. `.")
print("\033[1;32m (,,(, \. `. ____,-`.,")
print("\033[1;32m (,' `/ \. ,--.___`.'")
print("\033[1;32m , ,' ,--. `, \.;' `")
print("\033[1;32m `{D, { \ : \;")
print("\033[1;32m V,,' / / //")
print("\033[1;32m j;; / ,' ,-//. ,---. ,")
print("\033[1;32m \;' / ,' / _ \ / _ \ ,'/")
print("\033[1;32m \ `' / \ `' / \ `.' /")
print("\033[1;32m `.___,' `.__,' `.__,'")
dexter1999()
time.sleep(1.2)
print("")
print("\033[1;32m Informatic in Termux")
print("")
time.sleep(1.6)
print(" https://t.me/Informatic_in_Termux")
print("")
time.sleep(2.2)
#Informacion de ayuda
def usage():
print("+\033[1;37m Metodo de uso\033[1;31m +")
print("")
print("\033[1;33m python2 Live-Generator.py -b \033[1;31m >>>\033[1;33m Opciones de uso")
print("\033[1;33m python2 Live-Generator.py -h \033[1;31m >>>\033[1;33m Mensaje de ayuda")
print("")
print("+\033[;32m Opciones de uso\033[1;31m +")
print("")
print("\033[1;32m -b, \033[1;31m >>>\033[1;32m -bin\033[1;31m >>>\033[1;32m Formato de bin")
print("\033[1;32m -u, \033[1;31m >>>\033[1;32m -cantidad\033[1;31m >>>\033[1;32m tarjetas a generar")
print("\033[1;32m -c, \033[1;31m >>>\033[1;32m -ccv\033[1;31m >>>\033[1;32m Genera ccv al azar")
print("\033[1;32m -d, \033[1;31m >>>\033[1;32m -date\033[1;31m >>>\033[1;32m Genera fechas al azar")
print("")
print("+\033[;33m Ejemplo de uso\033[1;31m +")
print("")
print("\033[1;37m EL USO DE ESTA HERRAMIENTA\033[0m")
print("\033[1;37m ES RESPONSABILIDAD DE QUIEN LA UTILICE")
print("")
print("\033[1;36mpython2 Live-Generator.py -b 123456xxxxxxxxxx -u 30 -d -c ")
print("")
#Arg parser
def parseOptions(argv):
bin_format = ""
saveopt = False
limit = 30
ccv = False
date = False
check = False
try:
opts, args = getopt.getopt(argv, "h:b:u:gcd",["help", "bin", "guardar", "cantidad", "ccv", "date"])
for opt, arg in opts:
if opt in ("-h"):
usage()
sys.exit()
elif opt in ("-b", "-bin"):
bin_format = arg
elif opt in ("-g", "-guardar"):
saveopt = True
elif opt in ("u", "-cantidad"):
limit = arg
elif opt in ("-c", "-ccv"):
ccv = True
elif opt in ("-d", "-date"):
date = True
return(bin_format, saveopt, limit, ccv, date)
except getopt.GetoptError:
usage()
sys.exit(2)
#CHECKER BASADO EN ALGORITMO LUHN
def cardLuhnChecksumIsValid(card_number):
""" checks to make sure that the card passes a luhn mod-10 checksum """
sum = 0
num_digits = len(card_number)
oddeven = num_digits & 1
for count in range(0, num_digits):
digit = int(card_number[count])
if not (( count & 1 ) ^ oddeven ):
digit = digit * 2
if digit > 9:
digit = digit - 9
sum = sum + digit
return ( (sum % 10) == 0 )
#GENERA UNA BASE DE BIN XXXXXXXXXXXXXXXX
def ccgen(bin_format):
out_cc = ""
if len(bin_format) == 16:
#Iteration over the bin
for i in range(15):
if bin_format[i] in ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9"):
out_cc = out_cc + bin_format[i]
continue
elif bin_format[i] in ("x"):
out_cc = out_cc + str(randint(0,9))
else:
print("\nCaracter no valido en el formato: {}\n".format(bin_format))
print("El formato del bin es: xxxxxxxxxxxxxxxx de 16 digitos\n")
print("Ayuda: python2 Live-Generator.py -h \n")
sys.exit()
#Generate checksum (last digit) -- IMPLICIT CHECK
for i in range(10):
checksum_check = out_cc
checksum_check = checksum_check + str(i)
if cardLuhnChecksumIsValid(checksum_check):
out_cc = checksum_check
break
else:
checksum_check = out_cc
else:
print("\033[1;32m")
print("\nERROR: Inserta un bin valido\n")
print("SOLUCION: El formato del bin es: xxxxxxxxxxxxxxxx de 16 digitos\n")
print("AYUDA: python2 Live-Generator.py -h\n")
sys.exit()
return(out_cc)
#Write on a file that takes a list for the argument
def save(generated):
now = datetime.datetime.now()
file_name = "cc-gen_output_{0}.txt".format(str(now.day) + str(now.hour) + str(now.minute) + str(now.second))
f = open(file_name, 'w')
for line in generated:
f.write(line + "\n")
f.close
#Random ccv gen
def ccvgen():
ccv = ""
num = randint(10,999)
if num < 100:
ccv = "0" + str(num)
else:
ccv = str(num)
return(ccv)
#Random exp date
def dategen():
now = datetime.datetime.now()
date = ""
month = str(randint(1, 12))
current_year = str(now.year)
year = str(randint(int(current_year[-2:]) + 1, int(current_year[-2:]) + 6))
date = month + "|" + year
return date
#The main function
def main(argv):
bin_list = []
#get arg data
(bin_format, saveopt, limit, ccv, date) = parseOptions(argv)
if bin_format is not "":
for i in range(int(limit)):
if ccv and date:
bin_list.append(ccgen(bin_format) + "|" + ccvgen() + "|" + dategen())
print(bin_list[i])
elif ccv and not date:
bin_list.append(ccgen(bin_format) + "|" + ccvgen())
print(bin_list[i])
elif date and not ccv:
bin_list.append(ccgen(bin_format) + "|" + dategen())
print(bin_list[i])
elif not date and not ccv:
bin_list.append(ccgen(bin_format))
print(bin_list[i])
if not bin_list:
print("\nERROR: el bin que insertaste no es valido\n")
else:
print("\n Todas las tarjetas fueron validadas con exito ")
print("\n Pueden ser usadas satisfactoriamente")
if saveopt:
save(bin_list)
else:
usage()
sys.exit()
if __name__ == '__main__':
main(sys.argv[1:])