DEB
application/x-debian-package
⚠️
High Risk Format
This file type can contain executable code. Always validate source and scan with antivirus before opening.
Magic Bytes
Offset: 0
21 3C 61 72 63 68 3E 0A 64 65 62 69 61 6E 2D 62 69 6E 61 72 79
The Debian Software Package (DEB) is an archive format developed and maintained by the Debian Project for distributing software on Debian-based operating systems. It is primarily used to facilitate the automated installation, configuration, and removal of software components via management utilities like dpkg and APT. Because installation requires administrative privileges and involves executing maintainer scripts, these files pose a high security risk if obtained from unverified repositories.
Validation Code
How to validate .deb files in Python
Python
def is_deb(file_path: str) -> bool:
"""Check if file is a valid DEB by magic bytes."""
signature = bytes([0x21, 0x3C, 0x61, 0x72, 0x63, 0x68, 0x3E, 0x0A, 0x64, 0x65, 0x62, 0x69, 0x61, 0x6E, 0x2D, 0x62, 0x69, 0x6E, 0x61, 0x72, 0x79])
with open(file_path, "rb") as f:
return f.read(21) == signature
How to validate .deb files in Node.js
Node.js
function isDEB(buffer: Buffer): boolean {
const signature = Buffer.from([0x21, 0x3C, 0x61, 0x72, 0x63, 0x68, 0x3E, 0x0A, 0x64, 0x65, 0x62, 0x69, 0x61, 0x6E, 0x2D, 0x62, 0x69, 0x6E, 0x61, 0x72, 0x79]);
return buffer.subarray(0, 21).equals(signature);
}
Go
func IsDEB(data []byte) bool {
signature := []byte{0x21, 0x3C, 0x61, 0x72, 0x63, 0x68, 0x3E, 0x0A, 0x64, 0x65, 0x62, 0x69, 0x61, 0x6E, 0x2D, 0x62, 0x69, 0x6E, 0x61, 0x72, 0x79}
if len(data) < 21 {
return false
}
return bytes.Equal(data[:21], signature)
}
API Endpoint
GET
/api/v1/deb
curl https://filesignature.org/api/v1/deb