forked from Mebus/cupp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cupp.py
executable file
·2203 lines (1789 loc) · 66.1 KB
/
cupp.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
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
############# CURRENTLY JUST A BACKUP
############# NOT WORKING DUE TO LITS / DICT PROBLEM WITH TUPLE AND STRING
############# MANY IMPROVEMENTS AND FIXINGS TO LAST VERSION
############# PROGRESS IN WORK
############ HELP ME IF YOU`d LIKE :)
#!/usr/bin/python
#
# [Program]
#
# CUPP 3.1
# Common User Passwords Profiler
#
#
#
# [Author]
#
# Muris Kurgas aka j0rgan
# j0rgan [at] remote-exploit [dot] org
# http://www.remote-exploit.org
# http://www.azuzi.me
#
# [Editor of 3.1]
#
# Christian Schwendemann
# Arrow ECS Internet Security AG
#
# [License]
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See 'docs/LICENSE' for more information.
import sys
import os
import ftplib
import ConfigParser
import urllib
import gzip
import csv
import itertools # ATTENTION! REQUIRES PYTHON 2.6 OR HIGHER !!!!!!!!!!! Used for better mixing of arrays
from collections import OrderedDict
pathtocfg = ['']
# IF CUPP IS NOT RUNNING, IT WILL BE BECAUSE OF THE MISSING CONFIG FILE.
# IF YOU ARE RUNNING CUPP ON WINDOWS, IT SHOULD GET THE PATH BY ITSELF
# HOWEVER YOU CAN DEFINE THE PATH IN THE VARIABLE ABOVE.
#
# FOR WINDOWS YOU SHOULD NOT TYPE THE LAST \ (C:\cupp and not C:\cupp\)
if os.name == 'nt':
pathtocfg = os.path.dirname(os.path.realpath(__file__))
pathtocfg = pathtocfg+chr(92)
# Reading configuration file...
config = ConfigParser.ConfigParser()
config.read(pathtocfg+'cupp.cfg')
years = []
years.append(config.get('years', 'years').split(','))
#years = config.get('years', 'years').split(',')
chars = []
chars.append(config.get('specialchars', 'chars').split(','))
#chars = config.get('specialchars', 'chars').split(',')
numfrom = config.getint('nums','from')
numto = config.getint('nums','to')
wcfrom = config.getint('nums','wcfrom')
wcto = config.getint('nums','wcto')
threshold = config.getint('nums','threshold')
unique_lista = ['']
unique_list = ['']
# 1337 mode configs, well you can add more lines if you add it to config file too.
# You will need to add more lines in two places in cupp.py code as well...
a = config.get('leet','a')
i = config.get('leet','i')
e = config.get('leet','e')
t = config.get('leet','t')
o = config.get('leet','o')
s = config.get('leet','s')
g = config.get('leet','g')
z = config.get('leet','z')
# for concatenations...
def concats(seq, start, stop):
for mystr in seq:
for num in xrange(start, stop):
yield mystr + str(num)
# for sorting and making combinations...
def komb(seq, start):
for mystr in seq:
for mystr1 in start:
yield mystr + mystr1
if len(sys.argv) < 2 or sys.argv[1] == '-h':
print " ___________ "
print " \033[07m cupp.py! \033[27m # Common"
print " \ # User"
print " \ \033[1;31m,__,\033[1;m # Passwords"
print " \ \033[1;31m(\033[1;moo\033[1;31m)____\033[1;m # Profiler"
print " \033[1;31m(__) )\ \033[1;m "
print " \033[1;31m ||--|| \033[1;m\033[05m*\033[25m\033[1;m [ Muris Kurgas | [email protected] ]\r\n\r\n"
print " [ Options ]\r\n"
print " -h You are looking at it baby! :)"
print " For more help take a look in docs/README"
print " Global configuration file is cupp.cfg\n"
print " -i Interactive questions for user password profiling\r\n"
print " -w Use this option to improve existing dictionary,"
print " or WyD.pl output to make some pwnsauce\r\n"
print " -l Download huge wordlists from repository\r\n"
print " -a Parse default usernames and passwords directly from Alecto DB."
print " Project Alecto uses purified databases of Phenoelit and CIRT"
print " which where merged and enhanced.\r\n"
print " -v Version of the program\r\n"
exit()
elif sys.argv[1] == '-v':
print "\r\n \033[1;31m[ cupp.py ] v3.0\033[1;m\r\n"
print " * Hacked up by j0rgan - [email protected]"
print " * http://www.remote-exploit.org\r\n"
print " Take a look docs/README file for more info about the program\r\n"
exit()
elif sys.argv[1] == '-w':
if len(sys.argv) < 3:
print "\r\n[Usage]: "+sys.argv[0]+" -w [FILENAME]\r\n"
exit()
fajl = open(sys.argv[2], "r")
listic = fajl.readlines()
linije = 0
for line in listic:
linije += 1
listica = []
for x in listic:
listica += x.split()
print "\r\n *************************************************"
print " * \033[1;31mWARNING!!!\033[1;m *"
print " * Using large wordlists in some *"
print " * options bellow is NOT recommended! *"
print " *************************************************\r\n"
conts = raw_input("> Do you want to concatenate all words from wordlist? Y/[N]: ").lower()
if conts == "y" and linije > threshold:
print "\r\n[-] Maximum number of words for concatenation is "+str(threshold)
print "[-] Check configuration file for increasing this number.\r\n"
conts = raw_input("> Do you want to concatenate all words from wordlist? Y/[N]: ").lower()
conts = conts
cont = ['']
if conts == "y":
for cont1 in listica:
for cont2 in listica:
if listica.index(cont1) != listica.index(cont2):
cont.append(cont1+cont2)
spechars = ['']
spechars1 = raw_input("> Do you want to add special chars at the end of words? Y/[N]: ").lower()
if spechars1 == "y":
for spec1 in chars:
spechars.append(spec1)
for spec2 in chars:
spechars.append(spec1+spec2)
for spec3 in chars:
spechars.append(spec1+spec2+spec3)
randnum = raw_input("> Do you want to add some random numbers at the end of words? Y/[N]").lower()
leetmode = raw_input("> Leet mode? (i.e. leet = 1337) Y/[N]: ").lower()
kombinacija1 = list(komb(listica, years))
kombinacija2 = ['']
if conts == "y":
kombinacija2 = list(komb(cont, years))
kombinacija3 = ['']
kombinacija4 = ['']
if spechars1 == "y":
kombinacija3 = list(komb(listica, spechars))
if conts == "y":
kombinacija4 = list(komb(cont, spechars))
kombinacija5 = ['']
kombinacija6 = ['']
if randnum == "y":
kombinacija5 = list(concats(listica, numfrom, numto))
if conts == "y":
kombinacija6 = list(concats(cont, numfrom, numto))
print "\r\n[+] Now making a dictionary..."
komb_unique1 = dict.fromkeys(kombinacija1).keys()
komb_unique2 = dict.fromkeys(kombinacija2).keys()
komb_unique3 = dict.fromkeys(kombinacija3).keys()
komb_unique4 = dict.fromkeys(kombinacija4).keys()
komb_unique5 = dict.fromkeys(kombinacija5).keys()
komb_unique6 = dict.fromkeys(kombinacija6).keys()
komb_unique7 = dict.fromkeys(listica).keys()
komb_unique8 = dict.fromkeys(cont).keys()
uniqlist = komb_unique1+komb_unique2+komb_unique3+komb_unique4+komb_unique5+komb_unique6+komb_unique7+komb_unique8
unique_lista = dict.fromkeys(uniqlist).keys()
unique_leet = []
if leetmode == "y":
for x in unique_lista: # if you want to add more leet chars, you will need to add more lines in cupp.cfg too...
x = x.replace('a',a)
x = x.replace('i',i)
x = x.replace('e',e)
x = x.replace('t',t)
x = x.replace('o',o)
x = x.replace('s',s)
x = x.replace('g',g)
x = x.replace('z',z)
unique_leet.append(x)
unique_list = unique_lista + unique_leet
unique_list_finished = []
for x in unique_list:
if len(x) > wcfrom and len(x) < wcto:
unique_list_finished.append(x)
f = open ( sys.argv[2]+'.cupp.txt', 'w' )
unique_list_finished.sort()
f.write (os.linesep.join(unique_list_finished))
f = open ( sys.argv[2]+'.cupp.txt', 'r' )
lines = 0
for line in f:
lines += 1
f.close()
print "[+] Saving dictionary to \033[1;31m"+sys.argv[2]+".cupp.txt\033[1;m, counting \033[1;31m"+str(lines)+" words.\033[1;m"
print "[+] Now load your pistolero with \033[1;31m"+sys.argv[2]+".cupp.txt\033[1;m and shoot! Good luck!"
fajl.close()
exit()
elif sys.argv[1] == '-i':
if os.name == 'nt':
os.system('cls') #for window
if os.name <>'nt':
os.system('clear') #for Linux
print "\r\n \r\n"
print " +++ Welcome to CUPP 3.1 - Common User Password Profiler +++"
print "\r\n"
print " After this introduction you will be asked for personal details of your target."
print " Informations you are not aware of, you can skip by just pressing Enter."
print " The more informations you provide, the better your resulting dictionary will get."
print "\r\n"
print " To give you a feeling about the numbers: "
print " Full informations on target and partner/friend of target will give you"
print " about 30.000 lines / combinations, if you don't set any other options."
print "\r\n"
print " The same informations, but with numbers at the end and one special character"
print " at the end, will already create around 60.000 entries to your resulting wordlist."
print "\r\n"
print ""
# We need some informations first!
print "Lets start with the basic informations:"
print "----------------------------------------"
print "\r\n"
name = raw_input("> First Name: ").lower()
while len(name) == 0 or name == " " or name == " " or name == " ":
print "\r\n[-] You must enter a name at least!"
name = raw_input("> Name: ").lower()
name = str(name)
surname = raw_input("> Last Name: ").lower()
nick = raw_input("> Nickname: ").lower()
birthdate = raw_input("> Birthdate (DDMMYYYY): ")
while len(birthdate) != 0 and len(birthdate) != 8:
print "\r\n[-] You must enter 8 digits for birthday!"
birthdate = raw_input("> Birthdate (DDMMYYYY): ")
birthdate = str(birthdate)
print "\r\n"
wife = raw_input("> Partners First Name: ").lower()
wifen = raw_input("> Partners Nickname: ").lower()
wifeb = raw_input("> Partners Birthdate (DDMMYYYY): ")
while len(wifeb) != 0 and len(wifeb) != 8:
print "\r\n[-] You must enter 8 digits for birthday!"
wifeb = raw_input("> Partners birthdate (DDMMYYYY): ")
wifeb = str(wifeb)
print "\r\n"
kid = raw_input("> Child's name: ").lower()
kidn = raw_input("> Child's nickname: ").lower()
kidb = raw_input("> Child's Birthdate (DDMMYYYY): ")
while len(kidb) != 0 and len(kidb) != 8:
print "\r\n[-] You must enter 8 digits for birthday!"
kidb = raw_input("> Child's birthdate (DDMMYYYY): ")
kidb = str(kidb)
print "\r\n"
kid2 = raw_input("> 2nd Child's name: ").lower()
kid2n = raw_input("> 2nd Child's nickname: ").lower()
kid2b = raw_input("> 2nd Child's birthdate (DDMMYYYY): ")
while len(kid2b) != 0 and len(kidb) != 8:
print "\r\n[-] You must enter 8 digits for birthday!"
kid2b = raw_input("> 2nd Child's birthdate (DDMMYYYY): ")
kid2b = str(kid2b)
# Extra Info
print "\r\n"
print "\r\n"
print "Now lets feed some extra informations:"
print "---------------------------------------"
print "\r\n"
pet = raw_input("> Pet's name: ").lower()
licplt = raw_input("> License Plate of victims car: ").lower()
licplt2 = raw_input("> License Plate 2nd car: ").lower()
company = raw_input("> Company name: ").lower()
print "\r\n"
print "> Do you want to define keywords? (e.g. hobbies, town,..)"
words1 = raw_input("> Keywords will be mixed with other provided details Y/[N]: ").lower()
words = ['']
words2 = ""
if words1 == "y":
words2 = raw_input("> Please enter the words, separated by comma. [i.e. tennis,canada,mets,chevy], spaces will be removed: ").replace(" ","")
words = words2.split(",")
print "\r\n"
# Final Adjustments
print "Ok, lets do some tuning and adjustments for your dictionary now:"
print "-----------------------------------------------------------------"
print "\r\n"
askreverse = raw_input("> Do you want to add reversed names? (e.g. Christian = naitsirhC) Y/[N]: ").lower()
randnum = raw_input("> Do you want a set with numbers at the end? (e.g. Daniela22) Y/[N]: " ).lower() # see config file - default 0-100
specharsF = ['']
specharsF1 = raw_input("> Do you want a set with special chars in front (e.g. !Chris) Y/[N]: ").lower()
if specharsF1 == "y":
specharsF1wasno = "n"
howmany = raw_input("> How many special chars maximum (1-3): ")
while howmany > "3":
print "\r\n[-] You must enter a value between 1 and 3"
howmany = raw_input("> How many special chars maximum (1-3): ")
for specF1 in chars:
specharsF.append(specF1)
if howmany >= "2":
for specF2 in chars:
specharsF.append(specF1+specF2)
if howmany == "3":
for specF3 in chars:
specharsF.append(specF1+specF2+specF3)
spechars = ['']
howmany = ['']
specharswasno = ['']
specharsF1wasno = ['']
spechars1 = raw_input("> Do you want a set with special chars at the end? (e.g. Lucy!) Y/[N]: ").lower()
if spechars1 == "y":
specharswasno = "n"
howmany = raw_input("> How many special chars maximum (1-3): ")
while howmany > "3":
print "\r\n[-] You must enter a value between 1 and 3"
howmany = raw_input("> How many special chars maximum (1-3): ")
for spec1 in chars:
spechars.append(spec1)
if howmany >= "2":
for spec2 in chars:
spechars.append(spec1+spec2)
if howmany == "3":
for spec3 in chars:
spechars.append(spec1+spec2+spec3)
spechars2 = ['']
spechars2 = raw_input("> Do you want to set special chars in the front and end (e.g. !Chevy!) Y/[N]: ").lower()
if spechars2 == "y":
if specharsF1 <> "y":
specharsF1wasno = "y"
howmany = raw_input("> How many special chars in the front maximum (1-3): ")
while howmany > "3":
print "\r\n[-] You must enter a value between 1 and 3"
howmany = raw_input("> How many special chars maximum (1-3): ")
for specF1 in chars:
specharsF.append(specF1)
if howmany >= "2":
for specF2 in chars:
specharsF.append(specF1+specF2)
if howmany == "3":
for specF3 in chars:
specharsF.append(specF1+specF2+specF3)
if spechars1 <> "y":
specharswasno = "y"
howmany = raw_input("> How many special chars at the end maximum (1-3): ")
while howmany > "3":
print "\r\n[-] You must enter a value between 1 and 3"
howmany = raw_input("> How many special chars maximum (1-3): ")
for spec1 in chars:
spechars.append(spec1)
if howmany >= "2":
for spec2 in chars:
spechars.append(spec1+spec2)
if howmany == "3":
for spec3 in chars:
spechars.append(spec1+spec2+spec3)
#
securechars = ['']
securechars = raw_input("> Do you want a set extra secure 4-value combinations (e.g. Christian92Marina89) Attention: adds up to 300.000, extra combinations depending on iputs! Y/[N]: ").lower()
leetmode = raw_input("> Leet mode? (i.e. leet = 1337) Y/[N]: ").lower()
print "\r\n[+] Ok hold on a few seconds. Creating your dictionary.."
# Now me must do some string modifications for later combination-sets
# Birthdays first
# Please note: Not all of these combinations are active in the current version.
# If you would like to use them, take a look below, where we start to create combinations (search for bds)
birthdate_yy = birthdate[-2:]
birthdate_yyy = birthdate[-3:]
birthdate_yyyy = birthdate[-4:]
birthdate_xd = birthdate[1:2]
birthdate_xm = birthdate[3:4]
birthdate_dd = birthdate[:2]
birthdate_mm = birthdate[2:4]
wifeb_yy = wifeb[-2:]
wifeb_yyy = wifeb[-3:]
wifeb_yyyy = wifeb[-4:]
wifeb_xd = wifeb[1:2]
wifeb_xm = wifeb[3:4]
wifeb_dd = wifeb[:2]
wifeb_mm = wifeb[2:4]
kidb_yy = kidb[-2:]
kidb_yyy = kidb[-3:]
kidb_yyyy = kidb[-4:]
kidb_xd = kidb[1:2]
kidb_xm = kidb[3:4]
kidb_dd = kidb[:2]
kidb_mm = kidb[2:4]
kid2b_yy = kid2b[-2:]
kid2b_yyy = kid2b[-3:]
kid2b_yyyy = kid2b[-4:]
kid2b_xd = kid2b[1:2]
kid2b_xm = kid2b[3:4]
kid2b_dd = kid2b[:2]
kid2b_mm = kid2b[2:4]
# Convert first letters to uppercase...
nameup = name.title()
surnameup = surname.title()
nickup = nick.title()
wifeup = wife.title()
wifenup = wifen.title()
kidup = kid.title()
kidnup = kidn.title()
kid2up = kid.title()
kid2nup = kidn.title()
petup = pet.title()
companyup = company.title()
# Handling of the keywords, if given
wordsup = []
word = []
for words1 in words:
wordsup.append(words1.title())
word.append(words+wordsup)
# Convert to capital letters
surnamecapital = surname.upper()
namecapital = name.upper()
# initials of names processing
surinit = surname[:1] #1 characters of last name
surinitup = surinit.title()
nameinit = name[:1] #1 character of first name
nameinitup = nameinit.title()
# reverse a name
rev_name = name[::-1]
rev_nameup = nameup[::-1]
rev_nick = nick[::-1]
rev_nickup = nickup[::-1]
rev_wife = wife[::-1]
rev_wifeup = wifeup[::-1]
rev_kid = kid[::-1]
rev_kidup = kidup[::-1]
rev_kid2 = kid[::-1]
rev_kid2up = kidup[::-1]
reverse = [rev_name, rev_nameup, rev_nick, rev_nickup, rev_wife, rev_wifeup, rev_kid, rev_kidup, rev_kid2, rev_kid2up]
rev_n = [rev_name, rev_nameup, rev_nick, rev_nickup]
rev_w = [rev_wife, rev_wifeup]
rev_k = [rev_kid, rev_kidup]
# Let's do some serious work! This will be a mess of code, but... who cares? :)
# Birthdays combinations
bds = [birthdate_yy, birthdate_yyy, birthdate_yyyy, birthdate_xd, birthdate_xm, birthdate_dd, birthdate_mm]
# New version of CUPP doesnt care for strange YYYxD or xDxMYY combinations like 1991 06 15 = 1916, if you want to reactivate just add it in the line above again.
# Scroll up to birthday modifications to get the variable you are looking for, to add it in the bds = [] field above
bdss = []
for kombina1 in xrange(0,len(bds)+1):
bdss.append(list(itertools.combinations(bds,kombina1)))
# For a woman aka partner
wbds = [wifeb_yy, wifeb_yyyy, wifeb_dd, wifeb_mm]
wbdss = []
for kombina1 in xrange(0,len(wbds)+1):
wbdss.append(list(itertools.combinations(wbds,kombina1)))
# and a child...
kbds = [kidb_yy, kidb_yyyy, kidb_dd, kidb_mm]
kbdss = []
for kombina1 in xrange(0,len(kbds)+1):
kbdss.append(list(itertools.combinations(kbds,kombina1)))
# and a 2nd child...
kbds2 = [kid2b_yy, kid2b_yyyy, kid2b_dd, kid2b_mm]
kbdss2 = []
for kombina1 in xrange(0,len(kbds2)+1):
kbdss2.append(list(itertools.combinations(kbds2,kombina1)))
fambds = [birthdate_yy, birthdate_yyyy, birthdate_dd, birthdate_mm, wifeb_yy, wifeb_yyyy, wifeb_dd, wifeb_mm, kidb_yy, kidb_yyyy, kidb_dd, kidb_mm, kid2b_yy, kid2b_yyyy, kid2b_dd, kid2b_mm]
# in the new version of CUPP we now take some care for combinations of birthdates of the whole family
# if you want to deactivate just set fambds = to []
fambdss = []
for kombina1 in xrange(0,len(fambds)+1):
fambdss.append(list(itertools.combinations(fambds,kombina1)))
###############################
# LETS START THE MIXING MAGIC #
###############################
# TO DO / WORK / PETS / LICENSE PLATE
kombinaac = [pet, petup, company, companyup]
kombinaacs = []
for kombina1 in xrange(0,len(kombinaac)+1):
kombinaacs.append(list(itertools.combinations(kombinaac,kombina1)))
# BASIC COMBINATIONS FOR FURTHER MIXING
# *************************************
# Basic combination of main targets basic info - dont add birthday here, will be combined later
kombina = [name, nameinitup, namecapital, nickup, surinitup, nameinit, surname, nick, nameup, surnameup, surinit]
kombinaa = []
for kombina1 in xrange(0,len(kombina)+1):
kombinaa.append(list(itertools.combinations(kombina,kombina1)))
# Basic combinations of wife / partner with modded lastname of target
kombinaw = [wife, wifen, wifeup, wifenup, surname, surnameup, surinit, surinitup, surnamecapital]
kombinaaw = []
for kombina1 in xrange(0,len(kombinaw)+1):
kombinaaw.append(list(itertools.combinations(kombinaw,kombina1)))
# Basic combinations of the kid
kombinak = [kid, kidn, kidup, kidnup, surname, surnameup, surnamecapital, surinit, surinitup]
kombinaak = []
for kombina1 in xrange(0,len(kombinak)+1):
kombinaak.append(list(itertools.combinations(kombinak,kombina1)))
# Basic combinations of the family
kombinaf = [name, nick, surname, surinit, nickup, surnameup, nameup, surinitup, nameinit, nameinitup, namecapital, surnamecapital, wifeup, wife, kid, kidup]
kombinaaf = []
for kombina1 in xrange(0,len(kombinaf)+1):
kombinaaf.append(list(itertools.combinations(kombinaf,kombina1)))
# Secure Combinations. Will be combined with special chars later.
kombinasec = [name, birthdate_yy, nick, nickup, nameup, wifen, wifeup, wifenup, wifeb_yy, kidn, kidnup, kidb_yy, nameinit, nameinitup, surnamecapital, surinit, surinitup, namecapital]
kombaasec = []
if securechars == "y":
for kombina1 in xrange(0,len(kombinasec)+1):
kombaasec.append(list(itertools.combinations(kombinasec,kombina1)))
# COMBINING THE BASICS FOR FINAL RESULTS
# **************************************
komb1 = list(komb(kombinaa, bdss))
komb2 = list(komb(kombinaaw, wbdss))
komb3 = list(komb(kombinaak, kbdss))
komb4 = list(komb(kombinaa, years))
komb5 = list(komb(kombinaacs, years))
komb6 = list(komb(kombinaaw, years))
komb7 = list(komb(kombinaak, years))
komb8 = list(komb(word, bdss))
komb9 = list(komb(word, wbdss))
komb10 = list(komb(word, kbdss))
komb11 = list(komb(word, years))
komb12 = ['']
komb13 = ['']
komb14 = ['']
komb15 = ['']
komb16 = ['']
komb17 = ['']
komb18 = ['']
komb19 = ['']
komb20 = ['']
komb21 = ['']
komb22 = list(komb(kombinaaf, fambdss))
komb23 = ['']
komb24 = ['']
komb25 = ['']
komb26 = ['']
komb27 = ['']
komb28 = ['']
if securechars == "y":
komb23 = list(komb(fambds, kombaasec))
komb24 = list(komb(kombaasec, fambds))
komb25 = list(komb(fambds, komb24))
if randnum == "y":
komb12 = list(concats(word, numfrom, numto))
komb13 = list(concats(kombinaa, numfrom, numto))
komb14 = list(concats(kombinaacs, numfrom, numto))
komb15 = list(concats(kombinaaw, numfrom, numto))
komb16 = list(concats(kombinaak, numfrom, numto))
komb26 = list(concats(kombaasec, numfrom, numto))
komb27 = list(concats(kombinaaf, numfrom, numto))
if askreverse == "y":
komb21 = list(concats(reverse, numfrom, numto))
komb17 = list(komb(reverse, years))
komb18 = list(komb(rev_w, wbdss))
komb19 = list(komb(rev_k, kbdss))
komb20 = list(komb(rev_n, bdss))
komb001 = ['']
komb002 = ['']
komb003 = ['']
komb004 = ['']
komb005 = ['']
komb006 = ['']
komb007 = ['']
komb008 = ['']
komb009 = ['']
komb010 = ['']
komb011 = ['']
komb012 = ['']
komb013 = ['']
komb014 = ['']
komb015 = ['']
komb016 = ['']
komb017 = ['']
komb018 = ['']
komb019 = ['']
komb020 = ['']
komb021 = ['']
komb022 = ['']
komb023 = ['']
komb024 = ['']
komb025 = ['']
komb026 = ['']
komb027 = ['']
komb028 = ['']
komb029 = ['']
komb030 = ['']
komb031 = ['']
if spechars1 == "y":
komb001 = list(komb(kombinaa, spechars))
komb002 = list(komb(kombinaacs, spechars))
komb003 = list(komb(kombinaaw , spechars))
komb004 = list(komb(kombinaak , spechars))
komb005 = list(komb(word, spechars))
if askreverse == "y":
komb006 = list(komb(reverse, spechars))
komb007 = list(komb(kombinaaf, spechars))
komb022 = list(komb(kombaasec, spechars))
if specharsF1 == "y":
komb008 = list(komb(specharsF, kombinaa))
komb009 = list(komb(specharsF, kombinaacs))
komb010 = list(komb(specharsF, kombinaaw))
komb011 = list(komb(specharsF, kombinaak))
komb012 = list(komb(specharsF, word))
if askreverse == "y":
komb013 = list(komb(specharsF, reverse))
komb014 = list(komb(specharsF, kombinaaf))
komb023 = list(komb(specharsF, kombaasec))
if spechars2 == "y":
komb015 = list(komb(komb008, spechars))
komb016 = list(komb(komb009, spechars))
komb017 = list(komb(komb010, spechars))
komb018 = list(komb(komb011, spechars))
komb019 = list(komb(komb012, spechars))
if askreverse == "y":
komb020 = list(komb(komb013, spechars))
komb021 = list(komb(komb014, spechars))
komb024 = list(komb(komb022, spechars))
komb_unique1 = dict.fromkeys(komb1).keys()
komb_unique2 = dict.fromkeys(komb2).keys()
komb_unique3 = dict.fromkeys(komb3).keys()
komb_unique4 = dict.fromkeys(komb4).keys()
komb_unique5 = dict.fromkeys(komb5).keys()
komb_unique6 = dict.fromkeys(komb6).keys()
komb_unique7 = dict.fromkeys(komb7).keys()
komb_unique8 = dict.fromkeys(komb8).keys()
komb_unique9 = dict.fromkeys(komb9).keys()
komb_unique10 = dict.fromkeys(komb10).keys()
komb_unique11 = dict.fromkeys(komb11).keys()
komb_unique12 = dict.fromkeys(komb12).keys()
komb_unique13 = dict.fromkeys(komb13).keys()
komb_unique14 = dict.fromkeys(komb14).keys()
komb_unique15 = dict.fromkeys(komb15).keys()
komb_unique16 = dict.fromkeys(komb16).keys()
komb_unique17 = dict.fromkeys(komb17).keys()
komb_unique18 = dict.fromkeys(komb18).keys()
komb_unique19 = dict.fromkeys(komb19).keys()
komb_unique20 = dict.fromkeys(komb20).keys()
komb_unique21 = dict.fromkeys(komb21).keys()
komb_unique22 = dict.fromkeys(komb22).keys()
komb_unique23 = dict.fromkeys(komb23).keys()
komb_unique24 = dict.fromkeys(komb24).keys()
komb_unique25 = dict.fromkeys(komb25).keys()
komb_unique26 = dict.fromkeys(komb26).keys()
komb_unique27 = dict.fromkeys(komb27).keys()
komb_unique01 = dict.fromkeys(kombinaa).keys()
komb_unique02 = dict.fromkeys(kombinaacs).keys()
komb_unique03 = dict.fromkeys(kombinaaw).keys()
komb_unique04 = dict.fromkeys(kombinaak).keys()
komb_unique05 = dict.fromkeys(word).keys()
komb_unique07 = dict.fromkeys(komb001).keys()
komb_unique08 = dict.fromkeys(komb002).keys()
komb_unique09 = dict.fromkeys(komb003).keys()
komb_unique010 = dict.fromkeys(komb004).keys()
komb_unique011 = dict.fromkeys(komb005).keys()
komb_unique012 = dict.fromkeys(komb006).keys()
komb_unique013 = dict.fromkeys(komb007).keys()
komb_unique014 = dict.fromkeys(komb008).keys()
komb_unique015 = dict.fromkeys(komb009).keys()
komb_unique016 = dict.fromkeys(komb010).keys()
komb_unique017 = dict.fromkeys(komb011).keys()
komb_unique018 = dict.fromkeys(komb012).keys()
komb_unique019 = dict.fromkeys(komb013).keys()
komb_unique020 = dict.fromkeys(komb014).keys()
komb_unique021 = dict.fromkeys(komb015).keys()
komb_unique022 = dict.fromkeys(komb016).keys()
komb_unique023 = dict.fromkeys(komb017).keys()
komb_unique024 = dict.fromkeys(komb018).keys()
komb_unique025 = dict.fromkeys(komb019).keys()
komb_unique026 = dict.fromkeys(komb020).keys()
komb_unique027 = dict.fromkeys(komb021).keys()
komb_unique028 = dict.fromkeys(komb022).keys()
komb_unique029 = dict.fromkeys(komb023).keys()
komb_unique030 = dict.fromkeys(komb024).keys()
#################################
# PREPARING THE LIST FOR OUTPUT #
#################################
uniqlist = bdss+wbdss+kbdss+komb_unique01+komb_unique02+komb_unique03+komb_unique04+komb_unique05+komb_unique1+komb_unique2+komb_unique3+komb_unique4+komb_unique5+komb_unique6+komb_unique7+komb_unique8+komb_unique9+komb_unique10+komb_unique11+komb_unique12+komb_unique13+komb_unique14+komb_unique15+komb_unique16+komb_unique17+komb_unique18+komb_unique19+komb_unique20+komb_unique21+komb_unique021+komb_unique022+komb_unique023+komb_unique024+komb_unique025+komb_unique026+komb_unique027+komb_unique22+komb_unique23+komb_unique24+komb_unique25+komb_unique26+komb_unique27
if askreverse == "y": # check if reverse names was selected
uniqlist = uniqlist+reverse
if specharswasno <> "y": # check if special chars was selected
uniqlist = uniqlist+komb_unique07+komb_unique08+komb_unique09+komb_unique010+komb_unique011+komb_unique012+komb_unique013
if specharsF1wasno <> "y": # check if special chars in front was selected
uniqlist = uniqlist+komb_unique014+komb_unique015+komb_unique016+komb_unique017+komb_unique018+komb_unique019+komb_unique020
# Do we want to leet ?
unique_lista = dict.fromkeys(uniqlist).keys()
unique_leet = []
if leetmode == "y":
for x in unique_lista: # if you want to add more leet chars, you will need to add more lines in cupp.cfg too...
x = x.replace('a',a)
x = x.replace('i',i)
x = x.replace('e',e)
x = x.replace('t',t)
x = x.replace('o',o)
x = x.replace('s',s)
x = x.replace('g',g)
x = x.replace('z',z)
unique_leet.append(x)
print "[+] Sorting and preparing output"
unique_list = unique_lista + unique_leet
unique_list_finished = []
for x in unique_list:
if len(x) > wcfrom and len(x) < wcto:
unique_list_finished.append(x)
lines0 = 0
lines1 = 0
for lines in unique_list:
lines0 += 1
for lines2 in unique_list_finished:
lines1 += 1
print "\r\n"
print "Your output will have "+str(lines0)+" entries."
print "The feel-lucky-filter will remove similar entries and print "+str(lines1)+" lines."
lucky = raw_input("> Do you feel lucky and use the filter? Y/[N]: ").lower()
print "\r\n"
unique_list_finished.sort()
f = open ( name+'.txt', 'w' )
if lucky == "y":
f.write (os.linesep.join(unique_list_finished)) # --- THIS IS SHORTENING AND FILTERING TOO MUCH COMBINATIONS !!!
if lucky <> "y":
f.write (os.linesep.join(unique_list))
f = open ( name+'.txt', 'r' )
lines = 0
for line in f:
lines += 1
f.close()
print "[+] Saving dictionary to "+name+".txt, counting "+str(lines)+" words."
print "[+] Now load your pistolero with "+name+".txt and shoot! Good luck!"
exit()
elif sys.argv[1] == '-a':
url = config.get('alecto','alectourl')
print "\r\n[+] Checking if alectodb is not present..."
if os.path.isfile('alectodb.csv.gz') == 0:
print "[+] Downloading alectodb.csv.gz..."
webFile = urllib.urlopen(url)
localFile = open(url.split('/')[-1], 'w')
localFile.write(webFile.read())
webFile.close()
localFile.close()
f = gzip.open('alectodb.csv.gz', 'rb')
data = csv.reader(f)
usernames = []
passwords = []
for row in data:
usernames.append(row[5])
passwords.append(row[6])
gus = list(set(usernames))
gpa = list(set(passwords))
gus.sort()
gpa.sort()
print "\r\n[+] Exporting to alectodb-usernames.txt and alectodb-passwords.txt\r\n[+] Done."
f = open ( 'alectodb-usernames.txt', 'w' )
f.write (os.linesep.join(gus))
f.close()
f = open ( 'alectodb-passwords.txt', 'w' )
f.write (os.linesep.join(gpa))
f.close()
f.close()
sys.exit()
elif sys.argv[1] == '-l':
ftpname = config.get('downloader','ftpname')
ftpurl = config.get('downloader','ftpurl')
ftppath = config.get('downloader','ftppath')
ftpuser = config.get('downloader','ftpuser')
ftppass = config.get('downloader','ftppass')
if os.path.isdir('dictionaries') == 0:
os.mkdir('dictionaries')
print " \r\n Choose the section you want to download:\r\n"
print " 1 Moby 14 french 27 places"
print " 2 afrikaans 15 german 28 polish"
print " 3 american 16 hindi 39 random"
print " 4 aussie 17 hungarian 30 religion"
print " 5 chinese 18 italian 31 russian"
print " 6 computer 19 japanese 32 science"
print " 7 croatian 20 latin 33 spanish"
print " 8 czech 21 literature 34 swahili"
print " 9 danish 22 movieTV 35 swedish"
print " 10 databases 23 music 36 turkish"
print " 11 dictionaries 24 names 37 yiddish"
print " 12 dutch 25 net 38 exit program"
print " 13 finnish 26 norwegian \r\n"
print " \r\n Files will be downloaded from "+ftpname+" repository"
print " \r\n Tip: After downloading wordlist, you can improve it with -w option\r\n"
filedown = raw_input("> Enter number: ")
filedown.isdigit()
while filedown.isdigit() == 0:
print "\r\n[-] Wrong choice. "
filedown = raw_input("> Enter number: ")
filedown = str(filedown)
while int(filedown) > 38:
print "\r\n[-] Wrong choice. "
filedown = raw_input("> Enter number: ")
filedown = str(filedown)
def handleDownload(block):
file.write(block)
print ".",
def downloader():
ftp.login(ftpuser, ftppass)
ftp.cwd(ftppath)
def filequitter():
file.close()
print ' done.'
if filedown == "1":