Skip to main content

infosecmachines

Python License Status

A Python client for interacting with infosecmachines.io.
This library provides a simple and intuitive API to search, filter, and retrieve information about infosec training machines.


🚀 Features

  • Easy integration with infosecmachines.io.
  • Synchronous and asynchronous clients.
  • Search by platform, difficulty, IP, writeups, and more.
  • Retrieve random machines or all available machines.
  • Pythonic interface with proper exception handling.

📦 Installation

# Using git 
git clone https://github.com/SelfDreamer/Infosecmachines 
cd Infosecmachines 
python3 -m venv .venv 
source .venv/bin/activate # This is on UNIX, on PowerShell Windows will be \.venv\scripts\Activate.ps1
pip3 install -r requirements.txt 

# Using pip 
python3 -m venv .venv 
source .venv/bin/activate
pip install infosecmachines

⚡ Quick Start

from infosecmachines import Client

# Create a client
client = Client()

# The initial request 
client.initial_request()

# Search by machine name
machine = client.search_machine("Nocturnal")
print(machine)

# Get all available machines
machines = client.get_all_machines(return_type='Normal')
print(len(machines))

Asynchronous Client

import asyncio
from infosecmachines import AsyncClient

async def main():
    client = AsyncClient()

    await client.initial_request()
    machine = await client.search_machine("Blue")
    print(machine)

if __name__ == '__main__':
    asyncio.run(main=main())

📚 API Overview


  • Client.search_machine(name: str) -> tuple[dict, ...]

  • Client.search_platform(platform: str) -> tuple[str, ...]

  • Client.search_difficulty(difficulty: str) -> tuple[str, ...]

  • Client.search_ip(adress: str) -> tuple[dict[str, ...], ...]

  • Client.search_writeup(machine: str) -> tuple[Writeup, ...]

  • Client.get_all_machines() -> tuple[str, ...]

  • Client.get_random_machine() -> str

  • Client.search_techniques(techniques: tuple[str, ...], return_type: Literal['Generator', 'Normal']) -> Generator[str, None, None] | tuple[str, ...]

  • Client.search_certificates(certificates: tuple[str, ...], return_type: Literal['Generator', 'Normal']) -> Generator[str, None, None] | tuple[str, ...]

  • Client.advanced_search(objects: tuple[str, ...], return_type: Literal['Generator', 'Normal']) -> Generator[str, None, None] | tuple[str, ...]

  • Client.machine_counts -> dict


Exceptions

  • InitialRequestException – Raised when the initial request is missing or fails.
  • InitialRequestAsyncException - Raised when in the async client the request is missing.

Example

import infosecmachines as info 

client = info.Client()

# Raise InitialRequestException because the initial request is missing
try:
    results = client.search_machine("Tentacle") 
except InitialRequestException as err:
    print(f"Error ocurried: {err}")
    exit(1)

print(results[0]['name'])

🤝 Contributing

Contributions are welcome! Please fork the repo and submit a pull request with clear commit messages.

🙌 Acknowledgements

  • infosecmachines.io for providing the platform.
  • Inspired by common patterns from Python API clients.

Author

Metadata

Release files for infosecmachines 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for infosecmachines 0.0.1
File Size Uploaded
infosecmachines-0.0.1.tar.gz 17.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for infosecmachines 0.0.1
File Interpreter ABI Platform
infosecmachines-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 34.4 kB

Release files / infosecmachines-0.0.1.tar.gz

Download URL infosecmachines-0.0.1.tar.gz
Size 17.2 kB
Tags Source
SHA-256 checksum
How to use checksums
898acee13a0ebca5f38cf7d51b53ada8968793bc85b13a2a37c054d97598c1a6
BLAKE2b-256 checksum
How to use checksums
f72027d1a511e4e6ef1b93eabb2cabb0535b84083e7248d768a93bdf0e4435d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / infosecmachines-0.0.1-py3-none-any.whl

Download URL infosecmachines-0.0.1-py3-none-any.whl
Size 17.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1acb457bdc1baf1ab88e498bf5772bc4fc57f1e2757197711789a5c589c79d2a
BLAKE2b-256 checksum
How to use checksums
8808afd975ec9f4b16e5b1385d614c7b64a28ad0cfa45c9f8cd7195329f9ff32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page