Pteronode - Script for managing Pterodactyl nodes

Related tags

Networkingpteronode
Overview

pteronode

Script for managing Pterodactyl nodes

Pteronode allows you to create sets of allocations on one, many, or all of your IPs and Nodes with a simple command.

HELP

Run python pteronode.py --help for help. You can find us on Discord too at https://discord.gg/q4AeCxgs.

Installing

Right now you need to clone this repo and install the dependencies and run it using Python.

git clone https://github.com/iamkubi/pteronode
cd pteronode
pip install -r requirements.txt
python pteronode.py --help

Sometime soon I'll add a packaged release that can be downloaded and run as a single executable.

Credentials

There are two ways to specify your panel credentials. The easiest option is to specify a config file. By default Pteronode will look for a .pteronode.yml file in the current path. A valid config file looks like this:

> cat .pteronode.yaml
panel: https://panel.test.com
api-key: your-application-api-key-here

Alternatively you can use the --panel and --api_key flags to specify them on the command line.

python pteronode.py --api_key 1234 --panel https://test.com --list_nodes

--list_nodes

This flag allows you to get a quick glance at all of the nodes on your panel. Especially useful for getting Node IDs to for when you want to add allocations.

> python pteronode.py --list_nodes
+----+-------+----------------+----------+--------+------------------+--------+----------------+-------------------+------------------+
| ID |  Name |      FQDN      | Location | Memory | Allocated Memory |  Disk  | Allocated Disk | Total Allocations | Used Allocations |
+----+-------+----------------+----------+--------+------------------+--------+----------------+-------------------+------------------+
| 1  | test1 | test1.test.com |   PDX1   | 62000  |      58000       | 200000 |     163000     |        111        |        23        |
| 2  | test2 | test2.test.com |   US-E   | 63000  |        0         | 350000 |       0        |        101        |        1         |
+----+-------+----------------+----------+--------+------------------+--------+----------------+-------------------+------------------+

--allocations

Great, so I know my node IDs, now let's make some allocations. By default it will create the same set of allocations on every IP on every node on your panel.

> python pteronode.py --allocations=7777-7800,25565-25665,27015
PteroNode wants to add the following allocations:
+---------+--------------+----------------+---------------------------------------+
| Node ID |  IP Address  |    IP Alias    |              Allocations              |
+---------+--------------+----------------+---------------------------------------+
|    1    | 10.10.10.10  | 123.234.45.678 | ['7777-7800', '25565-25665', '27015'] |
|    2    | 12.34.45.111 |      None      | ['7777-7800', '25565-25665', '27015'] |
+---------+--------------+----------------+---------------------------------------+
Run again with --no_dry_run to take this action.

By default, this didn't do anything, it just prints out a table showing you what it would create. Run the same command again with --no_dry_run to execute the above.

> python pteronode.py --allocations=7777-7800,25565-25665,27015 --no_dry_run
PteroNode wants to add the following allocations:
+---------+--------------+----------------+---------------------------------------+
| Node ID |  IP Address  |    IP Alias    |              Allocations              |
+---------+--------------+----------------+---------------------------------------+
|    1    | 10.10.10.10  | 123.234.45.678 | ['7777-7800', '25565-25665', '27015'] |
|    2    | 12.34.45.111 |      None      | ['7777-7800', '25565-25665', '27015'] |
+---------+--------------+----------------+---------------------------------------+
Done!  CACAW!

And that's it, it did it! Specifying any allocations that already exist will not cause an error. Those ports will be ignored, and it will create any ports from those ranges that do not exist.

Other flags

There's some more stuff you can do with filters. You can use --nodes to specify a list of node IDs so that it will only add allocations on those nodes.

python pteronode.py --allocations=1234 --nodes=1,2,4

You can filter by IP addresses too.

python pteronode.py --allocations=1234 --ip_addrs=1.1.1.1,8.8.8.8

You can combine them too.

python pteronode.py --allocations=1234 --ip_addrs=1.1.1.1,8.8.8.8 --nodes=1
You might also like...
wireguard-config-benchmark is a python script that benchmarks the download speeds for the connections defined in one or more wireguard config files

wireguard-config-benchmark is a python script that benchmarks the download speeds for the connections defined in one or more wireguard config files. If multiple configs are benchmarked it will output a file ranking them from fastest to slowest.

A lightweight python script that can monitor the T-Mobile Home Internet Nokia 5G Gateway for band and connectivity and reboot as needed.

tmo-monitor A lightweight Python 3 script that can monitor the T-Mobile Home Internet Nokia 5G Gateway for band and connectivity and reboot as needed.

This script helps us to add IP, host name entry in hosts file and create directory run nmap scan and directory scan with your favourite tools
This script helps us to add IP, host name entry in hosts file and create directory run nmap scan and directory scan with your favourite tools

A python script to automate your set-up for Hack The Box, It sets up Workspace, Opens TMUX session, connects to OpenVPN, Runs Nmap and many more...

Script and library to wait for a DNS authority server to get its configuration.

DNSWait dnswait is a small script to wait for the "propagation" of a namserver configuration. Installing It's as easy as: python -m pip install dnswai

 Fmog: Fortinet Mass Object Generator. This script will take a list of IP addresses and create address objects with the same name
Fmog: Fortinet Mass Object Generator. This script will take a list of IP addresses and create address objects with the same name

Fmog: Fortinet Mass Object Generator This script will take a list of IP addresses and create address objects with the same name. It will also add them

Python script to stop qBittorrent from torrenting without VPN for users with static IP.

Python script to stop qBittorrent from torrenting without VPN for users with static IP.

Simple python script for automated network scans with random name generator(useful for CTF boxes).
Simple python script for automated network scans with random name generator(useful for CTF boxes).

📄 Automated NMAP script Description Simple python script for automated network scans with random name generator(useful for CTF boxes). Requirements 1

The sequel to SquidNet. It has many of the previous features that were in the original script, however a lot of the functions that do not serve much functionality have been removed.

SquidNet2 The sequel to SquidNet. It has many of the previous features that were in the original script, however a lot of the functions that do not se

A script to automatically update the github's proxy IP in hosts file.

updateHostsGithub A script to automatically update the github's proxy IP in hosts file. Now only Mac and Linux are supported. (脚本自动更新本地hosts文件,目前仅支持Ma

Comments
  • Feature: Looping API calls for allocations larger than 1000

    Feature: Looping API calls for allocations larger than 1000

    Creating allocations larger than 1000 causes the Pterodactyl error that you can only bulk add 1000 ports at a time. I suggest adding looping logic to allow for larger allocations.

    Error:

    Traceback (most recent call last):
      File "S:\SonoranSoftware\Pteronode\pteronode.py", line 208, in <module>
        main(args)
      File "S:\SonoranSoftware\Pteronode\pteronode.py", line 202, in main
        add_allocations(api, args.nodes, args.ip_addrs, args.allocations,
      File "S:\SonoranSoftware\Pteronode\pteronode.py", line 175, in add_allocations
        api.nodes.create_allocations(
      File "C:\Users\max32\AppData\Local\Programs\Python\Python310\lib\site-packages\pydactyl\api\nodes.py", line 149, in create_allocations
        response = self._api_request(
      File "C:\Users\max32\AppData\Local\Programs\Python\Python310\lib\site-packages\pydactyl\api\base.py", line 103, in _api_request
        raise PterodactylApiError('API Request resulted in errors: %s' %
    pydactyl.exceptions.PterodactylApiError: API Request resulted in errors: [{'code': 'TooManyPortsInRangeException', 'status': '400', 'detail': 'Adding more than 1000 ports in a single range at once is not supported.', 'source': {'line': 82, 'file': '/Services/Allocations/AssignmentService.php'}, 'meta': {'trace': ['#0 /app/app/Http/Controllers/Api/Application/Nodes/AllocationController.php(64): Pterodactyl\\Services\\Allocations\\AssignmentService->handle(Object(Pterodactyl\\Models\\Node), Array)', '#1 /app/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): Pterodactyl\\Http\\Controllers\\Api\\Application\\Nodes\\AllocationController->store(Object(Pterodactyl\\Http\\Requests\\Api\\Application\\Allocations\\StoreAllocationRequest), Object(Pterodactyl\\Models\\Node))', "#2 /app/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\\Routing\\Controller->callAction('store', Array)", "#3 /app/vendor/laravel/framework/src/Illuminate/Routing/Route.php(254): Illuminate\\Routing\\ControllerDispatcher->dispatch(Object(Illuminate\\Routing\\Route), Object(Pterodactyl\\Http\\Controllers\\Api\\Application\\Nodes\\AllocationController), 'store')", '#4 /app/vendor/laravel/framework/src/Illuminate/Routing/Route.php(197): Illuminate\\Routing\\Route->runController()', '#5 /app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(695): Illuminate\\Routing\\Route->run()', '#6 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))', '#7 /app/app/Http/Middleware/Api/AuthenticateIPAccess.php(26): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))', '#8 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Pterodactyl\\Http\\Middleware\\Api\\AuthenticateIPAccess->handle(Object(Illuminate\\Http\\Request), Object(Closure))', '#9 /app/app/Http/Middleware/Api/Application/AuthenticateApplicationUser.php(23): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))', '#10 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Pterodactyl\\Http\\Middleware\\Api\\Application\\AuthenticateApplicationUser->handle(Object(Illuminate\\Http\\Request), Object(Closure))', '#11 /app/app/Http/Middleware/Api/AuthenticateKey.php(75): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))', '#12 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Pterodactyl\\Http\\Middleware\\Api\\AuthenticateKey->handle(Object(Illuminate\\Http\\Request), Object(Closure), 2)', '#13 /app/app/Http/Middleware/Api/SetSessionDriver.php(33): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))', '#14 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Pterodactyl\\Http\\Middleware\\Api\\SetSessionDriver->handle(Object(Illuminate\\Http\\Request), Object(Closure))', '#15 /app/app/Http/Middleware/Api/ApiSubstituteBindings.php(75): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))', '#16 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Pterodactyl\\Http\\Middleware\\Api\\ApiSubstituteBindings->handle(Object(Illuminate\\Http\\Request), Object(Closure))', '#17 /app/app/Http/Middleware/Api/IsValidJson.php(28): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))', '#18 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Pterodactyl\\Http\\Middleware\\Api\\IsValidJson->handle(Object(Illuminate\\Http\\Request), Object(Closure))', '#19 /app/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(127): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))', '#20 /app/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(63): Illuminate\\Routing\\Middleware\\ThrottleRequests->handleRequest(Object(Illuminate\\Http\\Request), Object(Closure), Array)', "#21 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Routing\\Middleware\\ThrottleRequests->handle(Object(Illuminate\\Http\\Request), Object(Closure), '240', '1')", '#22 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))', '#23 /app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(697): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))', '#24 /app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(672): Illuminate\\Routing\\Router->runRouteWithinStack(Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request))', '#25 /app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(636): Illuminate\\Routing\\Router->runRoute(Object(Illuminate\\Http\\Request), Object(Illuminate\\Routing\\Route))', '#26 /app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(625): Illuminate\\Routing\\Router->dispatchToRoute(Object(Illuminate\\Http\\Request))', '#27 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(166): Illuminate\\Routing\\Router->dispatch(Object(Illuminate\\Http\\Request))', '#28 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}(Object(Illuminate\\Http\\Request))', '#29 /app/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))', '#30 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fideloper\\Proxy\\TrustProxies->handle(Object(Illuminate\\Http\\Request), Object(Closure))', '#31 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))', '#32 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))', '#33 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle(Object(Illuminate\\Http\\Request), Object(Closure))', '#34 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))', '#35 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))', '#36 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle(Object(Illuminate\\Http\\Request), Object(Closure))', '#37 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))', '#38 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle(Object(Illuminate\\Http\\Request), Object(Closure))', '#39 /app/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))', '#40 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle(Object(Illuminate\\Http\\Request), Object(Closure))', '#41 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))', '#42 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle(Object(Illuminate\\Http\\Request), Object(Closure))', '#43 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))', '#44 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(141): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))', '#45 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))', '#46 /app/public/index.php(68): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))', '#47 {main}']}}]
    
    opened by Fireant456 0
Exfiltrate files using the HTTP protocol version ("HTTP/1.0" is a 0 and "HTTP/1.1" is a 1)

http-protocol-exfil Use the HTTP protocol version to send a file bit by bit ("HTTP/1.0" is a 0 and "HTTP/1.1" is a 1). It uses GET requests so the Blu

Ricardo Ruiz 23 Apr 30, 2022
Timeouts for popular Python packages

Python Timeouts An unresponsive service can be worse than a down one. It can tie up your entire system if not handled properly. All network requests s

Andrew Kane 11 Nov 22, 2022
league-connection is a python package to communicate to riot client and league client

league-connection is a python package to communicate to riot client and league client.

Sandbox 1 Sep 13, 2022
Connects to databases or sftp server based on configured environmental variables.

Myconnections Connects to Oracle databases or sftp servers depending on configured environmental variables. VERY IMPORTANT: VPN must exist. Installati

0 Jan 02, 2022
A vpn that sits in your browser, accessible via a website

VPNInYourBrowser A vpn that sits in your browser, accessible via a website Example setup: https://VPNInBrowser.jaffa42.repl.co Setup Put the code onto

1 Jan 20, 2022
Multipurpose Growtopia Server tools, can be used for newbie to learn things.

Multipurpose Growtopia Server tools, can be used for newbie to learn things.

FelixF 3 Dec 01, 2021
Docker container for demoing Wi-Fi calling stack.

VoWiFiLocalDemo - Docker container that runs StrongSwan and Kamailio to demonstrate how Wi-Fi calling works on smartphones.

18 Nov 12, 2022
Python implementation of the Session open group server

API Documentation CLI Reference Want to build from source? See BUILDING.md. Want to deploy using Docker? See DOCKER.md. Installation Instructions Vide

Oxen 36 Jan 02, 2023
A simple software which can use to make a server in local network

home-nas it is simple software which can use to make a server in local network, it has a web site on it which can use by multipale system, i use nginx

R ansh joseph 1 Nov 10, 2021
Eclipse zenoh Python API

Eclipse zenoh Python API Eclipse zenoh is an extremely efficient and fault-tolerant Named Data Networking (NDN) protocol that is able to scale down to

26 Jan 05, 2023
User-friendly packet captures

capture-packets: User-friendly packet captures Please read before using All network traffic occurring on your machine is captured (unless you specify

Seth Michael Larson 2 Feb 05, 2022
Burp Extension that copies a request and builds a FFUF skeleton

ffuf is gaining a lot of traction within the infosec community as a fast portable web fuzzer. It has been compared and aligned (kinda) to Burp's Intruder functionality. Thus, Copy As FFUF is trying t

Desmond Miles 81 Dec 22, 2022
FIRM-AFL is the first high-throughput greybox fuzzer for IoT firmware.

FIRM-AFL is the first high-throughput greybox fuzzer for IoT firmware. FIRM-AFL addresses two fundamental problems in IoT fuzzing

356 Dec 23, 2022
Connection package to a raspberry or any other machine using ssh, it simplifies the deployment scripts and monitoring.

Connection package to a raspberry or any other machine using ssh, it simplifies the deployment scripts and monitoring.

Dashstrom 7 Mar 29, 2022
Usbkill - an anti-forensic kill-switch that waits for a change on your USB ports and then immediately shuts down your computer.

Usbkill - an anti-forensic kill-switch that waits for a change on your USB ports and then immediately shuts down your computer.

Hephaestos 4.1k Dec 30, 2022
Script and library to wait for a DNS authority server to get its configuration.

DNSWait dnswait is a small script to wait for the "propagation" of a namserver configuration. Installing It's as easy as: python -m pip install dnswai

Julien Palard 14 Jan 17, 2022
TsuserverMoS - A Python-based server for Attorney Online,

tsuserverMoS A Python-based server for Attorney Online, forked from RealKaiser/tsuserverCC Requires Python 3.7+ and PyYAML. Changes/additions from tsu

1 Dec 30, 2021
DataShare - Simple library for data sharing between scripts and public functions calling

DataShare - Simple library for data sharing between scripts and public functions calling. Installation. Install code, Delete LICENSE, README, readme.t

Ivan Perzhinsky. 1 Dec 17, 2021
Multi-path load balancing is a method used by most of the real-time network to split the packets into different paths rather than transferring it through a single path

Multipath-Load-Balancing Method of managing incoming traffic by distributing and sharing load fairly among multiple routes from source to destination

Dharshan Kumar 6 Dec 10, 2022
Simple threaded Python Rickroll server. Listens on port 23 by default.

Terminal Rickroll Simple threaded Python Rickroll server. Listens on port 23 by default. Rickroll video made using Video-To-Ascii and the standard ric

AG 10 Sep 13, 2022