You are not logged in.

#1 Yesterday 04:45:18

Ainish
Member
Registered: 2026-11-28
Posts: 3

Advice on tracking process internet usage to identify malware.

So I think my linux install is compromised with some spyware or malware. For the past several months I have been tracking my connectivity, so I have a full readout of what ports my pc tries to access, how much is sent, and some of the packets that were sent. Whether I am online or offline there will be moments where my pc will try to connect to a port. These ports are random and at this point I have an exhaustive list. Once I detect it and block it with my firewall, a different port will show up at a later time. It shows up when I am connected to steam or hosting an ollama session, basically anytime an app tries to connect to localhost (or the internet, but I rarely connect). It does not show up when linux specific connections fail, like chrony updates, Only when apps are behaving as if I am connected to the internet. It appears I have a memory leak, too, as after running steam for a while, my ram usage increased by about a gb even if steam and everything else is closed. Through analysis, the ram leak seems to be related to konsole. I checked using ps for specific mb values and the only increase is the amount of ram konsole takes up. I believe both events may be connected but I have no idea how I would go about finding what triggers the port connection events. It is clear to me that this is not typical behavior for an operating system, and the connection attempts have occurred multiple times and outside of any specific app. I originally thought it was a method of logging info via mp games on steam(and related to steam or multiplayer features/game activity logging), but quickly found out that it happens offline and if steam is not running.

Ports have been confirmed with wireshark.(usually from tcpdump logs)

A total of 53 ports have been logged and blocked by me in this manner. I am happy to post them if you think it will help. A bulk of them only send a small amount of data, but I have observed cases where that is not true. I have a bunch of logs where something tried to send 50kb of data via 33334(speedtrace). A lot of connections will send only 9 packets, 638 bytes of data with an average size of 71 bytes.

The cases where this behavior has been observed:
    'Launching steam'
    'Launching a game on steam'
    'While a game is running'
             One time I caught a port just before my game crashed and I believe the two events are connected. I have 40 hours in that game and have not crashed once (except immediately after something on my pc tried to reach port 44900(M3DA))
    'exiting a game on steam'
    'running ollama'

Cases where ports have not been logged.
    'automatic update checks'
    'baloo or other core program trying to connect'
    'chrony syncs'
    'basically any function that requires connectivity but knows that the pc is offline'

    I have tried:
    capturing packets and decrypting with wireshark but it is useless as I dont have the private keys
   
    I pretty much block them and log them in a file when it occurs and that has been the extent of it.

I think the next step is for me to log specific applications as they try to connect, but I would like to know the best route to do that (seeing as ss didnt turn up anything and typical shit like lsof -i doesnt either). These connections only occur every so often, once a day is rare. So a logging system that constantly prints data to a file is inefficent and will quickly bog down my pc. I am just starting out in terms of network analysis and competency in terms of scripts, so I reached a point where I am unsure how to proceed. There may be a better way to script ss to do it, though I am somewhat convinced it did not pick up the data the one time I managed to catch it(I had it output to a file every second, and this happened to be while a connection attempt occurred).

This is my first post on this forum so I apologize if its long winded, I didnt know where else to go. I figured most of the data would be useful and if I end up identifying the cause I am more than happy to share that info.

Last edited by Ainish (Yesterday 04:55:42)

Offline

#2 Yesterday 04:56:46

killertofus
Member
Registered: 2025-02-10
Posts: 300

Re: Advice on tracking process internet usage to identify malware.

please post your journal

sudo journalctl -b | nc termbin.com 9999 

for the previous (-1) one.

 sudo journalctl -b -1 | nc termbin.com 9999 

I Have Linux Perl Can i Download Gnome???

Offline

#3 Yesterday 06:34:05

NorrisFByrd
Member
Registered: 2026-11-29
Posts: 7

Re: Advice on tracking process internet usage to identify malware.

Before chasing malware, I would try to tie each connection to a process first, since ss on its own will miss short lived ones. A lighter approach is to log new outbound connections with nftables and include the UID, then match the time against what was running. Running ss -tnp in a short loop around Steam or Ollama starts can help too, but the firewall log is easier to leave running. Posting a few of those logged ports with the time and the process would make it much easier to tell normal Steam traffic apart from something odd.

Offline

#4 Today 06:21:58

cryptearth
Member
Registered: 2024-02-03
Posts: 2,442

Re: Advice on tracking process internet usage to identify malware.

from what's given to me it sounds like mostly telemetry (fun fact: since early on steam does collect quite a lot of information even outside the monthly hardware survey, yet noone seem to bother as much as for others like windoze)
what's unclear is what you mean by random ports: if you talk about the local source port: that's normal, what might be unusual would be changing destination ports - although even this can be normal like ftp pasv mode

Offline

#5 Today 20:26:43

Ainish
Member
Registered: 2026-11-28
Posts: 3

Re: Advice on tracking process internet usage to identify malware.

I noticed an outbound connection to 40841 CSCP at the time the bluez activation request fails. This time I was launching steam. This is the first time I correlated it to journal.

I have previously noticed that steam likes to contact its servers when you plug in or unplug a usb device on linux, but at this point I doubt its a steam process. There have been several different cases where this behavior has been observed outside of steam. I make sure steam and all associated processes are closed each time I exit.

23:08:41 (hostname) mtp-probe: bus: 1, device: 3 was not an MTP device
23:08:58 (hostname) steam-runtime-steam-remote[9751]: E: Steam is not running: No such device or address
23:09:02 (hostname) dbus-broker-launch: Activation request for 'org.bluez' failed: The systemd unit 'dbus-org.bluez.service' could not be found.
23:09:03 (hostname) rtkit-daemon: Successfully made thread 10109 of process 9950 (/path/to/steam) owned by '1001' high priority at nice level -10.
23:09:03 (hostname) rtkit-daemon: Successfully made thread 10110 of process 9950 (/path/to/steam) owned by '1001' high priority at nice level -10.
23:09:06 (hostname) kded6: Failed to notify "Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken."
23:09:41 (hostname) plasma_waitforname: WaitForName: Service was not registered within timeout
23:09:41 (hostname) systemd: dbus-:1.2-org.freedesktop.Notifications@1.service: Main process exited, code=exited, status=1/FAILURE
23:09:41 (hostname) systemd: dbus-:1.2-org.freedesktop.Notifications@1.service: Failed with result 'exit-code'.

Here are the logs from journal of a steam launch later on where no such behavior was recorded. Kded6 failed to connect and threw a notification just 8 seconds after I noticed the port(and after I started steam). In the following logs 35 seconds pass with no notification and no additional connection attempts.

I have been watching my journal and kded6 has attempted to connect somewhere without triggering any data exchange in other cases, but that is the only noticable difference in journal at least.

If it a sketchy process I doubt it will show up in journal but eh

11:50:05 (hostname) systemd: Started app-org.kde.konsole.scope.
11:50:07 (hostname) steam-runtime-steam-remote: E: Steam is not running: No such device or address
11:50:11 (hostname) dbus-broker-launch: Activation request for 'org.bluez' failed: The systemd unit 'dbus-org.bluez.service' could not be found.
11:50:12 (hostname) systemd: Started dbus-:1.2-org.freedesktop.Notifications@2.service.
11:50:12 (hostname) rtkit-daemon: Successfully made thread 7505 of process 7339 (/path/to/steam/) owned by '1001' high priority at nice level -10.
11:50:12 (hostname) rtkit-daemon: Successfully made thread 7506 of process 7339 (/path/to/steam/) owned by '1001' high priority at nice level -10.
11:50:41 (hostname) systemd: Started app-org.kde.konsole.service - Konsole - Terminal.

I did try to configure nftables to output tcp/udp connection attempts in journal but I am still learning its connection tracking capabilities, in the scenario described I would also need a consistent log of running processes I think.

I am using etherape as a way to monitor traffic and it's typically running these days, so when some connection occurs this is all the immediate information I have access to: (I do have some stored logs and packet captures of times when I happened to catch it in the past but a bulk of the data is just observational)

f9D6-8vG.webp
Typically steam will show up in this as data via tcp-unknown, IPP, ICMP/V6 I haven't observed consistent behavior where that information has changed. Except in cases reported already. I did some captures of steam data a while ago and iirc its all between the 40000 to 50000 range
cuHNZ0q2.webp

Here is a log from a verbose output of tcpdump where an app was connecting via speedtrace.

 localhost.speedtrace > localhost.57343: Flags [.], cksum 0xfe28 (incorrect -> 0xd3e5), ack 38, win 63, options [nop,nop,TS val 3153150091 ecr 459133680], length 0
11:40:13.304854 lo    In  IP (tos 0x0, ttl 64, id 35967, offset 0, flags [DF], proto TCP (6), length 56)

I am mostly looking to identify which app initiates these kind of things. This behavior stands out to me, I have always done light monitoring of my traffic on linux, at least for the past decade or so, and this is new and somewhat strange behavior.

Last edited by Ainish (Today 22:01:15)

Offline

#6 Today 20:43:19

-thc
Member
Registered: 2017-03-15
Posts: 1,244

Re: Advice on tracking process internet usage to identify malware.

Please use "code" tags to format your post.

Are you sure you aren't  chasing ghosts here?

By using port names ("speedtrace"/"CSCP") normal loopback to loopback communication like this

localhost.speedtrace > localhost.57343: Flags [.], cksum 0xfe28 (incorrect -> 0xd3e5), ack 38, win 63, options [nop,nop,TS val 3153150091 ecr 459133680], length 0 11:40:13.304854 lo    In  IP (tos 0x0, ttl 64, id 35967, offset 0, flags [DF], proto TCP (6), length 56)

sounds mysterious - but the port numbers in such a communication are completely arbitrary and doesn't mean anything.

Offline

#7 Today 20:46:59

cryptearth
Member
Registered: 2024-02-03
Posts: 2,442

Re: Advice on tracking process internet usage to identify malware.

well - without source and destination your post is quite pointless
for any meaningful help we need at least the target destition - which should already tell about what data are sent depend on where they're sent to

Offline

#8 Today 22:08:27

Ainish
Member
Registered: 2026-11-28
Posts: 3

Re: Advice on tracking process internet usage to identify malware.

Yeah, its really strange behavior. I've used etherape since like 2020, it's been on a variety of distros and running consistently. This behavior is inconsistent with past events, I can't say that I am sure I am not chasing ghosts, as some functionality in kde could have changed over time, or it could be something harmless. I am mostly looking for tools to diagnose when such things occur , something similar but a bit more effective than ss or lsof -i.

I made the post originally in search of a way to identify which specific process attempts to connect to anything when that connection is initiated, as my own attempts to do so with ss failed to identify the process.

As for destinations, this behavior is usually recorded while my pc is offline. I am monitoring nodes now but I fairly confident that it will just return localhost shit unless I happen to capture it while I am connected to the internet.

Offline

Board footer

Powered by FluxBB