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
IP Pinger - This tool allows you to enter an IP and check if its currently connected to a host

IP Pinger - This tool allows you to enter an IP and check if its currently connected to a host

invasion 3 Feb 18, 2022
Top server mcpe Indonesia!

server_mcpe Top server mcpe Indonesia! install pkg install python pkg install git git clone https://github.com/Latip176/server_mcpe cd server_mcpe pip

Muhammad Latif Harkat 2 Jul 17, 2022
Transfer files to and from a Windows host via ICMP in restricted network environments.

ICMP-TransferTools ICMP-TransferTools is a set of scripts designed to move files to and from Windows hosts in restricted network environments. This is

icyguider 269 Dec 20, 2022
wg-exporter is a simple yet effective Prometheus exporter for Wireguard

wg-exporter wg-exporter is a simple yet effective Prometheus exporter for Wireguard. What are the collected metrics ? General: wg_connected_peers: num

men1n2 3 May 20, 2022
AdaFruit Funhouse publishing Temperature, Humidity and Pressure to MQTT / Apache Pulsar

pulsar-adafruit-funhouse AdaFruit Funhouse publishing Temperature, Humidity and Pressure to MQTT / Apache Pulsar Device Get your own from adafruit Ada

Timothy Spann 1 Dec 30, 2021
Send files to your friends over network! (100mb max)

PyServed v2.0.1 Made by Shaurya Pratap Singh Installation Using pip(for stable releases.) - $ pip install pyserved Using Git (for latest updates) -

Sblip.dev 4 Mar 22, 2022
A simple implementation of an RPC toolkit

Simple RPC With Raw Sockets Repository for the Data network course project: Introduction In this project, you will attempt to code a simple implementa

Milad Samimifar 1 Mar 25, 2022
Slowloris is basically an HTTP Denial of Service attack that affects threaded servers.

slowrise-ddos-tool What is Slowloris? Slowloris is basically an HTTP Denial of S

DEMON cat 4 Jun 19, 2022
批量检查目标是否为cdn

🐸 Frog For Automatic Scan 🐶 Doge For Defense Evasion&Offensive Security Frog-checkCDN 批量检查目标是否为cdn Usage: python3 checkCDN.py list.txt list内可以为ip或者d

TimWhite 119 Dec 27, 2022
Learn how modern web applications and microservice architecture work as you complete a creative assignment

Micro-service Создание микросервиса Цель работы Познакомиться с механизмом работы современных веб-приложений и микросервисной архитектуры в процессе в

Григорий Верховский 1 Dec 19, 2021
Easy to use gRPC-web client in python

pyease-grpc Easy to use gRPC-web client in python Tutorial This package provides a requests like interface to make calls to gRPC-Web servers.

Sudipto Chandra 4 Dec 03, 2022
A Scapy implementation of SMS-SUBMIT and (U)SIM Application Toolkit command packets.

A Scapy implementation of SMS-SUBMIT and (U)SIM Application Toolkit command packets.

mnemonic 83 Dec 11, 2022
A simple GitHub Action that physically puts your senses on alert when your build/release fails

GH Release Paniker A simple GitHub Action that physically puts your senses on alert when your build/release fails Usage Requirements: Raspberry Pi, LE

Hemanth Krishna 5 Dec 20, 2021
Out-of-box Python RPC framework

typed-jsonrpc Out-of-box Python RPC framework. WIP. Make LSP easy for everyone. The conception of final usage: from typed_jsonrpc import * ls = Langu

Taine Zhao 4 Dec 28, 2021
Pesquise, filtre e obtenha informações sobre animes. ( Módulo PIP )

Pesquise, filtre e obtenha informações sobre animes. ( Módulo PIP )

AimCaffe 3 Jan 30, 2022
The C based gRPC (C++, Python, Ruby, Objective-C, PHP, C#)

gRPC - An RPC library and framework gRPC is a modern, open source, high-performance remote procedure call (RPC) framework that can run anywhere. gRPC

grpc 36.6k Dec 30, 2022
pureSxS - A tool to export Component Based Servicing packages from a full Windows installation

pureSxS A tool to export Component Based Servicing packages from a full Windows installation. Usage pureSxS.py source_mum destination pureSxS wor

Gamers Against Weed 3 Oct 03, 2022
List of ngrok alternatives and other ngrok-like tunneling software and services. Focus on self-hosting.

List of ngrok alternatives and other ngrok-like tunneling software and services. Focus on self-hosting.

Anders Pitman 7.3k Jan 03, 2023
Building a Robust IOT device which is customizable, encrypted, secure and user friendly

Building a Robust IOT device which is customizable, encrypted, secure and user friendly, which uses a single GPIO pin to extract multiple sensor values

1 Jan 03, 2022
The module that allows the collection of data sampling, which is transmitted with WebSocket via WIFI or serial port for CSV file.

The module that allows the collection of data sampling, which is transmitted with WebSocket via WIFI or serial port for CSV file.

Nelson Wenner 2 Apr 01, 2022