Py2Deb is a powerful and user-friendly GUI tool built with Python and Tkinter that allows developers to convert their Python scripts into .deb packages effortlessly. Whether you're building utilities for distribution or testing deployment pipelines, Py2Deb simplifies the packaging process into a few intuitive clicks.
- π Select any
.pyor.shscript and package it as a.deb - πΌ Optional icon file embedding
- π Easy configuration of control fields (Package Name, Version, Maintainer, etc.)
- βοΈ Autostart and Run-on-Install options (coming soon)
- π§Ή Cleanup build files after packaging
- π Live build output with error/success highlighting
- π¨ Modern and responsive Tkinter GUI
A .deb file is a Debian software package used by distributions such as Ubuntu, Kali Linux, and others. Py2Deb automatically creates the Debian package structure, control files, and post-install scripts if necessary.
- Python 3.6+
- Linux-based OS (Debian/Ubuntu/Kali/etc.)
dpkg,fakeroot,chmod,cp, anddesktop-file-validate(usually pre-installed on most distros)
Install dependencies:
sudo apt update
sudo apt install python3-tk fakeroot dpkg-dev
## π How to Use
Clone the repo:
git clone https://github.com/yourusername/py2deb.git
cd py2deb
Run the GUI:
python3 py2deb_gui.py
Steps inside the GUI:
Click on π Select Python File and choose your .py script.
(Optional) Click on πΌ Select Icon File (.png, .svg, etc.).
Fill in fields like package name, version, etc.
Click π Build .deb Package
Done! Your .deb file will be generated and saved in the dist/ folder.
##π Output Structure
After building, the structure looks like:
###mypackage_1.0_amd64.deb
dist/
βββ mypackage/
βββ DEBIAN/
β βββ control
β βββ postinst
βββ usr/
β βββ bin/
β βββ share/applications/
βββ opt/
π§ͺ Example Use Cases
β
Deploying internal Python automation tools
β
Sharing command-line or GUI utilities without exposing source code
β
Creating .deb packages for private/internal Linux deployments
β
Running custom post-install scripts (e.g., service setup, environment config)
β
Simulating .deb-based attack vectors in a safe lab
β
Studying Linux .deb trust exploitation techniques for defense
β
Red Team operations in isolated environments to test EDR/AV response
β
Teaching cybersecurity students how attackers might abuse package trust
β οΈ Ethical Notice
This tool is intended only for educational, research, and authorized security testing in isolated lab environments. Do not use it on unauthorized systems or for malicious purposes. Misuse may violate laws and ethical standards. Always operate under proper legal permission.
π§βπ» Author
Varun
Ethical Hacker & Cybersecurity Researcher
LinkedIn - www.linkedin.com/in/cyber-muntashir