You are not logged in.

#1 2024-06-18 11:40:45

among666
Member
Registered: 2024-06-10
Posts: 10

Checking integrity of the system

I want a command to check if the kernel or any files and programs have been maliciously tampered with. Pacman -Qkk linux-lts gives me a result of 0 altered files but I dont know how it considers a file trusted.

Offline

#2 2024-06-18 11:55:32

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,672
Website

Re: Checking integrity of the system

pacman -Qkk confirms the files size, checksum, and permissions have not changed.

Offline

#3 2024-06-18 11:58:21

gromit
Administrator
From: Germany
Registered: 2024-02-10
Posts: 1,536
Website

Re: Checking integrity of the system

Are you checking just because or do you actually suspect that somebody tampered with your system?

Offline

#4 2024-06-18 12:28:58

among666
Member
Registered: 2024-06-10
Posts: 10

Re: Checking integrity of the system

Allan wrote:

pacman -Qkk confirms the files size, checksum, and permissions have not changed.

I got sha256 checksum mismatch /etc/pacman.d/conf mismatch  size mismatches permission mismatches and a gid mismatch is this normal? How far must the filesize and permissions deviate from what is considered normal?

Offline

#5 2024-06-18 12:30:06

among666
Member
Registered: 2024-06-10
Posts: 10

Re: Checking integrity of the system

gromit wrote:

Are you checking just because or do you actually suspect that somebody tampered with your system?

I know the computer has been tampered with but I want to know how I could tell.

Offline

#6 2024-06-18 12:32:35

gromit
Administrator
From: Germany
Registered: 2024-02-10
Posts: 1,536
Website

Re: Checking integrity of the system

I think https://lists.archlinux.org/archives/li … PYIWU75XQ/ also is useful for this purpose if I understand it correctly

Offline

#7 2024-06-18 21:43:53

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,672
Website

Re: Checking integrity of the system

among666 wrote:
Allan wrote:

pacman -Qkk confirms the files size, checksum, and permissions have not changed.

I got sha256 checksum mismatch /etc/pacman.d/conf mismatch  size mismatches permission mismatches and a gid mismatch is this normal? How far must the filesize and permissions deviate from what is considered normal?

My guess is you edited a configuration file.  Pacman can not tell the difference between your edits and malicious edits.

Offline

#8 2024-06-18 22:30:27

among666
Member
Registered: 2024-06-10
Posts: 10

Re: Checking integrity of the system

Allan wrote:
among666 wrote:
Allan wrote:

pacman -Qkk confirms the files size, checksum, and permissions have not changed.

I got sha256 checksum mismatch /etc/pacman.d/conf mismatch  size mismatches permission mismatches and a gid mismatch is this normal? How far must the filesize and permissions deviate from what is considered normal?

My guess is you edited a configuration file.  Pacman can not tell the difference between your edits and malicious edits.

Does this mean the command pacman -Qkk is useless?

Offline

#9 2024-06-18 23:12:22

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,542
Website

Re: Checking integrity of the system

Not at all, it gives you a list of files to check against your secure, offsite backups.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#10 2024-06-19 08:27:26

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,959

Re: Checking integrity of the system

Except the databases aren't signed - it's a maintainence tool, not a security one.

If you want to check the system against malicious tampering
1. this *has* to happen offline (ie. w/o booting the system because the compromisation might hide itself)
2. You need a known good external and locked away database of valid hashes for every file on the system - or the entire drive.
A malicious actor could simply shadow binaries in paths not tracked by the package manager (/usr/local) or even attack a specific user w/ LD_LIBRARY_PATH & LD_PRELOAD, so "pacman -Qkk looks god" doesn't indicate "this system hasn't been compromised" at all.

Also the rule of thumb is that a known compromised system can no longer be trusted and has to be nuked and replaced from a known good master/backup - attacks don't require system file replacements at all - a subtle touch-up of the sshd config might get the job done.

And that's even ignoring concerns regarding the UEFI - or that you might have actively (but unknowingly) installed malware and signed off on it.

Online

Board footer

Powered by FluxBB