Leprechaun : Tool Used To Map Out Network Data Flow To Help Penetration Testers

Leprechaun purpose of this tool is to help penetration testers identify potentially valuable targets on the internal network environment. By aggregating netstat routes from multiple hosts, you can easily figure out what’s going on within.

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

You’ll need a few Ruby gems to get started – if you don’t have them already, that is.

gem install ‘securerandom’
gem install ‘terminal-table’
gem install ‘getopt’

Lastly, make sure you have Graphviz installed. You can install that with the following command:

apt install graphviz -y

Also Read – Evil-Winrm : The Ultimate WinRM Shell For Hacking/Pentesting

Tool Help Menu

If you run the script without any arguments, you’ll see the following help menu:

[root:vonahisec-kali:~/scripts/leprechaun]# ./leprechaun.rb

————————————————————————————————-
Leprechaun v1.0 – Alton Johnson (@altonjx)
————————————————————————————————-

Usage: ./leprechaun.rb -f /path/to/netstat_results.txt -p

-f File containing the output of netstat results
-p Port you’re interested in. e.g., 80. Specify “all”, “common”, or separate ports with commas
-e The type of destination IP addresses you want to see connections to (e.g. external/internal/all)

Example: ./leprechaun.rb -f netstat_output.txt -p 80
Example: ./leprechaun.rb -f netstat_output.txt -p all
Example: ./leprechaun.rb -f netstat_output.txt -p common
Example: ./leprechaun.rb -f netstat_output.txt -p 80,443 -t external

Example Outputs

+--------------+-----------------------------+----------------------------+
| Server       | Number of connected clients | Highest traffic destination port |
+--------------+-----------------------------+----------------------------+
| 192.12.70.71 | 4                           | 80/tcp (4 clients)               |
| 192.12.70.18 | 2                           | 443/tcp (2 clients)              |
| 192.12.70.45 | 1                           | 445/tcp (1 clients)              |
+--------------+-----------------------------+----------------------------+

Credit: Alton Johnson

R K

Recent Posts

LitterBox : The Ultimate Sandbox Environment For Malware Testing And Red Team Operations

Your malware's favorite sandbox - where red teamers come to bury their payloads. A sandbox…

1 day ago

RWX_MEMORY_HUNT_AND_INJECTION_DV : Exploiting OneDrive.exe To Inject Shellcode Without New RWX Allocations

Abusing Windows fork API and OneDrive.exe process to inject the malicious shellcode without allocating new…

1 day ago

Heap Exploitation Training : A Comprehensive Guide From Basics To Advanced Techniques

This article delves into our comprehensive training program designed to teach you the intricacies of…

1 day ago

BloodHound.py : Installation, Usage, And Features

BloodHound.py is a Python based ingestor for BloodHound, based on Impacket. The code in this…

1 day ago

100 Days Of Rust 2025 : From Incident Response To Linux System Programming

In 2025 I wanted to try something new. In addition to a traditional 100 days…

4 days ago

Presenterm : Revolutionizing Terminal-Based Presentations With Markdown

presenterm lets you create presentations in markdown format and run them from your terminal, with…

4 days ago