<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: tktkkame</title>
    <description>The latest articles on DEV Community by tktkkame (@tokotokokame).</description>
    <link>https://dev.to/tokotokokame</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4187633%2F68d918a7-3a28-406f-b92f-14757137f157.jpg</url>
      <title>DEV Community: tktkkame</title>
      <link>https://dev.to/tokotokokame</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tokotokokame"/>
    <language>en</language>
    <item>
      <title>The deleted auth.log had a forwarded twin sitting right next to it</title>
      <dc:creator>tktkkame</dc:creator>
      <pubDate>Mon, 30 Nov 2026 04:21:58 +0000</pubDate>
      <link>https://dev.to/tokotokokame/the-deleted-authlog-had-a-forwarded-twin-sitting-right-next-to-it-3k5</link>
      <guid>https://dev.to/tokotokokame/the-deleted-authlog-had-a-forwarded-twin-sitting-right-next-to-it-3k5</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;The scenario is &lt;strong&gt;fictional&lt;/strong&gt;. Linux commands are verified against synthetic data; Windows details follow the book as written and are not tested live.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;"Can you check the logs?" Where do you actually look first — &lt;code&gt;/var/log/auth.log&lt;/code&gt;? &lt;code&gt;journalctl&lt;/code&gt;? The Windows Security channel? Across this series we've leaned on these logs constantly, but &lt;strong&gt;"the log" isn't one thing&lt;/strong&gt;. Auth events live in auth.log, kernel events in kern.log, login history in a separate binary trail (wtmp/btmp), systemd services in journald, Windows Kerberos events (4624, 4769) in the Security channel — and at the collector, there's a whole separate store called &lt;code&gt;ForwardedEvents&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This case starts with an investigator who doesn't have that map, and briefly loses evidence that was never actually gone.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you'll learn
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A map of where Linux/Windows logs actually get written, and why&lt;/li&gt;
&lt;li&gt;Why a deleted local log can still have a &lt;strong&gt;forwarded copy&lt;/strong&gt; surviving elsewhere&lt;/li&gt;
&lt;li&gt;Why the Golden Ticket "missing 4768" signal from episode 9 only becomes visible once forwarded logs are centralized&lt;/li&gt;
&lt;li&gt;Common false negatives: UDP syslog drops, volatile journald, clock drift&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The incident
&lt;/h2&gt;

&lt;p&gt;After compromising web03 (a public Linux web server) and pivoting through the domain, the attacker ends up with a Golden Ticket — the same chain this series has been following. Two responders check different logs.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Responder&lt;/th&gt;
&lt;th&gt;Checked&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;cat /var/log/auth.log&lt;/code&gt; on web03&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Nothing&lt;/strong&gt; — deleted by the attacker&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;B&lt;/td&gt;
&lt;td&gt;Local Security log on the DC&lt;/td&gt;
&lt;td&gt;4769 present, matching 4768 &lt;strong&gt;appears missing&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Both conclude "evidence destroyed." Half right — and looking in the wrong place.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Linux log map — auth.log is just one entry point
&lt;/h2&gt;

&lt;p&gt;Authentication (auth.log, or &lt;code&gt;secure&lt;/code&gt; on RHEL) isn't the whole picture. Kernel events go to kern.log; login history goes to wtmp/btmp/lastlog (&lt;strong&gt;binary — use &lt;code&gt;last&lt;/code&gt;/&lt;code&gt;lastb&lt;/code&gt;/&lt;code&gt;lastlog&lt;/code&gt;, not &lt;code&gt;cat&lt;/code&gt;&lt;/strong&gt;); package changes go to dpkg/yum logs; systemd services go through journald. These are parallel, independent trails.&lt;/p&gt;

&lt;p&gt;Responder A's mistake: treating "auth.log is gone" as "no evidence exists."&lt;/p&gt;

&lt;h2&gt;
  
  
  How logs get written — facility and severity
&lt;/h2&gt;

&lt;p&gt;syslog tags every message with a &lt;strong&gt;facility&lt;/strong&gt; (what kind) and &lt;strong&gt;severity&lt;/strong&gt; (how important). Auth events carry the &lt;code&gt;auth&lt;/code&gt;/&lt;code&gt;authpriv&lt;/code&gt; facility, and rsyslog's rules (&lt;code&gt;/etc/rsyslog.conf&lt;/code&gt;, &lt;code&gt;/etc/rsyslog.d/*.conf&lt;/code&gt;) decide that facility writes to &lt;code&gt;auth.log&lt;/code&gt;. The path isn't fixed — it's a &lt;strong&gt;configured outcome&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why a deleted log can still survive — forwarding
&lt;/h2&gt;

&lt;p&gt;web03's rsyslog was already forwarding to an aggregation host (&lt;code&gt;logcol01&lt;/code&gt;) before the incident. Deleting the local &lt;code&gt;auth.log&lt;/code&gt; doesn't touch the forwarded copy, since forwarding happens near-real-time and the attacker typically can't reach the collector.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Windows side — Security, Sysmon, and ForwardedEvents
&lt;/h2&gt;

&lt;p&gt;Windows events are written per-channel (Security, Sysmon, PowerShell). Windows Event Forwarding (WEF) adds a separate mechanism: forwarded events land in a distinct channel at the collector called &lt;code&gt;ForwardedEvents&lt;/code&gt;. Responder B checked the DC's local Security log but never looked at the collector's &lt;code&gt;ForwardedEvents&lt;/code&gt; — that's the real gap.&lt;/p&gt;

&lt;h2&gt;
  
  
  Golden Ticket's signal only appears once logs are centralized
&lt;/h2&gt;

&lt;p&gt;The "4769 with no matching 4768" signal from episode 9 can't be seen from a single host — both events are recorded by the DC, and Silver Ticket detection requires cross-referencing a member server's 4624 against the DC's 4768/4769. Without a map of what lives where, and without centralizing it, the absence itself is invisible.&lt;/p&gt;

&lt;h2&gt;
  
  
  Guarding against false negatives
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Cause&lt;/th&gt;
&lt;th&gt;Symptom&lt;/th&gt;
&lt;th&gt;Check&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;journald set to volatile (&lt;code&gt;/run&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;Logs vanish after reboot&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;Storage=persistent&lt;/code&gt; in journald.conf&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;syslog forwarding over UDP&lt;/td&gt;
&lt;td&gt;Silent drops under load&lt;/td&gt;
&lt;td&gt;TCP/TLS or RELP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Clock drift between hosts&lt;/td&gt;
&lt;td&gt;Correlated events look mismatched&lt;/td&gt;
&lt;td&gt;UTC + NTP everywhere&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Forwarding itself has stopped&lt;/td&gt;
&lt;td&gt;"No evidence" vs "not delivered"&lt;/td&gt;
&lt;td&gt;Monitor last-received time per source&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;"Missing" and "not delivered" look identical. You need both the map and a health check on collection to tell them apart.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Logs are distributed, not singular, on both Linux and Windows&lt;/li&gt;
&lt;li&gt;Where a log lands is a configuration outcome (facility/severity, channel setup), not a fixed path&lt;/li&gt;
&lt;li&gt;Local copies get deleted; forwarded copies survive&lt;/li&gt;
&lt;li&gt;Absence-based detection (Golden/Silver Ticket) only works once logs are centralized&lt;/li&gt;
&lt;li&gt;Distinguish "missing" from "not delivered" using both the map and collection health monitoring&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The series moves to a new topic next.&lt;/p&gt;




&lt;p&gt;Adapted from Chapters 14 ("Linux Log Infrastructure") and 16 ("Windows Log Infrastructure") of my book &lt;em&gt;Server Defense from an Attacker's Perspective&lt;/em&gt; (40 chapters, Japanese).&lt;/p&gt;

</description>
      <category>security</category>
      <category>linux</category>
      <category>windows</category>
      <category>forensics</category>
    </item>
    <item>
      <title>When config can't save you: PwnKit, Dirty Pipe and patch-first ops</title>
      <dc:creator>tktkkame</dc:creator>
      <pubDate>Thu, 26 Nov 2026 05:15:17 +0000</pubDate>
      <link>https://dev.to/tokotokokame/when-config-cant-save-you-pwnkit-dirty-pipe-and-patch-first-ops-4g8e</link>
      <guid>https://dev.to/tokotokokame/when-config-cant-save-you-pwnkit-dirty-pipe-and-patch-first-ops-4g8e</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Explanatory, based on the book; examples are fictional. &lt;strong&gt;No exploit code or reproduction steps.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Family A (misconfiguration) is fixed by inventory and least privilege. Family B (software bugs such as &lt;strong&gt;PwnKit, CVE-2021-4034&lt;/strong&gt; in pkexec, and &lt;strong&gt;Dirty Pipe, CVE-2022-0847&lt;/strong&gt; in Linux 5.8+) is fixed by &lt;strong&gt;patching&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you'll learn
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Why asset inventory is the real work&lt;/li&gt;
&lt;li&gt;How to prioritize&lt;/li&gt;
&lt;li&gt;Secondary signals and their limits&lt;/li&gt;
&lt;li&gt;Series recap&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Operations
&lt;/h2&gt;

&lt;p&gt;Inventory hosts, OS and kernel versions, then match against vendor advisories. Prioritize by exposure, known exploitation, impact and available mitigations. Don't judge by version number alone: distributions &lt;strong&gt;backport&lt;/strong&gt; fixes, so check the vendor advisory.&lt;/p&gt;

&lt;p&gt;Secondary signals (after the fact): SUID program crashes (segfaults), unexpected parents of &lt;code&gt;pkexec&lt;/code&gt;, and the &lt;code&gt;uid != euid&lt;/code&gt; shell from the earlier article. Detection cannot replace patching.&lt;/p&gt;

&lt;h2&gt;
  
  
  Series recap
&lt;/h2&gt;

&lt;p&gt;Escalation is the doorway to the next action. Close the door first, then detect.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Adapted from chapters 25 and 38 of my Japanese book on server defense.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>linux</category>
      <category>vulnerability</category>
      <category>patchmanagement</category>
    </item>
    <item>
      <title>Close Windows escalation at the door: LAPS, SeImpersonate, paths</title>
      <dc:creator>tktkkame</dc:creator>
      <pubDate>Wed, 25 Nov 2026 05:32:55 +0000</pubDate>
      <link>https://dev.to/tokotokokame/close-windows-escalation-at-the-door-laps-seimpersonate-paths-1mc8</link>
      <guid>https://dev.to/tokotokokame/close-windows-escalation-at-the-door-laps-seimpersonate-paths-1mc8</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;The scenario is &lt;strong&gt;fictional&lt;/strong&gt;. Everything here is from the book and &lt;strong&gt;not tested on live Windows&lt;/strong&gt;; try it in a lab first.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What you'll learn
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Fixing service paths and ACLs&lt;/li&gt;
&lt;li&gt;Why &lt;code&gt;AlwaysInstallElevated&lt;/code&gt; must be 0&lt;/li&gt;
&lt;li&gt;Enabling 4688 command-line logging&lt;/li&gt;
&lt;li&gt;LAPS and limiting SeImpersonate&lt;/li&gt;
&lt;li&gt;What to monitor&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Checklist
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Quote service paths (&lt;code&gt;sc.exe config&lt;/code&gt;), and verify no write access for normal users on binaries and service registry keys.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;AlwaysInstallElevated&lt;/code&gt; = 0 (or absent) under both HKLM and HKCU policy keys.&lt;/li&gt;
&lt;li&gt;Enable process-creation auditing and &lt;code&gt;ProcessCreationIncludeCmdLine_Enabled = 1&lt;/code&gt;. It is &lt;strong&gt;off by default&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Deploy LAPS so one stolen local-admin hash does not open every host.&lt;/li&gt;
&lt;li&gt;Run web app pools under dedicated low-privilege accounts; inventory &lt;code&gt;SeImpersonatePrivilege&lt;/code&gt; with &lt;code&gt;whoami /priv&lt;/code&gt;; use gMSA.&lt;/li&gt;
&lt;li&gt;Monitor 4672 (unexpected privileged accounts), 7045 (non-standard paths) and 4688/Sysmon 1 (low-privilege parent -&amp;gt; System child).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Next: escalation by vulnerability, where patching is the answer.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Adapted from chapters 16 and 25 of my Japanese book on server defense.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>windows</category>
      <category>hardening</category>
      <category>sysmon</category>
    </item>
    <item>
      <title>www-data to root via vim: writing facts apart from hypotheses</title>
      <dc:creator>tktkkame</dc:creator>
      <pubDate>Tue, 24 Nov 2026 06:59:49 +0000</pubDate>
      <link>https://dev.to/tokotokokame/www-data-to-root-via-vim-writing-facts-apart-from-hypotheses-1486</link>
      <guid>https://dev.to/tokotokokame/www-data-to-root-via-vim-writing-facts-apart-from-hypotheses-1486</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;The scenario is &lt;strong&gt;fictional&lt;/strong&gt; (RFC 5737 IPs). No exploit steps.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Reading logs is half the job. The other half is handing others something they can act on. Rule one: &lt;strong&gt;facts and hypotheses go in different columns.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What you'll learn
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Merging auth.log and auditd into one timeline&lt;/li&gt;
&lt;li&gt;Facts vs hypotheses&lt;/li&gt;
&lt;li&gt;Priority and the order of containment&lt;/li&gt;
&lt;li&gt;Chasing what happened &lt;strong&gt;after&lt;/strong&gt; root&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Timeline (web03, UTC)
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Time&lt;/th&gt;
&lt;th&gt;Event&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;01:07:35&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;www-data&lt;/code&gt; SSH password login from &lt;code&gt;203.0.113.77&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;01:12:03&lt;/td&gt;
&lt;td&gt;sudo &lt;code&gt;vim.basic&lt;/code&gt; as root, shell escape&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;same window&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;uid=33 euid=0&lt;/code&gt; shell (auditd)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;next&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;id&lt;/code&gt;, then &lt;code&gt;cat /etc/shadow&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Facts:&lt;/strong&gt; the above. &lt;strong&gt;Hypotheses (verify):&lt;/strong&gt; a sudoers entry allowed vim (check the config); offline cracking or lateral movement may follow; the initial access path is unknown.&lt;/p&gt;

&lt;h2&gt;
  
  
  Containment, in order
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Kill the root session; block &lt;code&gt;203.0.113.77&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Remove shell-capable commands from sudoers; assume &lt;code&gt;/etc/shadow&lt;/code&gt; leaked and reset credentials.&lt;/li&gt;
&lt;li&gt;Hunt for persistence and lateral movement; isolate and preserve &lt;code&gt;web03&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Severity is Critical because root plus credential-file access. Use UTC everywhere.&lt;/p&gt;

&lt;p&gt;Next: preventing this with SUID and sudoers hardening.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Adapted from chapters 25 and 36 of my Japanese book on server defense.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>linux</category>
      <category>incidentresponse</category>
      <category>forensics</category>
    </item>
    <item>
      <title>Close Linux escalation at the door: SUID audit, nosuid, sudoers</title>
      <dc:creator>tktkkame</dc:creator>
      <pubDate>Tue, 24 Nov 2026 06:59:48 +0000</pubDate>
      <link>https://dev.to/tokotokokame/close-linux-escalation-at-the-door-suid-audit-nosuid-sudoers-36a9</link>
      <guid>https://dev.to/tokotokokame/close-linux-escalation-at-the-door-suid-audit-nosuid-sudoers-36a9</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;The scenario is &lt;strong&gt;fictional&lt;/strong&gt;. The SUID diff and &lt;code&gt;visudo -cf&lt;/code&gt; were tested on synthetic data; fstab and auditd settings are from the book and untested live.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What you'll learn
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;SUID baseline: watch for what is &lt;strong&gt;new&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;nosuid&lt;/code&gt; on writable mounts&lt;/li&gt;
&lt;li&gt;Sudoers principles&lt;/li&gt;
&lt;li&gt;An auditd rule set&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Steps
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Baseline: &lt;code&gt;find / -xdev -perm -4000 -type f | sort &amp;gt; suid.txt&lt;/code&gt;, then diff on a schedule. Remove unneeded bits with &lt;code&gt;chmod u-s&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Mount &lt;code&gt;/tmp&lt;/code&gt; and &lt;code&gt;/home&lt;/code&gt; with &lt;code&gt;nosuid,nodev&lt;/code&gt; (add &lt;code&gt;noexec&lt;/code&gt; only after testing).&lt;/li&gt;
&lt;li&gt;Sudoers: absolute paths, no shell-capable commands, pinned arguments, &lt;code&gt;use_pty&lt;/code&gt;, &lt;code&gt;logfile&lt;/code&gt;, &lt;code&gt;!visiblepw&lt;/code&gt;; validate with &lt;code&gt;visudo -cf&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;auditd: the &lt;code&gt;uid!=euid&lt;/code&gt; execve rule plus watches on &lt;code&gt;/etc/sudoers&lt;/code&gt;, &lt;code&gt;/etc/passwd&lt;/code&gt;, &lt;code&gt;/etc/shadow&lt;/code&gt;; forward logs off-host.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Config flaws are not fixed by patches. Inventory, least privilege and validation are the answer.&lt;/p&gt;

&lt;p&gt;Next: the Windows equivalent.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Adapted from chapters 15 and 25 of my Japanese book on server defense.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>linux</category>
      <category>sudo</category>
      <category>hardening</category>
    </item>
    <item>
      <title>Unquoted service paths: the book's filter had false positives</title>
      <dc:creator>tktkkame</dc:creator>
      <pubDate>Mon, 23 Nov 2026 03:52:04 +0000</pubDate>
      <link>https://dev.to/tokotokokame/unquoted-service-paths-the-books-filter-had-false-positives-34p9</link>
      <guid>https://dev.to/tokotokokame/unquoted-service-paths-the-books-filter-had-false-positives-34p9</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;The scenario is &lt;strong&gt;fictional&lt;/strong&gt;. PowerShell and events come from the book (untested on Windows). Only the &lt;strong&gt;path-matching logic&lt;/strong&gt; was tested, in Python, on synthetic strings.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What you'll learn
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Three service weaknesses: unquoted path, writable binary, writable registry key&lt;/li&gt;
&lt;li&gt;Detection: &lt;code&gt;services.exe&lt;/code&gt; spawning non-standard paths, and 7045&lt;/li&gt;
&lt;li&gt;Why the book's filter flags &lt;code&gt;svchost.exe -k ...&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Remediation with &lt;code&gt;sc.exe config&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The filter bug
&lt;/h2&gt;

&lt;p&gt;The book's condition (not starting with a quote and containing a space) also matches standard services that merely have arguments, such as &lt;code&gt;C:\Windows\system32\svchost.exe -k NetworkService -p&lt;/code&gt;. On synthetic data it returned 3 hits including a false one.&lt;/p&gt;

&lt;p&gt;Better: require whitespace &lt;strong&gt;before the first &lt;code&gt;.exe&lt;/code&gt;&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;vuln&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;startswith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'"'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;match&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="s1"&gt;'^[^"]*?\s[^"]*?\.exe'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;I&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;match&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="s1"&gt;'^\S+?\.exe'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;I&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Only the two truly unquoted paths were flagged.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fix
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;sc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;exe&lt;/span&gt; &lt;span class="n"&gt;config&lt;/span&gt; &lt;span class="s2"&gt;"VulnSvc"&lt;/span&gt; &lt;span class="n"&gt;binPath&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"\"C:\Program Files\App\svc.exe\""&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Also tighten ACLs on binaries and service keys, and alert on any 7045 from a non-standard path.&lt;/p&gt;

&lt;p&gt;Next: turning the web03 incident into a report.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Adapted from chapters 16 and 25 of my Japanese book on server defense.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>windows</category>
      <category>powershell</category>
      <category>hardening</category>
    </item>
    <item>
      <title>IIS foothold to SYSTEM in 17 minutes: the integrity-level jump in logs</title>
      <dc:creator>tktkkame</dc:creator>
      <pubDate>Thu, 19 Nov 2026 04:18:54 +0000</pubDate>
      <link>https://dev.to/tokotokokame/iis-foothold-to-system-in-17-minutes-the-integrity-level-jump-in-logs-354a</link>
      <guid>https://dev.to/tokotokokame/iis-foothold-to-system-in-17-minutes-the-integrity-level-jump-in-logs-354a</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;The scenario is &lt;strong&gt;fictional&lt;/strong&gt; (RFC 5737 IPs). Windows events come from the book, not a live test. No exploit steps.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;On Windows, escalation shows up as: a &lt;strong&gt;low-privilege service spawned a System-integrity child&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you'll learn
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Token, privileges, integrity levels (Low &amp;lt; Medium &amp;lt; High &amp;lt; System)&lt;/li&gt;
&lt;li&gt;The jump in 4672 / 4688&lt;/li&gt;
&lt;li&gt;Separating facts from hypotheses&lt;/li&gt;
&lt;li&gt;What follows escalation&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Timeline (win-web01, UTC)
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Time&lt;/th&gt;
&lt;th&gt;Source&lt;/th&gt;
&lt;th&gt;Event&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;01:05:12&lt;/td&gt;
&lt;td&gt;4624&lt;/td&gt;
&lt;td&gt;web app pool logon from &lt;code&gt;203.0.113.77&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;01:14:20&lt;/td&gt;
&lt;td&gt;4672&lt;/td&gt;
&lt;td&gt;SeImpersonate / AssignPrimaryToken assigned to &lt;code&gt;svc_web&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;01:14:21&lt;/td&gt;
&lt;td&gt;4688 / Sysmon 1&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;w3wp.exe&lt;/code&gt; -&amp;gt; System-integrity &lt;code&gt;ps.exe&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;01:16:40&lt;/td&gt;
&lt;td&gt;7045&lt;/td&gt;
&lt;td&gt;service &lt;code&gt;WinTelemetrySvc&lt;/code&gt; from &lt;code&gt;C:\Windows\Temp\wts.exe&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;01:17:11&lt;/td&gt;
&lt;td&gt;4688&lt;/td&gt;
&lt;td&gt;&lt;code&gt;reg save HKLM\SAM&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Normal: &lt;code&gt;services.exe&lt;/code&gt; -&amp;gt; &lt;code&gt;svchost.exe&lt;/code&gt; in a standard path. Attack: &lt;code&gt;w3wp.exe&lt;/code&gt; (Medium) -&amp;gt; System child in a temp path.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Facts:&lt;/strong&gt; the events above. &lt;strong&gt;Hypotheses:&lt;/strong&gt; &lt;code&gt;ps.exe&lt;/code&gt; is a token-impersonation tool (verify hash/signature); the SAM save aims at lateral movement.&lt;/p&gt;

&lt;p&gt;Enable command-line logging for 4688 in advance; it is off by default.&lt;/p&gt;

&lt;p&gt;Next: service hijacking and unquoted paths.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Adapted from chapter 25 of my Japanese book on server defense.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>windows</category>
      <category>iis</category>
      <category>incidentresponse</category>
    </item>
    <item>
      <title>Catch escalation before it happens: the enumeration burst</title>
      <dc:creator>tktkkame</dc:creator>
      <pubDate>Wed, 18 Nov 2026 04:36:55 +0000</pubDate>
      <link>https://dev.to/tokotokokame/catch-escalation-before-it-happens-the-enumeration-burst-3k53</link>
      <guid>https://dev.to/tokotokokame/catch-escalation-before-it-happens-the-enumeration-burst-3k53</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;The scenario is &lt;strong&gt;fictional&lt;/strong&gt;. The awk detector was tested on a synthetic log (&lt;code&gt;epoch uid comm args&lt;/code&gt;). The article's timeline row for this burst is an illustrative assumption, not from the book's exercise log.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Before escalating, attackers look around. Four commands in a few minutes from a service account are rare in normal operations.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you'll learn
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The enumeration commands: &lt;code&gt;sudo -l&lt;/code&gt;, &lt;code&gt;find / -perm -4000&lt;/code&gt;, &lt;code&gt;getcap -r /&lt;/code&gt;, &lt;code&gt;uname -r&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Counting &lt;strong&gt;distinct kinds per uid per minute&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Handling false positives&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Detector logic
&lt;/h2&gt;

&lt;p&gt;Key on uid + minute, count distinct kinds, alert on n &amp;gt;= 3 and uid != 0. Test output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ENUM-BURST uid=33 kinds=4: sudo-l find-suid getcap uname-r
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Normal admin activity (one or two kinds) stayed silent. Allow-list known inventory jobs by uid and source.&lt;/p&gt;

&lt;p&gt;Next: the Windows version, IIS to SYSTEM in 17 minutes.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Adapted from chapter 25 of my Japanese book on server defense.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>linux</category>
      <category>soc</category>
      <category>detection</category>
    </item>
    <item>
      <title>Sudo that allows vim is a root shell: detection and hardening</title>
      <dc:creator>tktkkame</dc:creator>
      <pubDate>Tue, 17 Nov 2026 05:09:22 +0000</pubDate>
      <link>https://dev.to/tokotokokame/sudo-that-allows-vim-is-a-root-shell-detection-and-hardening-17p5</link>
      <guid>https://dev.to/tokotokokame/sudo-that-allows-vim-is-a-root-shell-detection-and-hardening-17p5</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;The scenario is &lt;strong&gt;fictional&lt;/strong&gt; (RFC 5737 IPs). The detector and &lt;code&gt;visudo -cf&lt;/code&gt; were tested on synthetic data.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If sudoers lets an account run an editor, pager, &lt;code&gt;find&lt;/code&gt; or &lt;code&gt;awk&lt;/code&gt; as root, that account can get a root shell from inside it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you'll learn
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The auth.log pattern for sudo-run shell-capable binaries&lt;/li&gt;
&lt;li&gt;Why the book's grep was too loose (&lt;code&gt;shutdown&lt;/code&gt; matched &lt;code&gt;sh&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;An exact-basename detector&lt;/li&gt;
&lt;li&gt;Hardened sudoers and pre-validation&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Detector
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight awk"&gt;&lt;code&gt;awk -F&lt;span class="s1"&gt;'COMMAND='&lt;/span&gt; &lt;span class="s1"&gt;'/sudo:/ &amp;amp;&amp;amp; /USER=root/ {split($2,a," "); n=split(a[1],p,"/"); b=p[n]; if (b ~ /^(sh|bash|dash|zsh|find|vim|vim\.basic|vi|awk|python[0-9.]*|perl|less|more|man|env|nmap)$/) print}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Matching the exact basename removes the &lt;code&gt;shutdown&lt;/code&gt; false positive.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hardening
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight conf"&gt;&lt;code&gt;&lt;span class="nc"&gt;Defaults&lt;/span&gt; &lt;span class="n"&gt;use_pty&lt;/span&gt;
&lt;span class="na"&gt;Defaults logfile&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"/var/log/sudo.log"&lt;/span&gt;
&lt;span class="nc"&gt;Defaults&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;visiblepw&lt;/span&gt;
&lt;span class="na"&gt;deploy ALL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="no"&gt;NOPASSWD&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;usr&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;bin&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;systemctl&lt;/span&gt; &lt;span class="n"&gt;restart&lt;/span&gt; &lt;span class="n"&gt;webapp&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Always validate first: &lt;code&gt;visudo -cf new_sudoers&lt;/code&gt;. In tests it accepted the hardened file and rejected a broken one. Pin arguments, not just binaries.&lt;/p&gt;

&lt;p&gt;Next: the enumeration burst that precedes escalation.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Adapted from chapter 25 of my Japanese book on server defense.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>linux</category>
      <category>sudo</category>
      <category>hardening</category>
    </item>
    <item>
      <title>Great SOCs run on systems, not heroes: measure Dwell Time, not counts</title>
      <dc:creator>tktkkame</dc:creator>
      <pubDate>Mon, 16 Nov 2026 02:54:33 +0000</pubDate>
      <link>https://dev.to/tokotokokame/great-socs-run-on-systems-not-heroes-measure-dwell-time-not-counts-3205</link>
      <guid>https://dev.to/tokotokokame/great-socs-run-on-systems-not-heroes-measure-dwell-time-not-counts-3205</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;This is a read based on a &lt;strong&gt;fictional scenario&lt;/strong&gt;; figures are illustrative.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;One great analyst can solve one case. But alerts arrive by the hundreds, people rotate, attacks evolve. Operations that depend on individual effort burn out.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you'll learn
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;SOC tiers and two loops&lt;/li&gt;
&lt;li&gt;Vanity metrics vs. outcome metrics&lt;/li&gt;
&lt;li&gt;Handover and escalation essentials&lt;/li&gt;
&lt;li&gt;Why you stop fatigue first, then get proactive&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The story at a glance
&lt;/h2&gt;

&lt;p&gt;02:20 root success to 02:41 C2 alert: about 21 minutes (one MTTD example). Log wiping after detection: a collection-design failure. A sloppy handover lets overnight activity surface in the morning, lengthening dwell time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tiers
&lt;/h2&gt;

&lt;p&gt;Tier 1 triage and FP removal; Tier 2 deep investigation and containment; Tier 3 detection engineering and hunting; manager for KPIs and escalation. Tiers are roles, not rank. Small teams combine them but must keep every role.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two loops
&lt;/h2&gt;

&lt;p&gt;Reaction: logs -&amp;gt; detection -&amp;gt; alert -&amp;gt; triage -&amp;gt; response -&amp;gt; report. Improvement: lessons -&amp;gt; detection engineering -&amp;gt; hunting &amp;lt;- threat intel. The improvement loop makes the reaction loop lighter.&lt;/p&gt;

&lt;h2&gt;
  
  
  Metrics
&lt;/h2&gt;

&lt;p&gt;Dwell Time (the key outcome), MTTD, MTTA, MTTR, FP rate, ATT&amp;amp;CK coverage and queue depth (a leading fatigue indicator). "Alerts handled" is a vanity metric: noise raises it too.&lt;/p&gt;

&lt;h2&gt;
  
  
  Handover and escalation
&lt;/h2&gt;

&lt;p&gt;Handover notes: open cases and owners, watched events and held alerts, ongoing incidents, environment changes. Decide the escalation matrix in peacetime (Low to Critical, who approves isolation or account disablement).&lt;/p&gt;

&lt;h2&gt;
  
  
  Order of operations
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Stop the fatigue (cut FPs, automate tuned detections only).&lt;/li&gt;
&lt;li&gt;Invest the freed time in detection engineering, hunting, improvement.&lt;/li&gt;
&lt;li&gt;Feed findings back as detections.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Season one wraps here; next: building a detection lab and walking through a full exercise.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Adapted from chapter 37 of my Japanese book on server defense.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>soc</category>
      <category>incidentresponse</category>
      <category>siem</category>
    </item>
    <item>
      <title>Detect Linux escalation: uid != euid, and a bug in my own one-liner</title>
      <dc:creator>tktkkame</dc:creator>
      <pubDate>Mon, 16 Nov 2026 02:54:32 +0000</pubDate>
      <link>https://dev.to/tokotokokame/detect-linux-escalation-uid-euid-and-a-bug-in-my-own-one-liner-1683</link>
      <guid>https://dev.to/tokotokokame/detect-linux-escalation-uid-euid-and-a-bug-in-my-own-one-liner-1683</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;The scenario is &lt;strong&gt;fictional&lt;/strong&gt; (RFC 5737 IPs). The awk and SUID diff were run on synthetic data; auditd rules come from the book and are untested live.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A web-service account (&lt;code&gt;uid=33&lt;/code&gt;) running a shell with &lt;code&gt;euid=0&lt;/code&gt; is the signature of SUID/sudo escalation.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you'll learn
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The auditd rule: &lt;code&gt;-a always,exit -F arch=b64 -S execve -C uid!=euid -F euid=0 -k suid_exec&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Why my book's awk one-liner returned &lt;strong&gt;zero hits&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;A field-wise detector that works&lt;/li&gt;
&lt;li&gt;SUID baseline diffing&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The bug
&lt;/h2&gt;

&lt;p&gt;The book used &lt;code&gt;/uid=/ &amp;amp;&amp;amp; /euid=0/ &amp;amp;&amp;amp; !/uid=0/&lt;/code&gt;. But &lt;code&gt;euid=0&lt;/code&gt; itself contains &lt;code&gt;uid=0&lt;/code&gt;, so the negation excludes every line. Verified on synthetic logs: 0 hits.&lt;/p&gt;

&lt;p&gt;Fixed version, comparing fields:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight awk"&gt;&lt;code&gt;awk &lt;span class="s1"&gt;'{u="";e="";c=""; for(i=1;i&amp;lt;=NF;i++){ if($i ~ /^uid=/) u=substr($i,5); if($i ~ /^euid=/) e=substr($i,6); if($i ~ /^comm=/) c=$i } if(e==0 &amp;amp;&amp;amp; u!=0 &amp;amp;&amp;amp; c ~ /"(sh|bash|dash)"/) print u, c}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It flags only the &lt;code&gt;uid=33 euid=0 comm="sh"&lt;/code&gt; line.&lt;/p&gt;

&lt;h2&gt;
  
  
  SUID baseline
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;find / -xdev -perm -4000 -type f | sort&lt;/code&gt; into a baseline, then diff periodically. In the test, a &lt;code&gt;chmod u+s&lt;/code&gt; showed up as exactly one diff line and &lt;code&gt;chmod u-s&lt;/code&gt; cleared it.&lt;/p&gt;

&lt;p&gt;Next: sudo misconfiguration and shell escapes.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Adapted from chapter 25 of my Japanese book on server defense.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>linux</category>
      <category>auditd</category>
      <category>incidentresponse</category>
    </item>
    <item>
      <title>Privilege escalation map: Linux euid vs Windows tokens</title>
      <dc:creator>tktkkame</dc:creator>
      <pubDate>Fri, 13 Nov 2026 03:29:13 +0000</pubDate>
      <link>https://dev.to/tokotokokame/privilege-escalation-map-linux-euid-vs-windows-tokens-ikp</link>
      <guid>https://dev.to/tokotokokame/privilege-escalation-map-linux-euid-vs-windows-tokens-ikp</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;The scenario is &lt;strong&gt;fictional&lt;/strong&gt; (RFC 5737 IPs). Detection and defense only; no exploit steps.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Once an attacker has a foothold, the next move is almost always &lt;strong&gt;escalation&lt;/strong&gt;. This season covers it for Linux and Windows servers.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you'll learn
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Two families: &lt;strong&gt;A = misconfiguration&lt;/strong&gt; (SUID, sudo, writable cron, unquoted service paths) and &lt;strong&gt;B = vulnerability&lt;/strong&gt; (PwnKit, Dirty Pipe)&lt;/li&gt;
&lt;li&gt;Linux: the &lt;strong&gt;uid vs euid&lt;/strong&gt; mismatch&lt;/li&gt;
&lt;li&gt;Windows: &lt;strong&gt;token, privileges, integrity level&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;The series map&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Linux vs Windows
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Linux&lt;/th&gt;
&lt;th&gt;Windows&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Core model&lt;/td&gt;
&lt;td&gt;uid / euid&lt;/td&gt;
&lt;td&gt;access token, privileges, integrity level&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tell-tale in logs&lt;/td&gt;
&lt;td&gt;&lt;code&gt;uid=33 euid=0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;low-privilege parent -&amp;gt; &lt;strong&gt;System-integrity child&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Key logs&lt;/td&gt;
&lt;td&gt;auditd, auth.log&lt;/td&gt;
&lt;td&gt;4672, 4688, 7045, Sysmon 1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Family A is fixed by inventory and least privilege. Family B is fixed by &lt;strong&gt;patching&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Next: detecting the Linux uid != euid mismatch, including a bug I found in the book's own one-liner.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Adapted from chapter 25 of my Japanese book on server defense.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>linux</category>
      <category>windows</category>
      <category>incidentresponse</category>
    </item>
  </channel>
</rss>
