Mysql-Magic - Dump Mysql Customer Password From Memory

The mysql customer read the password, together with thus write this for around malloc'ed memory, together with complimentary it, but but because a chunk was freed doesn't hateful it volition hold upward used again, to ensure that your programs non continue sensitive information inward retentiveness you lot must overwrite the memory.
The original destination is larn the password passed through tty, but sometimes it likewise gets the password passed from command line (-pxxxxxx).
Tested inward mysql Ver 15.1 Distrib 10.3.13-MariaDB, for Linux (x86_64) using readline 5.1

Compiling
for compile you lot exclusively bespeak to run make, if you lot desire add together around flags, for whatever reason, you lot tin exercise that amongst CFLAGS=myflags make.
if the organization mysql customer is non placed at /usr/bin/mysql you'll bespeak compile amongst CFLAGS=-DMYSQLCLI=/path/to/mysql make

Options
mysql-magic [options]   -o   comma-separated listing of start  -s            search the retentiveness for passwords together with larn start  -d       Write heap to the folder  -l            Listen mode, await for outgoing ipv4 connections on port 3306  -r      Sleep fourth dimension (Default: iii seconds)  -p            Use process_vm_readv instead of /proc/pid/mem
overstep -d is a skilful affair to do, the password, together with around informations similar former queries, tin rest inward memory, thus you lot tin analyse this together with perhaps laid upward a wordlist based on it, if the password don't are inward the offset

Demo