Skip to content

Instantly share code, notes, and snippets.

@win3zz
Created June 18, 2026 15:47
Show Gist options
  • Select an option

  • Save win3zz/9b5f7afedd515961eb8c11a307740daf to your computer and use it in GitHub Desktop.

Select an option

Save win3zz/9b5f7afedd515961eb8c11a307740daf to your computer and use it in GitHub Desktop.

This script creates a spreadsheet (packages.csv) listing every software package manually installed on a Linux system, along with its executable commands and a brief description.

echo 'Package,Commands,Description' > packages.csv

for pkg in $(apt-mark showmanual); do
    desc=$(dpkg-query -W -f='${Description}' "$pkg" 2>/dev/null | head -n1)

    cmds=$(dpkg -L "$pkg" 2>/dev/null \
        | grep -E '/bin/' \
        | xargs -r -n1 basename \
        | sort -u \
        | paste -sd ';' -)

    printf '"%s","%s","%s"\n' \
        "$pkg" "$cmds" "$desc" >> packages.csv
done

Example output: Screenshot 2026-06-18 211302

For a pentester, this is used for post-exploitation inventory—allowing them to quickly identify pre-installed tools they can exploit to elevate their privileges (GTFOBins) or use to sneakily "live off the land" without uploading loud hacking tools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment