Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ Start by forking the repository to your own GitHub account.

Clone the forked repository to your local machine:

\`\`\`bash
```bash
git clone https://github.com/<your-username>/hostRecon.git
cd hostRecon
\`\`\`
```

### 3. Create a new branch

Before making any changes, create a new branch from \`main\`:

\`\`\`bash
```bash
git checkout -b feature-branch
\`\`\`
```

### 4. Make your changes

Expand All @@ -35,28 +35,28 @@ Work on your changes, ensuring they follow the project's coding style and guidel

Before submitting your changes, run the existing tests to ensure everything works as expected:

\`\`\`bash
```bash
make test
\`\`\`
```

If you're adding a new feature or fixing a bug, consider adding corresponding tests in the \`tests/\` directory.

### 6. Commit your changes

Once you're done, commit your changes to the branch:

\`\`\`bash
```bash
git add .
git commit -m "Describe your changes"
\`\`\`
```

### 7. Push your changes

Push the changes to your fork:

\`\`\`bash
```bash
git push origin feature-branch
\`\`\`
```

### 8. Create a pull request

Expand All @@ -75,4 +75,3 @@ If you find a bug or have a feature request, please open an issue in the [Issues
By contributing to **hostRecon**, you agree that your contributions will be licensed under the project's license (e.g., MIT, GPL).

Thank you for your interest in contributing to **hostRecon**! We look forward to your contributions.
"""
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CXX = g++
CXXFLAGS = -Wall -std=c++17
LIBS = -lpcap

OBJS = src/networkScanner.o src/hostReconLib.o

networkScanner: $(OBJS)
$(CXX) $(OBJS) $(LIBS) -o $@

%.o: %.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@

clean:
rm -f $(OBJS) networkScanner
88 changes: 29 additions & 59 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,81 +1,52 @@
![Workflow Status](https://github.com/kmccol1/hostRecon/actions/workflows/cpp.yml/badge.svg)
![Workflow Status](https://github.com/mcckyle/hostRecon/actions/workflows/cpp.yml/badge.svg)

# hostRecon

## Intelligent Local Network Discovery with libpcap

## Overview

**hostRecon** is a fast, efficient, and easy-to-use CLI-based network scanner that facilitates host discovery and availability checks on local networks. Leveraging the power of `libpcap`, this tool performs network reconnaissance through ICMP Echo Request (ping) messages and captures responses from live hosts. It’s a valuable tool for network administrators, cybersecurity professionals, and anyone wanting to explore their local network.
**hostRecon** is a simple, lightweight, CLI-based network scanner for discovering active hosts on local networks. Powered by `libpcap`, it performs low-level packet injection and capture for precise and reliable network reconnaissance. This tool is ideal for developers, sysadmins, cybersecurity enthusiasts seeking a deeper look at the devices on their LAN.

## Table of Contents

- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
- [Build](#usage)
- [Current State](#current-state)
- [Future State](#future-state)
- [Contributing](#contributing)
- [License](#license)

## Features

- **Fast & Efficient**: Designed for quick host discovery via ICMP Echo Requests.
- **Low-Level Packet Manipulation**: Uses `libpcap` for low-level packet capture and injection.
- **Multi-Host Scanning**: Allows the concurrent scanning of multiple hosts to save time.
- **Customizable Network Configuration**: Set custom source and destination IP addresses.
- **Real-Time Active Host Display**: Instantly shows hosts that are up and responsive.
- **Error Resilience**: Includes robust error handling for packet capture failures and network interface issues.
- **Accurate Host Detection**: Uses ARP and ICMP scanning to identify active devices on the local network.
- **Low-Level Network Access**: Builds and injects Ethernet, IP, and ICMP frames directly with `libpcap`.
- **Real-Time Output**: Displays responsive hosts immediately during scanning.
- **Error-Resilient**: Gracefully handles interface, packet, and permission-related failures.
- **Extensible Architecture** - Clean, modular design for future protocol and feature expansion.

## Installation

### Prerequisites
### Requirements

To run **hostRecon**, you will need the following:

- **[libpcap](https://www.tcpdump.org/)**:
- A packet capture library required for capturing and injecting packets.
- Install via your package manager:

For Ubuntu/Debian:

```bash
sudo apt-get install libpcap-dev
```

For Fedora:

```bash
sudo dnf install libpcap-devel
```

For macOS:
- **[libpcap](https://www.tcpdump.org/)** - For packet capture/injection:
- Ubuntu/Debian: ```bash sudo apt install libpcap-dev```
- Fedora: ```bash sudo dnf install libpcap-devel```
- macOS: ```bash brew install libpcap```

```bash
brew install libpcap
```
- **C++17 or newer** compiler (`g++`, `clang++`, etc.):

- **C++ Compiler**:
- A C++ compiler such as `g++`, `clang++`, or any standard C++ compiler.
- **CMake** (optional, but recommended).

- **CMake** (Optional for build automation):
- While optional, **CMake** is recommended for automating the build process, especially for larger projects.
- Installation (for Linux):

```bash
sudo apt-get install cmake
```

For macOS:

```bash
brew install cmake
```

### Steps
### Build

1. Clone this repository:

```bash
git clone https://github.com/kmccol1/hostRecon.git
git clone https://github.com/mcckyle/hostRecon.git
cd hostRecon
```

Expand Down Expand Up @@ -109,28 +80,27 @@ To run **hostRecon**, you will need the following:

## Usage

Once compiled, **hostRecon** can be run from the command line. The tool will automatically detect and scan the local subnet for active hosts, displaying the list of hosts that respond to the ICMP Echo Request.

### Example:
Simply execute

```bash
sudo ./networkScanner
```

The tool will output the list of active hosts in your local network.
**hostRecon** automatically identifies your active network interfaces and scans the
local subnet for reachable hosts. Each responsive device is printed in real-time, showing its IP and MAC address.

## Current State

As of now, **hostRecon** provides the following functionality:

- Establishes a capture session to listen for ICMP Echo Replies.
- Constructs and sends ICMP Echo Request packets to specified IP addresses in a /24 subnet.
- Captures responses and accurately identifies active hosts based on received packets.
- Displays the results in a clear and concise format.
- Direct ARP-based host discovery on local networks.
- ICMP echo (ping) scanning for active device verification.
- Real-time result display with informative status output.
- Reliable interface initalization and error handling.

### Current Limitations:
- **Single-threaded Operation**: Scans hosts sequentially, which may limit speed in larger networks.
- **Limited Protocol Support**: Currently supports only ICMP-based host discovery.
### Known Limitations:
- **Single-threaded Scanning**: Scans hosts sequentially, which may limit speed in larger networks.
- **Routed Scanning**: Focused on local subnet (no routed scanning, yet).

## Future State

Expand Down
Loading