
This tool generates BIP-39 mnemonic phrases derived from Unix timestamps, exploring the 'Milk Sad' vulnerability's implications (CVE-2023-39910)
This tool is designed to generate BIP-39 mnemonic phrases (24-word seed phrases) based on Unix timestamps, specifically exploring phrases that could be generated through the "Milk Sad" vulnerability (CVE_2023-39910).
The Milk Sad Mnemonic Generator creates 24-word BIP-39 mnemonic phrases by leveraging Unix timestamps as an entropy source. It aims to generate all possible seed phrases that might have been produced due to the specific timestamp-based entropy collection flaw associated with the "Milk Sad" vulnerability.
You have two options how to install and run on your system:
install.sh ScriptThis script automates the compilation process and handles common dependencies for Debian/Ubuntu-based Linux systems.
cd MilkSad-Mnemonic-Generator
chmod +x install.sh
./install.sh
g++, make, qmake, libssl-dev, libqt5widgets5-dev). If any are missing, it will attempt to install them (prompting for your sudo password if needed). After successfully setting up dependencies, it will compile both the CLI and GUI applications and place them directly in the project's root directory.If you prefer to compile the applications yourself, follow these manual steps:
Ensure you have the following development packages installed on your Debian/Ubuntu system:
g++ (typically part of the build-essential package)make (also part of build-essential)qmake (provided by qt5-qmake or qtbase5-dev)libssl-dev (essential for cryptographic functions used by the tool)libqt5widgets5-dev (required for Qt GUI development; this package often includes qtbase5-dev)You can install these prerequisites using:
sudo apt update
sudo apt install build-essential qt5-qmake libssl-dev qtbase5-dev
cd src/cli
g++:
g++ -std=gnu++11 -Wall -Wextra -O2 milk_sad_generator.cpp -o milk_sad_generator -lcrypto -lssl
mv milk_sad_generator ../../
cd ../..
cd src/gui
qmake to generate the Makefile for the Qt project:
qmake mnemonic_generator.pro
make:
make
mv milk_sad_generator_gui ../../
cd ../..
Pic/ folder: For the GUI to correctly find its background image you must move the Pic/ folder from src/gui/ to the project root:
mv src/gui/Pic .
Once installed, you'll find two executables directly in your project's root directory: ./milk_sad_generator (the Command Line Interface version) and ./milk_sad_generator_gui (the Graphical User Interface version).
./milk_sad_generator_gui # To launch the GUI application
# OR
./milk_sad_generator # To launch the CLI application
This mode generates a single 24-word mnemonic phrase for a precise date and time you specify.
1970-01-01 00:00:00 for first timestamp. If chosen english it will generate "milk sad ..." mnemonic.mnemonic_[language].txt.This mode generates mnemonics for every timestamp within a specified start and end date range.
2017-01-01:2018-12-31 (This will generate mnemonics for all timestamps between January 1, 2017, and December 31, 2018, inclusive.)mnemonics_range_[language].txt.Ctrl+C) and resume later without losing progress.This mode generates all possible mnemonics across the entire 32-bit Unix timestamp range (from January 1, 1970, to January 19, 2038).
all_mnemonics_[language].txt.mnemonic_[language].txtmnemonics_range_[language].txtall_mnemonics_[language].txtgeneration_progress_range.bin (for Option 2) / generation_progress_full.bin (for Option 3)Ctrl+C. The tool will automatically save its current progress..bin progress file will be automatically deleted.If you had to stop a generation process (e.g., using Ctrl+C), you can seamlessly resume from where you left off:
For Date Range generation (Option 2):
generation_progress_range.bin file and continue generating from the last saved timestamp.For Full Range generation (Option 3):
generation_progress_full.bin file and resume the generation from the point it was interrupted..bin progress files (generation_progress_range.bin or generation_progress_full.bin) if you intend to resume a generation..bin progress file and rename/delete/move any existing output file (mnemonics_range_[language].txt or all_mnemonics_[language].txt) from previous runs before starting the program again.all_mnemonics_[language].txt already exists, the .bin progress file will be overwritten, and new mnemonics will be appended to the existing output file.Here's an example of a 24-word BIP-39 mnemonic phrase generated by this tool:
vault alarm sad mass witness property virus style good flower rice alpha viable evidence run glare pretty scout evil judge offer refuse another breeze
For verification purposes or quick reference, the tests/ directory in this repository contains examples of generated mnemonic phrases for various languages for 1970-01-01 00:00:00 UTC timestamp.
To convert the generated mnemonic phrases into Bitcoin addresses (supporting P2PKH, P2SH-P2WPKH, and P2WPKH formats), you can use this tool:
If you found this project useful and would like to encourage me to create more tools like it, consider donating:
bc1qg7xmlsdxfgu3muxherh4eee2ywj3gz8qfgct3s0x1B449E1D545bD0dc50f361d96706F6C904553929F776tt1it7vifCzD9icrsby3ujkZdJ8EY9917GUM3skrTJj96B4SukPJSC4M2FyssoxduVyviv9aGr0x1B449E1D545bD0dc50f361d96706F6C90455392948aaDb1g4Ms7PB3WMj6ttbMWuEwe171d6Yjao59uFJR38tHa75nKwPqYoPAYmWZPUhXmDbDvqtE6d2FX3YaF1dVE7zhD9Dt