akde/infosec

Information security is ultimately about managing risk


Show info:

dpkg --info $package

Show all files of a deb:

dpkg -L $package

Show all installed packages:

dpkg -l

Search for a file or path:

dpkg -S htpasswd

Show why a pack­age was installed:

apitude why apache2-utils

About deb files

A deb file is a ar archive with this structure:

$ ar t example.deb
debian-binary
control.tar.xz (or .gz or .zst)
data.tar.xz (or .gz or .zst)
  • debian-bina­ry is a text file with the ver­sion, cur­rent­ly “2.0”
  • control.tar.xz con­tains meta­da­ta and scripts.
  • data.tar.xz con­tains the files to be installed/copied.

There are these pack­age formats:

  • Real pack­age
  • Meta­pack­age is a pack­age with­out own con­tent which only ref­er­ences oth­er packages.
  • Vir­tu­al pack­age is just an addi­tion­al name for anoth­er pack­age (basi­cal­ly a link)

Using other architectures

dpkg --print-architecture
dpkg --add-architecture i386

Getting / Rebuilding (debian-based) packages

Get source of a package:

apt source $name

To get all need­ed build tools, into the source code direc­to­ry from the package:

apt build-dep ./

Change the ver­sion number

dch --local version-identifier

Per­form the changes.

Then, build the package.

dpkg-buildpackage -us -uc -b

And install it.

dpkg -i $name.deb

Leave a Reply

About

Personal collection of some infosec stuff. Primary purpose of this site is to collect and organize for myself.

Note: Some content is not publicly visible due to copyright issues. Therefore, some links could be broken.

Checklists

Categories

Checklists: Ports

python -c 'import pty;pty.spawn("/bin/bash")';

python3 -c 'import pty;pty.spawn("/bin/bash")';