RedHat Package Manager file
application/x-rpm
⚠️
High Risk Format
This file type can contain executable code. Always validate source and scan with antivirus before opening.
Magic Bytes
Offset: 0
ED AB EE DB
RedHat Package Manager (RPM) is a package management system and binary file format originally developed by Red Hat for Linux-based operating systems. It facilitates the automated installation, upgrading, and removal of software on distributions such as Red Hat Enterprise Linux, Fedora, and CentOS. Because these archives contain compiled binaries and scripts that frequently execute with administrative privileges, they represent a high security risk if acquired from unverified or untrusted sources.
Validation Code
How to validate .rpm files in Python
Python
def is_rpm(file_path: str) -> bool:
"""Check if file is a valid RPM by magic bytes."""
signature = bytes([0xED, 0xAB, 0xEE, 0xDB])
with open(file_path, "rb") as f:
return f.read(4) == signature
How to validate .rpm files in Node.js
Node.js
function isRPM(buffer: Buffer): boolean {
const signature = Buffer.from([0xED, 0xAB, 0xEE, 0xDB]);
return buffer.subarray(0, 4).equals(signature);
}
Go
func IsRPM(data []byte) bool {
signature := []byte{0xED, 0xAB, 0xEE, 0xDB}
if len(data) < 4 {
return false
}
return bytes.Equal(data[:4], signature)
}
API Endpoint
GET
/api/v1/rpm
curl https://filesignature.org/api/v1/rpm