Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

PackageHunter

The PackageHunter is a Python script that connects to a remote server via SSH and retrieves the distribution name and package information from the server. It provides the option to either print the information to the console or write it to a text file.

Table of Contents

Features

  • Retrieves the distribution name and package information from a remote server.
  • Provides options to print the information to the console or write it to a text file.
  • Checks server availability before attempting an SSH connection.
  • Supports customizable output filenames.

Requirements

  • Python 3.x
  • Paramiko (SSH library for Python)
  • distributions.json configuration file (see Configuration section)

To install the required dependencies, you can use pip:

pip install paramiko

Usage

  • To use the script, follow these steps:
  1. Clone the repository:
git clone https://github.com/trojkry/Get-packages-from-server.git
  1. Navigate to the script's directory.
  2. Run the script with desired options:
    • To print informations to the console
python3 packages.py <ip_address>
  • To write the information to a text file (customizable filename):
python3 packages.py <ip_address> -o w -f <custom_filename>
  • Replace <ip_address> with the IP address of the remote server.
  1. The script will prompt you for your SSH username and password, and then it will connect to the server and retrieve the requested information.

Configuration

  • The script uses a distributions.json configuration file to map Linux distribution names to the corresponding package retrieval commands. You can customize this file to add or modify distribution-specific commands.

Example distributions.json file:

{
  "distributions": {
    "ubuntu": "dpkg -l",
    "centos": "rpm -qa"
  }
}

License

This script is open-source and available under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages