Centauro - a command line tool with some network management functionality

Overview

Centauro

Ferramenta de rede

image

O Centauro é uma ferramenta de linha de comando com algumas funcionalidades de gerenciamento de rede, tais como:

Apesar de ser desenvolvido especialmente para o Windows, que tem problemas em encontrar ferramentas do tipo para download, tenho tentado deixar compatível com o Linux. Por favor comunique qualquer bug encontrado ou mande um pull request com a correção. Toda ajuda é bem-vinda!

  • Scanner de portas TCP;
  • Descoberta de hosts; No prompt de comando, use passe o argumento --help para saber como usá-lo.
python centauro.py --help

Modos de operação

Para selecionar o modo de operação, passe o modo escolhido para o parâmetro -m. Por exemplo, para usar o modo discover:

python centauro.py -m discover 
   

   
  • Scanner: modo padrão de operação do centauro. Caso o parâmetro -m seja omitido, o centauro operará como scanner. Esse modo exige os parâmetros -a ALVO e -i INTERVALO. O alvo deve ser um endereço de IP ou nome do dispositivo alvo. O intervalo deve ser um intervalo de portas a serem scaneadas. Exemplo de uso:

    python centauro.py -a 192.168.0.1 -i 1-80
    

    Nesse exemplo, o scanner irá scanear as portas de 1 a 80 do host 192.168.0.1.

  • Discover: modo de operação para descobertas de hosts. Para usá-lo é necessário passar o endereço da rede junto à máscara de rede separados por uma barra ao prâmetro -r, como no exemplo a seguir:

    python centauro.py -m discover -r 192.168.0.0/255.255.255.0
    

    Nesse exemplo, o discover vai verificar os hosts de 192.168.0.1 até 192.168.0.254.

O código

Bom, o código não está limpo, realmente, mas nada que bastante paciência não resolva. Vamos tentar descomplicar tudo isso!

A classe Centauro:

A classe centauro não tem nenhum atributo no método construtor (sim, é verdade, por enquanto). Essa "peculiaridade" é devido ao fato de que a maioria das variáveis são restritas a um método da classe. Por exemplo, a variável self.interval da classe só é acessada pelo método scanner, portanto, achei conveniente declará-la no método scanner.

Em consequência da ausência de declarações no método construtor, são é necessário passar argumentos ao instânciar um objeto a partir dessa classe:

centauro = Centauro()

O método scanner(host, intervalo, timeout=1):

Esse é o método responsável pelo escaneamento de portas. Ele usa o recurso de multiplas threads e, portanto, o processo é mais ágil.

O método discover(rede):

Esse método recebe como argumento em formato de string para a descoberta de hosts.

Atributos:

  • self.host: alvo escaneado pelo método scanner
  • self.interval: intervalo de portas a ser escaneado pelo método scanner
  • self.timeout: tempo limite de tentativa de conexão TCP no método scanner
  • self.opened: resultado do scanner que retorna as portas abertas no alvo
  • self.hosts_ativos: resultado do discover que retorna os hosts ativos
Owner
Newbie
A CLI password generator

passgen - A CLI password generator Usage python3 main.py arguments Arguments Argument Short Description --length -l The length of the password to ge

1 Nov 13, 2021
Python3 command-line tool for the inference of Boolean rules and pathway analysis on omics data

BONITA-Python3 BONITA was originally written in Python 2 and tested with Python 2-compatible packages. This version of the packages ports BONITA to Py

1 Dec 22, 2021
doq (python docstring generator) extension for coc.nvim

coc-pydocstring doq (python docstring generator) extension for coc.nvim Install CocInstall: :CocInstall coc-pydocstring vim-plug: Plug 'yaegassy/coc-p

yaegassy 27 Jan 04, 2023
Get latest astronomy job and rumor news in your command line

astrojobs Tired of checking the AAS job register and astro rumor mill for job news? Get the latest updates in the command line! astrojobs automaticall

Philip Mocz 19 Jul 20, 2022
Joji convert a text to corresponding emoji if emoji is available

Joji Joji convert a text to corresponding emoji if emoji is available How it Works ? 1. There is a json file with emoji names as keys and correspondin

Gopikrishnan Sasikumar 28 Nov 26, 2022
Jupyter notebook client in neovim

🪐 Jupyter-Nvim Read jupyter notebooks in neovim Note: The plugin is still in alpha stage 👾 Usage Just open any *.ipynb file and voila! ✨ Contributin

Ahmed Khalf 85 Dec 29, 2022
A command line tool to publish ads on ebay-kleinanzeigen.de

kleinanzeigen-bot Feedback and high-quality pull requests are highly welcome! About Installation Usage Development Notes License About kleinanzeigen-b

83 Dec 26, 2022
Fast as FUCK nvim completion. SQLite, concurrent scheduler, hundreds of hours of optimization.

Fast as FUCK nvim completion. SQLite, concurrent scheduler, hundreds of hours of optimization.

i love my dog 2.8k Jan 05, 2023
TUIFIManager - A cross-platform terminal-based file manager

TUIFI Manager A cross-platform terminal-based file manager (and component), mean

142 Dec 26, 2022
A Neat Application To Manage Your To-Do Lists.

WTD - What To Do? A Neat Application To Manage Your To-Do Lists. One folder can only have one to-do file. Running wth without any subcommands executes

Adam Vajda 1 Oct 24, 2021
Notion-cli-list-manager - A simple command-line tool for managing Notion databases

A simple command-line tool for managing Notion List databases. ✨

Giacomo Salici 75 Dec 04, 2022
A lightweight Python module and command-line tool for generating NATO APP-6(D) compliant military symbols from both ID codes and natural language names

Python military symbols This is a lightweight Python module, including a command-line script, to generate NATO APP-6(D) compliant military symbol icon

Nick Royer 5 Dec 27, 2022
Python Library and CLI for exporting MySQL databases

expdb Python library and CLI for exporting MySQL databases Installation Pre-requisites MySQL server Python 3.9+ Using git Clone the repository to your

Devansh Singh 1 Nov 29, 2021
Skiller - With this payload you can control the target computer with (cmd)

Skiller - With this payload you can control the target computer with (cmd)

1 Jan 02, 2022
lfb (light file browser) is a terminal file browser

lfb (light file browser) is a terminal file browser. The whole program is a mess as of now. In the feature I will remove the need for external dependencies, tidy up the code, make an actual readme, a

2 Apr 09, 2022
A basic molecule viewer written in Python, using curses; Thus, meant for linux terminals

asciiMOL A basic molecule viewer written in Python, using curses; Thus, meant for linux terminals. This is an alpha version, featuring: Opening defaul

Dominik Behrens 328 Dec 11, 2022
This is a CLI program which can help you generate your own QR Code.

Python-QR-code-generator This is a CLI program which can help you generate your own QR Code. Single.py This will allow you only to input a single mess

1 Dec 24, 2021
DShell, a tool that combines with discord.py and Jishaku to present to you, shell channels.

Discord shell or dshell for short is a Python package that combines with discord.py and Jishaku to transform an ordinary Discord channel into one capable of running bash commands using a Discord bot.

11 Nov 15, 2022
Palm CLI - the tool-belt for data teams

Palm CLI: The extensible CLI at your fingertips Palm is a universal CLI developed to improve the life and work of data professionals. Palm CLI documen

Palmetto 41 Dec 12, 2022
Proman is a simple tool for managing projects through cli.

proman proman is a project manager. It helps you manage your projects from a terminal. The features are listed below. Installation Step 1: Download or

Arjun Somvanshi 2 Dec 06, 2021