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
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
[![GitHub Issues](https://img.shields.io/github/issues/ctrlsam/rigour?style=flat-square)](https://github.com/ctrlsam/rigour/issues)
[![GitHub Stars](https://img.shields.io/github/stars/ctrlsam/rigour?style=flat-square)](https://github.com/ctrlsam/rigour)

Rigour is a comprehensive Internet of Things (IoT) scanning tool designed to discover, analyze, and report on devices connected to the internet. Rigour performs large-scale network scans to identify active hosts, retrieve service banners, and detect potential vulnerabilities. Rigour was inspired by [Shodan.io](https://www.shodan.io/), a popular IoT search engine. If you find this project useful, please consider starring the repository!
Rigour is a comprehensive Internet of Things (IoT) scanning tool designed to discover, analyze, and report on devices connected to the internet. Rigour performs large-scale network scans to identify active hosts, retrieve service banners, and detect potential vulnerabilities. Rigour was inspired by Shodan.io, a popular IoT search engine. If you find this project useful, please consider starring the repository.

> [!WARNING]
> Rigour is intended for ethical use only. Always obtain permission before scanning networks and devices that you do not own. Use this tool responsibly and in compliance with all applicable laws and regulations.


## Get Started

Before you begin, ensure you have the necessary prerequisites installed on your system.
Expand Down Expand Up @@ -64,15 +63,15 @@ Rigour's architecture comprises several interconnected components that work in h

#### Crawler

The Crawler is responsible for performing large-scale network scans using [Naabu](https://github.com/projectdiscovery/naabu) and fingerprinting the discovered devices with [Fingerprintx](https://github.com/praetorian-inc/fingerprintx). Results from this are published to Kafka for further processing. The microservice design was chosen to support multiple worker nodes in the future.
The Crawler is responsible for performing large-scale network scans using [Naabu](https://github.com/projectdiscovery/naabu) and fingerprinting the discovered devices with [Fingerprintx](https://github.com/praetorian-inc/fingerprintx). Results from this are published to a message bus for further processing by other services. The microservice design was chosen so that it would be easy to scale out the scanning infrastructure by adding more crawler instances as needed.

#### Persistence

The Persistence component consumes scan results and enriches them with other data sources such as ASN and location info from GeoIP. It then stores the enriched data in a MongoDB database. This allows for efficient querying and retrieval of scan data for analysis and reporting.
The Persistence component consumes scan from the crawler and enriches them with other data sources such as GeoIP databases and vulnerability data. It then stores the enriched data in a NoSQL database. This allows for efficient querying and retrieval of scan data for analysis and reporting.

#### API

The API component provides a RESTful interface for accessing scan data stored in MongoDB. It serves as the backend for the Rigour UI, enabling users to query and retrieve scan results.
The API component provides a RESTful interface for accessing scan data stored in the database. It serves as the backend for the Rigour UI, enabling users to query and retrieve scan results.

#### User Interface

Expand All @@ -96,6 +95,17 @@ The Rigour UI provides an intuitive interface for viewing scan results. You can
- **Query Parameters**:
- `filter` (optional, string): A JSON-encoded MongoDB-style query object to restrict the aggregation to a subset of hosts.

## Supported Systems

Rigour is designed to be platform-independent and can run on any system that supports Docker. Currently Rigour is primarily tested on Linux-based systems which perform best. I've also tested it on Apple Silicon Macs but performance is not as good for port discovery, will need to address this in future.

## Future Features

- [ ] Vulnerability Scanning Integration
- [ ] Improved Logging and Monitoring
- [ ] Enhance fingerprinting protocol support
- [ ] Distributed Crawler Support (e.g., Kubernetes & CIDR scheduling)

## Acknowledgements

We would like to thank the open-source community for their contributions and support in developing Rigour.
Expand Down
4 changes: 3 additions & 1 deletion rigour-ui/app/(dashboard)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ export default async function Home({ searchParams: searchParamsPromise }: PagePr

// Fetch facets for the current filter to show accurate counts
const facetsResult = await getFacets(filter);
facets = facetsResult.facets || {};
facets = Object.keys(facetsResult.facets).length === 0
? { services: {}, countries: [], asns: [] }
: facetsResult.facets;
} catch (err) {
console.error('Failed to fetch data:', err);
error = err instanceof Error ? err.message : 'Failed to fetch data';
Expand Down
2 changes: 1 addition & 1 deletion rigour-ui/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function RootLayout({
children: React.ReactNode;
}>) {
return (
<html lang="en">
<html lang="en" className="dark">
<body
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
>
Expand Down
2 changes: 1 addition & 1 deletion rigour/Dockerfile.api
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ COPY . .
RUN go mod download

# Build the api binary
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o api ./cmd/api
RUN go build -a -installsuffix cgo -o api ./cmd/api

# Stage 2: Runtime
FROM alpine:latest
Expand Down
4 changes: 2 additions & 2 deletions rigour/Dockerfile.crawler
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ COPY . .
# Download dependencies
RUN go mod download

# Build the crawler binary
RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -a -o crawler ./cmd/crawler
# Build the crawler binary for target platform
RUN go build -a -o crawler ./cmd/crawler

# Stage 2: Runtime
FROM alpine:latest
Expand Down
6 changes: 3 additions & 3 deletions rigour/Dockerfile.persistence
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Multi-stage build for the crawler service
# Multi-stage build for the persistence service
# Stage 1: Build
FROM golang:1.24.0-alpine AS builder

Expand All @@ -13,8 +13,8 @@ COPY . .
# Download dependencies
RUN go mod download

# Build the persistence binary
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o persistence ./cmd/persistence
# Build the persistence binary for target platform
RUN go build -a -installsuffix cgo -o persistence ./cmd/persistence

# Stage 2: Runtime
FROM alpine:latest
Expand Down
2 changes: 1 addition & 1 deletion rigour/internal/storage/mongodb/hosts.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func (repo *HostRepository) Search(ctx context.Context, filter map[string]interf
}
defer cursor.Close(ctx)

var hosts []types.Host
hosts := []types.Host{}
if err := cursor.All(ctx, &hosts); err != nil {
return nil, "", fmt.Errorf("mongodb: failed to decode results: %w", err)
}
Expand Down