Password Hacking
Generare Wordlist Formato Data
Creare una password al volo ed essere certi di poterla ricordare spinge alcuni individui ad utilizzare una data, sia essa quella di nascita, matrimonio, nascita del figlio/a, giorno di laurea o altro; rappresenta un modo semplice per non dover impegnare la mente in una operazione di pensiero articolato e di memorizzazione; infatti se alla data si antepone o pospone un nome o anche il semplice diminutivo di un nome, si riesce ad ottenere una password di lunghezza sufficiente per soddisfare molti requisiti richiesti per l’accesso, ad esempio, al computer aziendale o al sito online della banca; un metodo semplice per generare la password composta da numeri, caratteri speciali ed eventualmente, aggiungendo solo il diminutivo del nome del figlio con la lettera maiuscola ecco soddisfatti i criteri di cui si è fatto cenno, creando la falsa illusione di aver concepito la password “sicura” es Nik12.05.1971 (13 caratteri), oppure P13tr0_19821219 (15 caratteri), 05-27-1997-Anthony (18 caratteri).
Nulla però, che non possa essere “smantellato” fancendo una ricerca online raccogliendo dati dalle fonti aperte (OSINT), ad esempio i social network e combinandole con una data, che comunemente è strettamente legata all’individuo stesso o ai sui legami affettivi (quindi nel suo range di “vita” e di conseguenza dei suoi affetti).
Lo script Python allegato di seguito, partendo da un range di anni definito dall’utente (nell’esempio 1900-2024), combinando caratteri separatori e metodi permette di generare rapidamente un elenco di date in un ampio formato, da utilizzare direttamente oppure raccogliendole in un file a formare una “wordlist” che combinate ad altre informazioni (es. nomi) diventano utili nel Password Cracking.
Script Python print-date.py
# -----------------------------------------------------------------------------
# - Script file name : print-date.py
# - Author : Nicola Montemurro
# - Administrator : Nicola Montemurro - Tel. xxx, Mobile: xxx
# - Create : 21.09.2025
# - Last Update : 22.09.2025
# - Description :
# - Position : /usr/local/scripts
# - note : NON modificare senza AUTORIZZAZIONE dell'AMMINISTRATORE
# ----------------------------------------------------------------------------
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
from datetime import date, timedelta
"""
USAGE EXAMPLES:
1. Basic usage (default settings):
%(prog)s 1900 2024
2. Save to a file:
%(prog)s 1900 2024 -f dates.txt
3. Limit number of dates displayed:
%(prog)s 1900 2024 -l 10
4. Change separator:
%(prog)s 1900 2024 -s '-'
5. Reverse date order:
%(prog)s 1900 2024 -o reverse
6. English locale format (in forward mode):
%(prog)s 1900 2024 --locale en
7. ISO format:
%(prog)s 1900 2024 --iso --no-iso (default: --no-iso)
FORMATTING OPTIONS:
- Order: forward (default) or reverse
- Locale: 'it' (day/month/year) or 'en' (month/day/year)
- Separator: Any character (default: '/')
""",
def generate_date_list(start_year, end_year):
"""
Generate a complete list of dates from January 1st of start year
to December 31st of end year.
"""
# Ensure start_year is not greater than end_year
if start_year > end_year:
start_year, end_year = end_year, start_year
# Create the start and end dates
start_date = date(start_year, 1, 1)
end_date = date(end_year, 12, 31)
# Generate the list of dates
date_list = []
current_date = start_date
while current_date <= end_date:
date_list.append(current_date)
current_date += timedelta(days=1)
return date_list
def main():
# Custom date formatting function
def format_date(date_obj):
iso_day = str(date_obj.day)
iso_month = str(date_obj.month)
if args.iso:
# ISO format day
if (date_obj.day < 10):
iso_day = '0' + str(date_obj.day)
# ISO format month
if (date_obj.month < 10):
iso_month = '0' + str(date_obj.month)
# Forward order with locale-specific formatting
if args.locale == 'en':
# English format: month/day/year
components = [iso_month, iso_day, date_obj.year]
#components = [date_obj.month, date_obj.day, date_obj.year]
else:
# Italian format: day/month/year
components = [iso_day, iso_month, date_obj.year]
#components = [date_obj.day, date_obj.month, date_obj.year]
# Reverse order
if args.order == 'reverse':
components = [date_obj.year, iso_month, iso_day]
#return args.separator.join(map(str, components))
return args.separator.join(map(str, components))
# Create an ArgumentParser object with custom help formatting
parser = argparse.ArgumentParser(
description='Generate a list of dates between two years.',
epilog='''
"
USAGE EXAMPLES:
1. Basic usage (default settings):
%(prog)s 1900 2024
2. Save to a file:
%(prog)s 1900 2024 -f dates.txt
3. Limit number of dates displayed:
%(prog)s 1900 2024 -l 10
4. Change separator:
%(prog)s 1900 2024 -s '-'
5. Reverse date order:
%(prog)s 1900 2024 -o reverse
6. English locale format (in forward mode):
%(prog)s 1900 2024 --locale en
7. ISO format:
%(prog)s 1900 2024 --iso --no-iso (default: --no-iso)
FORMATTING OPTIONS:
- Order: forward (default) or reverse
- Locale: 'it' (day/month/year) or 'en' (month/day/year)
- Separator: Any character (default: '/')
''',
formatter_class=argparse.RawDescriptionHelpFormatter
)
# Positional arguments
parser.add_argument('start_year', type=int, help='The starting year for date generation')
parser.add_argument('end_year', type=int, help='The ending year for date generation')
# Optional arguments
parser.add_argument('-f', '--file', type=str, help='Output file to save the dates')
parser.add_argument('-l', '--limit', type=int, default=None, help='Limit the number of dates printed')
# Separator argument
parser.add_argument('-s', '--separator', type=str, default='/', help='Separator between date components (default: /)')
# Date order argument
parser.add_argument('-o', '--order', type=str, choices=['forward', 'reverse'], default='forward', help='Date format order: forward or reverse (default: forward)')
# Locale argument
parser.add_argument('--locale', type=str, choices=['en', 'it'], default='it', help='Locale-specific format in forward mode (default: it)')
# ISO argument
parser.add_argument('--iso', action=argparse.BooleanOptionalAction, default=False, help='ISO format date (days and months leading by 0 if < 10 )')
# Parse the arguments
args = parser.parse_args()
# Generate the list of dates
dates = generate_date_list(args.start_year, args.end_year)
# Print total number of days
#print(f"Total number of days: {len(dates)}")
# Handle output
if args.file:
# Save to file
with open(args.file, 'a') as file:
for single_date in dates:
file.write(f"{format_date(single_date)}\n")
#print(f"Dates saved to {args.file}")
# Print dates (limited if specified)
limit = args.limit if args.limit is not None else len(dates)
for single_date in dates[:limit]:
print(format_date(single_date))
if __name__ == "__main__":
main()
Script print-date-nested-loop.cmd
:: ----------------------------------------------------------------------------
:: - File Name : print-date-nested-loop.cmd
:: - Author : Nicola Montemurro
:: - Administrator : Nicola Montemurro - Mobile: -
:: - Create : 22/09/2025
:: - Last Update : 22/09/2025
:: - Description : File per la creazione di wordlist hashcat/john the ripper
:: - Position : E:\Progetti\software\scripts\cmd
:: - Note : NON modificare senza AUTORIZZAZIONE dell'AMMINISTRATORE
:: ---------------------------------------------------------------------------
@echo off
setlocal EnableDelayedExpansion
set SYEAR=1900
set EYEAR=2024
set WORDLISTFILE=B:\wordlists\wordlist-date\wordlist-date
::set S="|"
set SEP="^" "+" "-" "_" "/" "." ":" "|"
set ORD=forward reverse
set ISO=--iso --no-iso
set LOC=it en
for %%a in (%SEP%) do (
for %%b in (%ORD%) do (
for %%c in (%ISO%) do (
for %%d in (%LOC%) do (
python B:\scripts\print-date.py !SYEAR! !EYEAR! -s %%a -o %%b %%c --locale %%d -f !WORDLISTFILE!-!SYEAR!-!EYEAR!
))))
Lo script di esempio produce il seguente risultato:
Per ciascun carattere delimitatore (8) vengono applicate le opzioni “forward” e “reverse” (2), “iso” o “no-iso” (2), “en” o “ita” (2) producendo 64 combinazioni diverse, che moltiplicate per 125 anni (1/1/1900 – 31/12/2024), per i giorni dell’anno (365) ai quali vanno sommati i giorni aggiuntivi per ogni anno bisestile (31) moltiplicati per ciascuna combinazione (64) ne risulta un file di 2.921.984 righe ottenuto in poco meno di 100 secondi.
8 * 2 * 2 * 2 = 64 (combinazioni possibili)
125 * 365 * 64 = 2.920.000 (date singole)
31 * 64 = 1.984 (giorni aggiuntivi per gli anni bisestili)
2.920.000 + 1.194 = 2.921.194 (totale delle combinazioni di date singole)
Risultato:
01011900 02011900 03011900 04011900 05011900 06011900 ... 2024|12|26 2024|12|27 2024|12|28 2024|12|29 2024|12|30 2024|12|31