Skip to main content

A simple CLI tool to retrieve the N top most used ports

Project description


topmostp

topmostp

Table of Contents

Overview

topmostp (Topmost Ports) is a tool that allows you to quickly retrieve the most used ports. The source of the ranking is the nmap-services in the nmap repo.

At SecSI we found it useful to get this information to use it in a pipeline of scripts.

Install

You can easily install it by running:

pip install topmostp

Usage

topmostp --help

This will display help for the tool. Here are all the commands it supports.

 Usage: topmostp [OPTIONS] COMMAND [ARGS]...                                                         
                                                                                                     
╭─ Options ─────────────────────────────────────────────────────────────────────────────────────────╮
│ --help  -h        Show this message and exit.                                                     │
╰───────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ────────────────────────────────────────────────────────────────────────────────────────╮
│ find     Find info about about a specific service                                                 │
│ stats    Retrieve stats about a port                                                              │
│ top      Retrieve list of ports by frequency (TCP, UDP, SCTP or all of them. Defaults to 'all')   │
│ update   Update ports list                                                                        │
╰───────────────────────────────────────────────────────────────────────────────────────────────────╯

This is the help for the topmostp top command:

 Usage: topmostp top [OPTIONS] N                                              
                                                                              
 Retrieve list of ports by frequency (TCP, UDP, SCTP or all of them. Defaults 
 to 'all')                                                                    
                                                                              
╭─ Arguments ────────────────────────────────────────────────────────────────╮
│ *    n      INTEGER  [default: None] [required]                            │
╰────────────────────────────────────────────────────────────────────────────╯
╭─ Options ──────────────────────────────────────────────────────────────────╮
│ --type    -t      [tcp|udp|sctp|all]  [default: all]                       │
│ --silent  -s                          Display only results in output       │
│ --help    -h                          Show this message and exit.          │
╰────────────────────────────────────────────────────────────────────────────╯

This is the help for the topmostp find command:

 Usage: topmostp find [OPTIONS] SERVICE                                       
                                                                              
 Find info about about a specific service                                     
                                                                              
╭─ Arguments ────────────────────────────────────────────────────────────────╮
│ *    service      TEXT  [default: None] [required]                         │
╰────────────────────────────────────────────────────────────────────────────╯
╭─ Options ──────────────────────────────────────────────────────────────────╮
│ --help  -h        Show this message and exit.                              │
╰────────────────────────────────────────────────────────────────────────────╯

This is the help for the topmostp stats command:

 Usage: topmostp stats [OPTIONS] PORT PORT_TYPE:{tcp|udp|sctp}                
                                                                              
 Retrieve stats about a port                                                  
                                                                              
╭─ Arguments ────────────────────────────────────────────────────────────────╮
│ *    port           INTEGER                   [default: None] [required]   │
│ *    port_type      PORT_TYPE:{tcp|udp|sctp}  [default: None] [required]   │
╰────────────────────────────────────────────────────────────────────────────╯
╭─ Options ──────────────────────────────────────────────────────────────────╮
│ --help  -h        Show this message and exit.                              │
╰────────────────────────────────────────────────────────────────────────────╯

A pratical example is the following:

naabu -p $(topmostp top 15 -s) -host secsi.io

In this snippet the output of topmostp is used to retrieve the list of the top 15 ports and it is chained with the naabu port scanning tool.

Demo

demo

Credits

Developed by Angelo Delicato @SecSI

License

topmostp is released under the MIT LICENSE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

topmostp-0.1.9.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

topmostp-0.1.9-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file topmostp-0.1.9.tar.gz.

File metadata

  • Download URL: topmostp-0.1.9.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.0 Linux/6.2.0-1018-azure

File hashes

Hashes for topmostp-0.1.9.tar.gz
Algorithm Hash digest
SHA256 edce21f222c8e82ac1a7622559216b2f079cffbb9ea17dbde1ef5bc77726a619
MD5 1c5d8448d326462592f52cb21cef8fe9
BLAKE2b-256 b0a89527fdc287c2667800a817148dbcc6cfe65eee15b94b82009df4b3bdfe9b

See more details on using hashes here.

File details

Details for the file topmostp-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: topmostp-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.0 Linux/6.2.0-1018-azure

File hashes

Hashes for topmostp-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 f0a8b23486d0480ad4e3bb2a435e95351728bef009485cc249253dc7f2cf8e03
MD5 7a942d4fdd4bcbddf9f25dd52bf9091e
BLAKE2b-256 d5a1ab48c93016ec1e05f909b5dc26d0c722c0196895afe121bc1c51067d19db

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page