Reading width
Wide uses the full column for everything, text, diagrams, code, and exercises. Narrow keeps the standard reading width.
Text size
Scales the body text. Headings and code blocks keep their size.
In this section
Linux Initial Access Investigation: Web Shells in the Access Log and SSH Brute Force in auth.log
Introduction
Almost every intrusion into a Linux server comes through one of two doors. The first is the web application: a request makes the server run code it should not, through an upload, an injection or a vulnerable component, and the intruder arrives as the account the web server runs as.
The second is SSH: a valid password or key is presented to sshd, and the intruder arrives as whoever that credential belongs to.
The two leave different records, in different logs, and an investigation has to know which door it is looking for before it can tell an entry from the background noise every internet-facing server collects. This lesson reads one case through each door.
Two doors into a Linux server, and the record each one leaves.
The figure pairs each door with its record, and the order of this lesson follows it: the web door and its log, then the SSH door and its log. The web door is written in the access log; the SSH door is written in the authentication log. Neither log records the other door, and each records far more ordinary traffic than attacks.
The Web Door
Every request from one addressSRV-NGE-MCR-WEB01 from lesson 0.1 served 659 requests from 10 addresses in the collected access log. Most came from internal clients reading the documentation portal. The intruder's came from 203.0.113.99:
02:10:44 GET /docs/ 200
02:11:22 GET /upload.php 200
02:13:22 POST /upload.php 200
02:14:03 POST /.well-known/acme-challenge/shell.php 200
02:14:11 POST /.well-known/acme-challenge/shell.php 200
... 17 more POSTs to the same path ...
02:28:05 POST /.well-known/acme-challenge/shell.php 200
23 requests in about seventeen minutes. One page view of the documentation, then the upload form fetched, then the form submitted, then 20 POSTs to a file that had not existed a minute earlier. Every request was answered with status 200, and every one carried the same browser identification string.
Read as a sequence, the requests are the entry. The upload at 02:13:22 created the shell, as lesson 0.2 matched to the second against the file's own times. The first request to the shell at 02:14:03 is the first moment the intruder could run commands on the server, as the web server's account.
Module 4's lesson on naming the web application vector starts from exactly this: the request that created something, and the requests that used it. The vulnerability itself, an upload form that accepted a PHP file and stored it where the web server would run it, is the application's failure, and naming it precisely is what lets it be fixed.
Three things in the records make the shell stand out from ordinary traffic. A POST to a path that ends in .php inside a certificate-renewal directory.
A burst of POSTs to one path from one address. And the timing: twenty requests between two and half past two in the morning, from an address that had made no request before that night. None of those alone proves anything; together they leave little doubt.
It helps to know what ordinary traffic looks like on the same server before deciding something is unusual. The internal clients make GET requests for documentation pages and images, spread through the working day, from a handful of addresses that recur every day.
The intruder's requests break every one of those patterns at once: method, path, hour and source. Module 4 teaches building that baseline first, because without it every unusual request looks like an attack and every attack looks like one more unusual request.
The address is worth recording too, with its limits: an address is where the requests came from on the internet, which may be a rented server, a proxy or another victim, and not where the intruder sat. The status codes deserve a caution.
A 200 means the server answered, not that the request did what the intruder wanted. A web shell returns 200 whether its command worked or failed, so the access log can show that a shell was used, but not what each use achieved.
What the Access Log Cannot Say
The body of each request is not loggedAn access log records the request line, the status, the size of the response, the referrer and the browser string. It does not record the body of a POST, which is where a web shell's command travels. So the log above proves twenty commands were sent, and says nothing about what any of them was.
That gap is the reason lesson 0.1 leaned on the history file. Pairing each www-data history line with the shell request at the same second:
02:14:03 POST shell.php 5607 bytes | history: whoami
02:14:11 POST shell.php 6848 bytes | history: id
02:14:18 POST shell.php 5701 bytes | history: uname -a
02:14:25 POST shell.php 1282 bytes | history: cat /etc/passwd
02:14:33 POST shell.php 5297 bytes | history: sudo -l
02:15:02 POST shell.php 957 bytes | history: ls -la /home/
02:15:11 POST shell.php 395 bytes | history: ls -la /home/deploy/.ssh/
02:15:22 POST shell.php 2188 bytes | history: cat /home/deploy/.ssh/authoriz
02:28:05 POST shell.php 5605 bytes | history: echo "ssh-rsa AAAAB3NzaC1yc2EA
9 of the 20 shell requests have a history line at the same second; 11 do not. The pairing is suggestive, because the times match exactly, but it is a pairing of two records that each have weaknesses, and the 11 unpaired requests are commands nobody can name from these records.
The pairs also expose the size column's limits. The response sizes recorded for these requests do not track the commands in any way a reader could use to name them, which is a reminder that a column existing in a log does not mean it carries the signal one hopes for.
Module 4's lesson on reconstructing the exploit request covers the other sources that can supply what the access log leaves out: application logs that record parameters, a web application firewall, and packet captures where the traffic was not encrypted.
The same caution applies to the browser string. Every one of the intruder's requests claimed to be Chrome on Linux. That is whatever the client chose to send, and tools routinely send a browser's string to blend in. It links the requests to each other; it says nothing about what made them.
Taken together, the access log and the history give a better account than either alone, but still a partial one, and the finding has to say which commands are known and which are only known to have been sent. What the access log does establish beyond doubt is the time window and the source.
The intruder's first request was at 02:10:44 and the last at 02:28:05. Anything the intruder did through the web door happened inside those minutes, and any later activity came through a different door, which is exactly what lesson 0.1 found: a key planted at 02:28 and an SSH login after it.
The Noise Beside It
SSH guessing that had nothing to do with the entryThe same web server's authentication log has failed SSH logins in the same collection:
19 failed SSH logins on 2026-03-08 to 2026-03-10
19 different source addresses
invalid users tried: postgres x5, oracle x5, root x4, test x3, admin x2
successful logins from any of them: 0
19 failures from 19 different addresses, each trying a common name such as postgres, oracle, root, test, and none followed by a success. That is what any server with SSH open to the internet collects every day: automated scanners trying a short list of names and passwords from addresses all over the world.
It would be easy to see these lines, find SSH failures around the time of an intrusion, and conclude that the intruder came in through SSH. On this server that conclusion would be wrong. The entry was through the web application, and the guessing was background that ran across the whole collection, before the intrusion and after it.
The test that separates them is the one Module 4's first lesson teaches: an entry is a success, not a failure. Failures with no success after them are attempts that did not work, however many there are. The question is always which success was the intruder's, and on this server the only success the intruder had was through the web door.
The noise is still worth a line in the report. It shows that SSH on this server accepts password attempts from the internet, which is a weakness whether or not it was used this time. A finding that names the door used and also notes the door left open is more useful to the people fixing the server than one that stops at the first.
The collection also holds one failure of a different kind: a public key refused for a connection to 10.1.20.11. That is not inbound guessing at all; it belongs to the lateral movement attempt lesson 0.1 noticed in the socket table, and Module 7 reads it there. Sorting the failures by kind before counting them is what keeps it out of the noise.
Module 4's lesson on entry without coverage takes the opposite case: a server where neither log recorded the door used, and the entry has to be inferred from what came after it. That is rarer than either door, but it happens often enough that an investigation should be ready to say so.
The SSH Door
Guessing that ended in a successThe second case is SRV-NGE-MCR-APP01 in INC-NE-2026-0563, the RHEL server from lesson 0.2 whose CPU ran near capacity for three days. Its authentication records from one outside address:
327 failed password logins from 185.143.40.91
first 03:15:01, last 03:46:30 on 2026-03-12, about 31 minutes
20 account names tried; most tried: deploy 38, jenkins 24, monitor 23, guest 22
03:47:22 auth_success deploy password
03:47:45 sudo_success deploy as root /bin/bash
327 failed password attempts in about 31 minutes, cycling through 20 account names: service accounts, database names, generic logins. Then, 52 seconds after the last failure, a successful password login for deploy from the same address, and 23 seconds after that a sudo to a root shell.
The pause before the success is worth noticing. It may mean a person, or a second tool, used a result the first one found; the records cannot say which, and the report should not guess.
This is what a brute-force entry looks like: many failures from one source against many names, then one success for a real account. It differs from the background noise on the web server in exactly the way that matters. The noise was failures from many addresses, none succeeding; this is failures from one address, ending in a success.
The method recorded on the success is password, and that is the root cause. An account that accepts only keys cannot be guessed into, however many attempts are made. deploy accepted a password from the internet, and the password was among the ones the tool tried. Module 4's lessons on scoping an SSH compromise and finding its breach point start from this record.
Notice the order in the account names, too. deploy was the most tried name of all, 38 times, which suggests the guessing tool either knew or guessed that deploy existed on a server running a Node.js application. That is a guess about the attacker's list rather than a finding, and the report should say so.
Thirty-one minutes is also worth weighing. 327 attempts in that time is about ten a minute, slow enough that a rate limit set at a higher threshold would not have triggered, and fast enough to try every name on a short list several times.
Module 4 discusses the defenses that change this calculation, from key-only authentication to blocking repeated failures, and how each one shows up in the records when it works.
Dating the Entry, and the Session Still Open
Corroborating a login from the other recordsAn entry time from the authentication log is strong, and stronger when other records agree. The login records and the socket table from the same collection:
login deploy pts/1 from 185.143.40.91 2026-03-12 03:47 still logged in
socket 10.1.20.11:22 <- 185.143.40.91:54321 ESTABLISHED sshd 9001
The login record shows deploy on a second terminal, pts/1, from 185.143.40.91, at the same minute as the authentication success, and still logged in when the collection ran. The socket table shows sshd holding an established connection from the same address. The intruder's session was open while the investigators were collecting, which is a containment problem before it is an evidence one.
Every command the investigators ran was visible to anyone watching from that session, and every minute it stayed open was a minute the intruder could respond. Module 9 is about making the order of collection and containment a decision rather than an accident.
The other 12 login records show deploy's ordinary pattern: one session a day from an internal address, starting around nine and ending around five. The intruder's session breaks every part of that pattern: the source, the time of day and the terminal.
Module 4's scoping lesson is built on comparing an account's ordinary pattern with the session in question. The comparison needs history: a few days of ordinary sessions at least, so that the baseline is a pattern rather than a single day. This collection held eleven days, which is enough.
The failed logins from internal addresses on earlier days fit the ordinary pattern too: 8 single failures, each from one of deploy's own machines and each in working hours. They are a person mistyping, and keeping them out of the finding is as important as keeping the intruder's failures in.
How the two entries announce themselves
Two doorsSo the two cases end with the same kind of finding stated differently. The web server was entered at 02:13 on 10 March through an upload form, by 203.0.113.99.
The application server was entered at 03:47 on 12 March through SSH password authentication on deploy, by 185.143.40.91, after 327 guesses. Each sentence names the door, the time, the source and the account, and each rests on a record from the log that door writes to.
Both sentences also stop where the evidence stops. Neither says who the intruder was, because an address is not a person, and neither says the door was used only once. Those are claims the records here cannot support, and Module 4's workflow lesson is explicit that a finding about entry is a finding about one door, one time and one credential.
What Module 4 Builds On It
Initial access and server compromiseModule 4 is about establishing and dating the entry point. It begins by telling the two vectors apart, then scopes and finds an SSH breach, names a web application vector, reads web shells and reverse shells, reconstructs the exploit request, and covers entries through neither door and entries that nothing recorded, before revisiting the decision and ending with a workflow.
What Module 4 builds
Module 4The two cases here are the first two lessons' material in short. The web server is the web vector and its shell; the application server is the SSH breach and its scope. The noise on the web server is the reason the module starts by telling the vectors apart rather than by reading either one.
The habits to carry into it are the ones this lesson used. Ask which door before reading either log. Look for the success, not the failures. Compare a session with the account's ordinary pattern. Say what each log cannot record, such as the body of a POST. And state the entry as a door, a time, a source and an account, each tied to a record.
The module also prepares for the next one. The account the intruder arrived as decides what they could do next: www-data on the web server could read and write little beyond the web root, while deploy on the application server could run sudo. Module 5 starts from that account and asks how it became root, and the answer differs completely between the two cases here.
Module 4 works from lab hosts set up to be entered both ways, so each record can be matched against what the attacker actually sent. That matters most for the web door, where the same vulnerability can leave very different traces depending on the application and how it logs.
Both distributions are covered, because they place the records differently. Ubuntu's authentication log is auth.log and RHEL's is secure, the default nginx log formats differ slightly by package, and RHEL's SELinux adds denial records that can show a web shell trying something it was not allowed to do. Module 4 shows each where it differs.
Practice
Decide which login was the way in prepared evidenceThe prepared evidence below is every successful login, session close and sudo on SRV-NGE-MCR-APP01 from 10 March. Decide which records are the intruder's, what made the entry possible, and whether deploy's earlier failed logins belong in the finding. Each answer comes with its reasoning, so check it against the rows rather than only the choice.
Read the source column first, then the time. Every ordinary record comes from an internal address, and nearly all of them at the same hours every day; the one that does not is the place to start.
Then read the record that follows it. An intruder who has just found a working password usually does something with it at once, and a privileged command within seconds of an unusual login is a strong sign the two belong together.
Finally, count. The case's failed logins from the outside address are not in the table, but the lesson gave their number and their span. A success that follows a long run of failures from the same address is the record Module 4 calls the breach point, and finding it is usually a matter of sorting rather than searching.
Then, on a lab host you own, run a short password guessing tool against a test account with a weak password, and read the authentication log afterwards. Compare it with the records above, and note which fields would let you tell your own test from a real attack.
Two doors, two logs. The web server was entered through an upload form, visible as a burst of requests in the access log beside SSH guessing that never succeeded. The application server was entered through SSH after 327 guesses, visible as one success after the failures, with the intruder's session still open when the collection ran. Each finding names its door, its time, its source and its account.
The next lesson follows both intruders from the account they arrived as to root, and reads the escalation from what it left behind.