Detecting Attacks on Data
How access logs, honeypot files, and file hashes reveal when an adversary reads, copies, moves, deletes, or changes data.
1Watching the data itself
An adversary who gets past the network and device defenses still has to touch the data to steal, change, or destroy it. Three detection methods watch for that.
2Accounting: access logs
Devices track and log when data are accessed and by whom. Recording and monitoring user activity is called accounting. Analyzing these logs can reveal an adversary trying to access, copy, move, or delete data. Suspicious activity includes:
- Accessing files that are not usually accessed.
- Accessing files or applications outside a user's normal patterns of time of day, location, or device type.
- Attempts to delete or copy sensitive files.
09:14 mreyes LAPTOP-114 OPEN Sales/q3_forecast.xlsx 10:02 jkwan LAPTOP-207 OPEN HR/benefits.pdf 11:47 mreyes LAPTOP-114 OPEN Sales/leads.csv 02:31 jkwan UNKNOWN-PC OPEN HR/salaries.xlsx 02:33 jkwan UNKNOWN-PC COPY HR/salaries.xlsx 02:36 jkwan UNKNOWN-PC OPEN Finance/card_numbers_2026.xlsx 14:20 mreyes LAPTOP-114 DELETE Finance/payroll.csv
A simple program that compares each line with each user's normal files, hours, and device flags 4 of the 7 lines:
| When and who | Action | Why it was flagged |
|---|---|---|
| 02:31 jkwan | OPEN HR/salaries.xlsx | file this user does not normally open; outside normal hours; unfamiliar device |
| 02:33 jkwan | COPY HR/salaries.xlsx | file this user does not normally open; outside normal hours; unfamiliar device; copy of a sensitive file |
| 02:36 jkwan | OPEN Finance/card_numbers_2026.xlsx | honeypot touched; outside normal hours; unfamiliar device |
| 14:20 mreyes | DELETE Finance/payroll.csv | file this user does not normally open; delete of a sensitive file |
The 02:31 to 02:36 run is one story: someone using jkwan's account on an unknown computer in the middle of the night opened salary data, copied it, then opened a file that looked like card numbers. The 14:20 deletion came from mreyes's normal laptop during work hours, but deleting payroll data is still worth asking about.
3Honeypot files
A honeypot is a file that appears to contain valuable data (credit card numbers, PII, passwords), but the data are fake. The system alerts defenders if anyone tries to access it. Because the file is fake, there is no legitimate reason to open it, so any access is an indicator of malicious activity. In the log above, Finance/card_numbers_2026.xlsx is a honeypot; the 02:36 access needs no further analysis to be suspicious.
4Hashes reveal changes
A cryptographic hash function produces a digest of a file. The same input always gives the same digest, and any change, even one character, gives a completely different one. A file that changes unexpectedly can be a sign of malicious activity.
| Payroll file | SHA-256 digest (first 16 characters) |
|---|---|
| Recorded Monday | cc926c41a1de6004… |
| Checked Tuesday, unchanged | cc926c41a1de6004… |
| Checked Friday, one digit of an account number changed | 3ccfb91507755291… |
Friday's digest does not match, so the file was altered after Tuesday's check. Someone changed R. Diaz's account number from 7730-1906 to 7730-1909, which could redirect a paycheck.
Access logs (accounting) reveal unusual access, copying, or deletion; a honeypot file turns any access into an alert; and comparing hash digests reveals altered data.
5Worked examples
The night shift
A log shows the user tbell, who normally works 9 to 5 on a desktop in the Chicago office, opening customer records at 3:10 AM from a phone in another country. Is this suspicious, and which indicators apply?
- 1Time of day: 3:10 AM is outside the normal pattern.
- 2Location: another country instead of the office.
- 3Device type: a phone instead of the usual desktop.
Bait for an insider
A company suspects someone is browsing files they shouldn't. It creates Exec/layoff_list_2027.xlsx filled with invented names and sets an alert on it. A week later, the alert fires for an intern's account. What does this show?
- 1The file is fake, so no one has a work reason to open it.
- 2Any access is an indicator of malicious activity.
- 3The intern's account (or whoever controls it) was searching for sensitive data.
The website file
An admin recorded the SHA-256 digest of login.php at deployment. Today's digest is different, but no one on the team made a change. What does it mean?
- 1Same input always gives the same digest.
- 2A different digest means the file's contents changed.
- 3No authorized change was made, so an adversary may have modified the login page.
Which would catch it?
Which method (logs, honeypot, or hash) best detects each: (a) a nurse's account copying 5,000 patient records at night; (b) an attacker who searches the file server for anything named “passwords”; (c) a changed grade in a stored transcript file?
- 1(a) Copying sensitive files at an unusual time shows up in access logs.
- 2(b) A honeypot named like a password file would attract the search.
- 3(c) A changed file changes its hash digest.
6Common mistakes
Successful access at an odd time, from an odd place or device, is often the clearest sign.
A hash shows whether data changed. Someone who only reads or copies a file leaves its hash the same.
No one has a reason to open it, so any access is suspicious on its own.
“At 02:31, jkwan’s account opened and then copied HR/salaries.xlsx from an unknown device, outside the user’s normal hours, and three minutes later opened the honeypot file. These indicate an adversary using a compromised account to find and copy sensitive data.”
Quote the log entries, name the indicators (time, device, file, action), and state what they suggest.