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 simple weather tool. I made this as a way for me to learn Python, API, and PyPi packaging.

A simple weather tool. I made this as a way for me to learn Python, API, and PyPi packaging.

Clint E. 105 Dec 31, 2022
Convert shellcode into :sparkles: different :sparkles: formats!

Bluffy Convert shellcode into ✨ different ✨ formats! Bluffy is a utility which was used in experiments to bypass Anti-Virus products (statically) by f

pre.empt.dev 305 Dec 17, 2022
Openstack bucket retention cli

Openstack bucket retention cli

Fatih Sarhan 3 Apr 03, 2022
Zecwallet-Python is a simple wrapper around the Zecwallet Command Line LightClient written in Python

A wrapper around Zecwallet Command Line LightClient, written in Python Table of Contents About Installation Usage Examples About Zecw

Priveasy 2 Sep 06, 2022
Lsp Plugin for working with Python virtual environments

py_lsp.nvim What is py_lsp? py_lsp.nvim is a neovim plugin that helps with using the lsp feature for python development. It tackles the problem about

Patrick Haller 55 Dec 27, 2022
Stephen's Obsessive Note-Storage Engine.

Latest Release · PyPi Package · Issues · Changelog · License # Get Sonse and tell it where your notes are... $ pip install sonse $ export SONSE="$HOME

Stephen Malone 23 Jun 10, 2022
Shazam is a Command Line Application that checks the integrity of the file by comparing it with a given hash.

SHAZAM - Check the file's integrity Shazam is a Command Line Application that checks the integrity of the file by comparing it with a given hash. Crea

Anaxímeno Brito 1 Aug 21, 2022
command line tool for frequent nmigen tasks (generate sources, show design)

nmigen-tool command line tool for frequent nmigen tasks (generate sources, show design) Usage: generate verilog: nmigen generate verilog nmigen_librar

Hans Baier 8 Nov 27, 2022
Program Command Line Interface (CLI) Sederhana: Pemesanan Nasi Goreng Hekel

Program ini merupakan aplikasi yang berjalan di dalam command line (terminal). Program ini menggunakan built-in library python yaitu argparse yang dapat menerima parameter saat program ini dijalankan

Habib Abdurrasyid 5 Nov 19, 2021
This is a Command Line program to interact with your NFTs, Cryptocurrencies etc

This is a Command Line program to interact with your NFTs, Cryptocurrencies etc. via the ThirdWeb Platform. This is just a fun little project that I made to be able to connect to blockchains and Web3

Arpan Pandey 5 Oct 02, 2022
Microsoft Azure CLI - Azure Command-Line Interface

A great cloud needs great tools; we're excited to introduce Azure CLI, our next generation multi-platform command line experience for Azure.

Microsoft Azure 3.4k Dec 30, 2022
Python wrapper and CLI utility to render LaTeX markup and equations as SVG using dvisvgm and svgo.

latex2svg Python wrapper and CLI utility to render LaTeX markup and equations as SVG using dvisvgm and svgo. Based on the original work by Tino Wagner

Matthias C. Hormann 4 Feb 18, 2022
Freaky fast fuzzy Denite/CtrlP matcher for vim/neovim

Freaky fast fuzzy Denite/CtrlP matcher for vim/neovim This is a matcher plugin for denite.nvim and CtrlP.

Raghu 113 Sep 29, 2022
A command line connect 4 game against a minimax agent.

A command line connect 4 game against a minimax agent.

1 Oct 17, 2021
CLI translator based on Google translate API

Translate-CLI CLI переводчик основанный на Google translate API как пользоваться ? запустить в консоли скомпилированный скрипт (exe - windows, bin - l

7 Aug 13, 2022
jenkins-tui is a terminal based user interface for Jenkins.

jenkins-tui 📦 jenkins-tui is a terminal based user interface for Jenkins. 🚧 ⚠️ This app is a prototype and in very early stages of development. Ther

Craig Gumbley 22 Oct 24, 2022
A very simple and lightweight ToDo app using python that can be used from the command line

A very simple and lightweight ToDo app using python that can be used from the command line

Nilesh Sengupta 2 Jul 20, 2022
Konsave lets use save your KDE Plasma customizatios and restore them very easily!

Konsave (Save Plasma Customization) A CLI program that will let you save and apply your KDE Plasma customizations with just one command! Als

439 Jan 02, 2023
Simple Terminal Styling for Python

escape Escape is a very simple terminal styling library largely inspired by the excellent javascript chalk library. There are other terminal styling l

Syed Abbas 8 Sep 03, 2019
NudeNet wrapper made to provide a simple cli interface to the library

Nudenet Wrapper. Small warpper script for NudeNet Made to provide a small and easy to use cli interface with the library. You can indicate a single im

1 Oct 20, 2021