Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/thescriptguy/download-certificates

A multithreaded program to download the certificates from entries in a file.
https://github.com/thescriptguy/download-certificates

Last synced: 2 days ago
JSON representation

A multithreaded program to download the certificates from entries in a file.

Awesome Lists containing this project

README

        

# ๐Ÿ”’ SSL Certificate Downloader

A multi-threaded SSL certificate downloader that allows you to retrieve and save SSL certificates from multiple hosts.

## ๐Ÿ“‹ Table of Contents

- [Features](#features)
- [Requirements](#requirements)
- [Required Libraries](#required-libraries)
- [Compilation](#compilation)
- [Usage](#usage)
- [Arguments](#arguments)
- [Examples](#examples)
- [Contributing](#contributing)
- [License](#license)

## โœจ Features

- ๐Ÿš€ Multi-threaded certificate downloading
- ๐Ÿ’พ Save certificates with SHA256 hash filenames
- โฑ๏ธ Configurable connection timeout
- ๐Ÿ”„ Optional overwrite of existing certificates
- ๐Ÿ•ฐ๏ธ Customizable delay between requests

## ๐Ÿ› ๏ธ Requirements

- GCC compiler
- OpenSSL development libraries
- POSIX-compliant system

## ๐Ÿ“š Required Libraries

Before compiling, ensure you have the following libraries installed on your system:

- ๐Ÿ” OpenSSL: For SSL/TLS support
- ๐Ÿงต pthreads: For multi-threading capabilities

These libraries are typically available in most standard development environments. If you encounter any issues during compilation, make sure these libraries and their development files are properly installed on your system.

## ๐Ÿ”จ Compilation

1. Clone the repository:
```
git clone https://github.com/TheScriptGuy/certificate-downloader.git
cd ssl-certificate-downloader
```

2. Compile the program:
Make options
```
$ make help
Available targets:
all : Build the default target (download_cert)
full : Build with all libraries statically linked
clean : Remove all built and intermediate files
help : Display this help message

Compiler flags:
CFLAGS : -Wall -Wextra -Iinclude -pthread
LDFLAGS : -lssl -lcrypto

To use a specific compiler, set CC. For example:
make CC=clang

To add extra CFLAGS or LDFLAGS, use '+=' For example:
make CFLAGS+=-DDEBUG LDFLAGS+=-L/usr/local/lib
```

To build the binary with the libraries `dynamically` linked, use:
```
make all
```

To build the binary with the libraries `statically` linked, use:
```
make full
```

This will create an executable named `download_cert`.

## ๐Ÿš€ Usage

Basic usage:
```
./download_cert -if -od [OPTIONS]
```

## ๐ŸŽ›๏ธ Arguments

| Argument | Description | Required |
|----------|-------------|----------|
| `-if ` | Input file containing hostnames and ports | โœ… Yes |
| `-od ` | Directory to save downloaded certificates | โœ… Yes |
| `-delay ` | Delay between each worker's request (default: 0) | โŒ No |
| `-workers ` | Number of worker threads (default: 1) | โŒ No |
| `-timeout ` | Connection timeout in seconds (default: 3) | โŒ No |
| `-overwrite` | Allow overwriting of existing certificate files | โŒ No |

## ๐Ÿ“ Examples

1. Basic usage with default settings:
```
./download_cert -if hosts.txt -od /path/to/certs
```

2. Use 5 worker threads with a 2-second delay between requests:
```
./download_cert -if hosts.txt -od /path/to/certs -workers 5 -delay 2
```

3. Set a 10-second connection timeout and allow overwriting:
```
./download_cert -if hosts.txt -od /path/to/certs -timeout 10 -overwrite
```

4. Combine multiple options:
```
./download_cert -if hosts.txt -od /path/to/certs -workers 3 -delay 1 -timeout 5 -overwrite
```

## ๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## ๐Ÿ“„ License

This project/software is licensed for Personal Use only - see the [LICENSE](https://github.com/TheScriptGuy/download-certificates/blob/main/LICENSE.md) file for details.