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
Tiny JSON RPC via HTTP library.

jrpc Simplest ever possible Asynchronous JSON RPC via HTTP library for Python, backed by httpx. Installation pip install async-jrpc Usage Import JRPC

Onigiri Team 2 Jan 31, 2022
Tool for quickly gathering information from Shodan.io about the number of IPs which satisfy large number of different queries

TriOp Tool for quickly gathering information from Shodan.io about the number of IPs which satisfy large number of different queries For furt

Jan Kopriva 27 Nov 03, 2022
An ansible playbook to set up wireguard server.

Poor man's VPN (pay for only what you need) An ansible playbook to quickly set up Wireguard server for occasional personal use. It takes around five m

Amrit Bera 613 Dec 25, 2022
A benchmark for stateful fuzzing of network protocols

A benchmark for stateful fuzzing of network protocols

3 Apr 25, 2022
Ultimate transformation library that supports validation, contexts and aiohttp.

Trafaret Ultimate transformation library that supports validation, contexts and aiohttp. Trafaret is rigid and powerful lib to work with foreign data,

Mikhail Krivushin 174 Nov 27, 2022
Scan any IP address except IPv6 using Python.

Port_Scanner-python To use this tool called "Console Port Scanner", you need to enter an IP address (NOT IPv6). It might take a long time to scan port

1 Dec 24, 2021
Solismod - A script subscribes to MQTT topics and waits for a message

SolisMod This is a first attempt to modify Solis inverter settings As SolisMon3,

9 Nov 14, 2022
Official ProtonVPN Linux app

ProtonVPN Linux App Copyright (c) 2021 Proton Technologies AG This repository holds the ProtonVPN Linux App. For licensing information see COPYING. Fo

ProtonVPN 288 Jan 01, 2023
Light, simple RPC framework for Python

Agileutil是一个Python3 RPC框架。基于微服务架构,封装了rpc/http/orm/log等常用组件,提供了简洁的API,开发者可以很快上手,快速进行业务开发。

16 Nov 22, 2022
Get Your Localhost Online - Ngrok Alternative

Get Your Localhost Online - Ngrok Alternative

Azimjon Pulatov 442 Jan 04, 2023
It's a little project for change MAC address, for ethical hacking purposes

MACChangerPy It's a small project for MAC address change, for ethical hacking purposes, don't use it for bad purposes, any infringement will be your r

Erick Adriano Nunes da Silva 1 Mar 11, 2022
A light-weight open-source project CLI utility for showing services running on ports in a host

Portable Port Scanner (ppscanner) Portable Port Scanner (ppscanner) is a light-weight open-source CLI utility that leverages on nmap to make quick and

1 Oct 30, 2021
Very simple and tiny file sharing service written in python

Simple File sharing tool Sharing client usage (You will need to use python3 for linux) main.py --send -f file/path Optionnal flags : pwd : set a passw

2 Jul 26, 2022
Best discord webhook spammer using proxy (support all proxy type)

Best discord webhook spammer using proxy (support all proxy type)

Iтѕ_Ѵιcнч#1337 25 Nov 01, 2022
AV Evasion, a Red Team Tool - Fiber, APC, PNG and UUID

AV Evasion, a Red Team Tool - Fiber, APC, PNG and UUID

9 Mar 07, 2022
A non-custodial oracle and escrow system for the lightning network. Make LN contracts more expressive.

Hodl contracts A non-custodial oracle and escrow system for the lightning network. Make LN contracts more expressive. If you fire it up, be aware: (1)

31 Nov 30, 2022
Automatic Proxy scraper and Proxy-rotating Nitro Generator.

Automatic Proxy scraper and Proxy-rotating Nitro Generator.

Tawren007 2 Nov 08, 2021
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
This tool is for finding more detailed information of an IP Address.

This tool is for finding more detailed information of an IP Address.

3 Oct 08, 2021
The World Most Fastest Proxy Checker In Python, Maybe?!

The World's Most Fastest Proxy Checker In Python, Maybe?! Features Based on Python 3.7+ Save Valid Porixes into the custom file Multi-Thread Fully Asy

Cyber 4 Feb 10, 2022