Home

Awesome

<h1 align="center">Duplicut :scissors:</h1> <h3 align="center"> Quickly dedupe massive wordlists, without changing the order <a href="https://twitter.com/intent/tweet?text=Duplicut%3A%20Remove%20duplicates%20from%20MASSIVE%20wordlist%2C%20without%20sorting%20it%20(for%20dictionnary-based%20password%20cracking)%20-%20by%20%40nil0x42&url=https://github.com/nil0x42/duplicut"> <img src="https://img.shields.io/twitter/url?label=tweet&logo=twitter&style=social&url=http%3A%2F%2F0" alt="tweet"> </a> </h3> <br> <p align="center"> <a href="https://github.com/nil0x42/duplicut/actions?query=branch%3Amaster"> <img src="https://img.shields.io/github/workflow/status/nil0x42/duplicut/Unit%20Tests/master?logo=githubactions" alt="github workflows"> </a> <a href="https://app.codacy.com/gh/nil0x42/duplicut/dashboard"> <img src="https://img.shields.io/codacy/grade/b01c0228bd9148fb9d713a479dda4b25?logo=codacy&logoColor=green" alt="codacy code quality"> </a> <a href="https://lgtm.com/projects/g/nil0x42/duplicut/alerts/"> <img src="https://img.shields.io/lgtm/alerts/github/nil0x42/duplicut?logo=lgtm&logoColor=yellow" alt="lgtm alerts"> </a> <a href="https://codecov.io/gh/nil0x42/duplicut"> <img src="https://img.shields.io/codecov/c/github/nil0x42/duplicut?color=orange&label=coverage&logo=codecov" alt="codecov coverage"> </a> </p> <p align="center"> <a href="https://github.com/enaqx/awesome-pentest#hash-cracking-tools"> <img src="https://awesome.re/mentioned-badge.svg" alt="Mentioned in awesome-pentest"> </a> <a href="https://inventory.raw.pm/tools.html#Duplicut"> <img src="https://inventory.raw.pm/img/badges/Rawsec-inventoried-FF5050_flat.svg"> </a> <a href="https://www.blackarch.org/misc.html"> <img src="https://img.shields.io/static/v1?label=BlackArch&message=packaged&color=red&logo=archlinux&logoColor=006"> </a> <a href="https://twitter.com/intent/follow?screen_name=nil0x42" target="_blank"> <img src="https://img.shields.io/twitter/follow/nil0x42.svg?logo=twitter" akt="follow on twitter"> </a> </p> <div align="center"> <sub> Created by <a href="https://twitter.com/nil0x42">nil0x42</a> and <a href="https://github.com/nil0x42/duplicut/graphs/contributors">contributors</a> </sub> </div> <br>

:book: Overview

Nowadays, password wordlist creation usually implies concatenating multiple data sources.

Ideally, most probable passwords should stand at start of the wordlist, so most common passwords are cracked instantly.

With existing dedupe tools you are forced to choose if you prefer to preserve the order OR handle massive wordlists.

Unfortunately, wordlist creation requires both:

So i wrote duplicut in highly optimized C to address this very specific need :nerd_face: :computer:


:bulb: Quick start

git clone https://github.com/nil0x42/duplicut
cd duplicut/ && make
./duplicut wordlist.txt -o clean-wordlist.txt

:wrench: Options

:book: Technical Details

:small_orange_diamond: 1- Memory optimized:

An uint64 is enough to index lines in hashmap, by packing size info within pointer's extra bits:

:small_orange_diamond: 2- Massive file handling:

If whole file can't fit in memory, it is split into virtual chunks, in such way that each chunk uses as much RAM as possible.

Each chunk is then loaded into hashmap, deduped, and tested against subsequent chunks.

That way, execution time decreases to at most th triangle number:

:bulb: Throubleshotting

If you find a bug, or something doesn't work as expected, please compile duplicut in debug mode and post an issue with attached output:

# debug level can be from 1 to 4
make debug level=1
./duplicut [OPTIONS] 2>&1 | tee /tmp/duplicut-debug.log