Projects STRLCPY cupp Commits ab11479c
🤬
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • ■ ■ ■ ■ ■ ■
    cupp.py
    skipped 27 lines
    28 28  # along with this program; if not, write to the Free Software
    29 29  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
    30 30  #
    31  -# See 'docs/LICENSE' for more information.
     31 +# See 'LICENSE' for more information.
    32 32   
    33  -import sys
    34  -import os
     33 +import argparse
     34 +import configparser
     35 +import csv
    35 36  import ftplib
    36 37  import functools
    37  -import configparser
    38  -import urllib.request, urllib.parse, urllib.error
    39 38  import gzip
    40  -import csv
    41  -import argparse
     39 +import os
     40 +import sys
     41 +import urllib.error
     42 +import urllib.parse
     43 +import urllib.request
    42 44   
    43 45  __author__ = "Muris Kurgas"
    44 46  __license__ = "GPL"
    skipped 73 lines
    118 120   f = open(filename, "w")
    119 121   unique_list_finished.sort()
    120 122   f.write(os.linesep.join(unique_list_finished))
     123 + f.close()
    121 124   f = open(filename, "r")
    122 125   lines = 0
    123 126   for line in f:
    skipped 617 lines
    741 744   """Implementation of -l switch. Download wordlists from ftp repository as
    742 745   defined in the configuration file."""
    743 746   
    744  - ftpname = CONFIG["FTP"]["name"]
    745  - ftpurl = CONFIG["FTP"]["url"]
    746  - ftppath = CONFIG["FTP"]["path"]
    747  - ftpuser = CONFIG["FTP"]["user"]
    748  - ftppass = CONFIG["FTP"]["password"]
    749  - 
    750  - if os.path.isdir("dictionaries") == 0:
    751  - os.mkdir("dictionaries")
    752  - 
    753 747   print(" \r\n Choose the section you want to download:\r\n")
    754 748   
    755 749   print(" 1 Moby 14 french 27 places")
    skipped 9 lines
    765 759   print(" 11 dictionaries 24 names 37 yiddish")
    766 760   print(" 12 dutch 25 net 38 exit program")
    767 761   print(" 13 finnish 26 norwegian \r\n")
    768  - print(" \r\n Files will be downloaded from " + ftpname + " repository")
     762 + print(
     763 + " \r\n Files will be downloaded from " + CONFIG["FTP"]["name"] + " repository"
     764 + )
    769 765   print(
    770 766   " \r\n Tip: After downloading wordlist, you can improve it with -w option\r\n"
    771 767   )
     768 + 
     769 + filedown = input("> Enter number: ")
     770 + filedown.isdigit()
     771 + while filedown.isdigit() == 0:
     772 + print("\r\n[-] Wrong choice. ")
     773 + filedown = input("> Enter number: ")
     774 + filedown = str(filedown)
     775 + while int(filedown) > 38 or int(filedown) < 0:
     776 + print("\r\n[-] Wrong choice. ")
     777 + filedown = input("> Enter number: ")
     778 + filedown = str(filedown)
     779 + 
     780 + download_wordlist_ftp(filedown)
     781 + return filedown
     782 + 
     783 + 
     784 +def download_wordlist_ftp(filedown):
     785 + """ do the FTP download of a wordlist """
     786 + 
     787 + ftpname = CONFIG["FTP"]["name"]
     788 + ftpurl = CONFIG["FTP"]["url"]
     789 + ftppath = CONFIG["FTP"]["path"]
     790 + ftpuser = CONFIG["FTP"]["user"]
     791 + ftppass = CONFIG["FTP"]["password"]
     792 + 
     793 + if os.path.isdir("dictionaries") == 0:
     794 + os.mkdir("dictionaries")
    772 795   
    773 796   # List of files to download:
    774 797   arguments = {
    skipped 183 lines
    958 981   36: ("turkish", ("turkish.dict.gz",)),
    959 982   37: ("yiddish", ("yiddish.gz",)),
    960 983   }
    961  - 
    962  - filedown = input("> Enter number: ")
    963  - filedown.isdigit()
    964  - while filedown.isdigit() == 0:
    965  - print("\r\n[-] Wrong choice. ")
    966  - filedown = input("> Enter number: ")
    967  - filedown = str(filedown)
    968  - while int(filedown) > 38 or int(filedown) < 0:
    969  - print("\r\n[-] Wrong choice. ")
    970  - filedown = input("> Enter number: ")
    971  - filedown = str(filedown)
    972 984   
    973 985   def downloader():
    974 986   ftp.login(ftpuser, ftppass)
    skipped 125 lines
  • ■ ■ ■ ■ ■ ■
    test_cupp.py
     1 +#!/usr/bin/env python3
     2 +#
     3 +# [Program]
     4 +#
     5 +# CUPP - Common User Passwords Profiler
     6 +#
     7 +# [Author]
     8 +#
     9 +# Mebus, https://github.com/Mebus/
     10 +#
     11 +# [License]
     12 +#
     13 +# This program is free software; you can redistribute it and/or modify
     14 +# it under the terms of the GNU General Public License as published by
     15 +# the Free Software Foundation; either version 3 of the License, or
     16 +# any later version.
     17 +#
     18 +# This program is distributed in the hope that it will be useful,
     19 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
     20 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     21 +# GNU General Public License for more details.
     22 +#
     23 +# You should have received a copy of the GNU General Public License
     24 +# along with this program; if not, write to the Free Software
     25 +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
     26 +#
     27 +# See 'LICENSE' for more information.
     28 + 
     29 +import os
     30 +import unittest
     31 + 
     32 +from cupp import *
     33 + 
     34 + 
     35 +class TestCupp(unittest.TestCase):
     36 + def setUp(self):
     37 + 
     38 + read_config()
     39 + 
     40 + def test_config(self):
     41 + 
     42 + self.assertIn("2018", CONFIG["global"]["years"], "2018 is in years")
     43 + 
     44 + def test_generate_wordlist_from_profile(self):
     45 + profile = {
     46 + "name": "владимир",
     47 + "surname": "путин",
     48 + "nick": "putin",
     49 + "birthdate": "07101952",
     50 + "wife": "людмила",
     51 + "wifen": "ljudmila",
     52 + "wifeb": "06011958",
     53 + "kid": "екатерина",
     54 + "kidn": "katerina",
     55 + "kidb": "31081986",
     56 + "pet": "werny",
     57 + "company": "russian federation",
     58 + "words": ["Крим"],
     59 + "spechars1": "y",
     60 + "randnum": "y",
     61 + "leetmode": "y",
     62 + "spechars": [],
     63 + }
     64 + read_config()
     65 + generate_wordlist_from_profile(profile)
     66 + pass
     67 + 
     68 + def test_parser(self):
     69 + """ downloads a file and checks if it exists """
     70 + 
     71 + download_wordlist_ftp("31")
     72 + 
     73 + filename = "dictionaries/russian/russian.lst.gz"
     74 + 
     75 + self.assertTrue(os.path.isfile(filename), "file " + filename + "exists")
     76 + 
     77 + 
     78 +if __name__ == "__main__":
     79 + unittest.main()
     80 + 
Please wait...
Page is in error, reload to recover