Skip to content

Impersonates a MySQL server and attempts to retrieve files on the client system via LOAD DATA LOCAL INFILE.

Notifications You must be signed in to change notification settings

jbacco/mysql-local-infile-exploit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

MySQL Local Infile Exploit

Impersonates a MySQL server and attempts to retrieve files on the client system via LOAD DATA LOCAL INFILE.

This attack requires a client with LOCAL INFILE capabilities to connect to your server (whether via SSRF, MITM, or stupidity). The LOCAL INFILE capability is often enabled by default in older clients (especially in web applications).

I wrote this after encountering a client which could be exploited multiple times in a single session. In such an instance, this program can be used to retrieve an entire list of files.

Features

  • Handles all file types
  • Allows input lists and multiple files per session
  • Supports Linux and Windows clients/servers (probably works on Mac too)
  • Detects when clients aren't vulnerable
  • Recreates target's directory tree when saving files locally
  • Handles fragmented packets
  • Extensive debug output allows you to see states and packets

Screenshots

Help menu

Help Menu

Exploiting a Debian Linux client to retrieve /etc/passwd (default)

Exploiting Linux 1

Exploiting a Debian Linux client to retrieve a list of files

Exploiting Linux 2

Exploiting a Windows client to retrieve win.ini

Exploiting Windows

Enabling verbosity during a failed exploitation attempt

Verbose Output

Enabling debug output during a failed exploitation attempt

Debug Output

Installation

git clone https://github.com/jbacco/mysql-local-infile-exploit.git

Usage

Server (attacker): python3 mysql-local-infile-exploit.py

Client (victim): mysql --host <server ip> --port 3306 --enable-local-infile=1 -u admin -padmin

Links

About

Impersonates a MySQL server and attempts to retrieve files on the client system via LOAD DATA LOCAL INFILE.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages