<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Posts on Daniel Roberson</title>
    <link>https://danielroberson.com/post/</link>
    <description>Recent content in Posts on Daniel Roberson</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Thu, 17 Apr 2025 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://danielroberson.com/post/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Linux Persistence: Modular Software</title>
      <link>https://danielroberson.com/post/linux-modular-persistence/</link>
      <pubDate>Thu, 17 Apr 2025 00:00:00 +0000</pubDate>
      <guid>https://danielroberson.com/post/linux-modular-persistence/</guid>
      <description>&lt;h1 id=&#34;introduction&#34;&gt;Introduction&lt;/h1&gt;&#xA;&lt;p&gt;A less common, but powerful persistence mechanism is abusing modular&#xA;software. Many services, clients, and other tools support third-party&#xA;modules or scripting extensions If one of these extensible services is&#xA;running, an attacker may be able to introduce a malicious&#xA;module&amp;ndash;abusing it to persist on the system.&lt;/p&gt;&#xA;&lt;p&gt;These types of attacks are harder to find&amp;ndash;not because they&amp;rsquo;re deeply&#xA;hidden, but because they&amp;rsquo;re situational and less commonly&#xA;discussed. Not every host will be running Apache or Asterisk, but most&#xA;will be running cron or systemd. As a result, defenders and automated&#xA;security checks often overlook these services entirely.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Linux Persistence: Web Shells</title>
      <link>https://danielroberson.com/post/linux-webshell-persistence/</link>
      <pubDate>Wed, 16 Apr 2025 00:00:00 +0000</pubDate>
      <guid>https://danielroberson.com/post/linux-webshell-persistence/</guid>
      <description>&lt;h1 id=&#34;introduction&#34;&gt;Introduction&lt;/h1&gt;&#xA;&lt;p&gt;This post focuses on web shells on Linux systems, though many of the&#xA;concepts apply to Windows/IIS environments as well&amp;ndash;they&amp;rsquo;re just not&#xA;covered here explicitly.&lt;/p&gt;&#xA;&lt;p&gt;Web servers come in all shapes and sizes, with different languages,&#xA;features, logging behavior, and configurations. These setups can very&#xA;&lt;em&gt;wildly&lt;/em&gt; depending on how clever (or careless, clueless, &amp;hellip;) the&#xA;systems administrators and developers are.&lt;/p&gt;&#xA;&lt;p&gt;This guide doesn&amp;rsquo;t aim to cover web exploitation techniques&amp;ndash;that&amp;rsquo;s a&#xA;&lt;em&gt;deep&lt;/em&gt; and complex topic on its own that many folks build entire&#xA;careers around. Instead, this post focuses on what to look for &lt;em&gt;after&lt;/em&gt;&#xA;a web shell has been placed: how to detect it, and how to harden&#xA;systems against web shell-based attacks.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Linux Persistence: Rootkits</title>
      <link>https://danielroberson.com/post/linux-rootkit-persistence/</link>
      <pubDate>Tue, 15 Apr 2025 00:00:00 +0000</pubDate>
      <guid>https://danielroberson.com/post/linux-rootkit-persistence/</guid>
      <description>&lt;h1 id=&#34;linux-persistence-rootkits&#34;&gt;Linux Persistence: Rootkits&lt;/h1&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://danielroberson.com/zk/20240816142657-rootkit/&#34;&gt;Rootkits&lt;/a&gt; are one of the deepest and&#xA;most complex forms of&#xA;&lt;a href=&#34;https://danielroberson.com/zk/20240806091403-persistence/&#34;&gt;persistence&lt;/a&gt;. This post will only&#xA;scratch the surface, but will walk through the main categories,&#xA;techniques, and practical detection advice.&lt;/p&gt;&#xA;&lt;p&gt;Rootkits focus on stealth, persistence, or both. Some are built solely&#xA;to hide activity (processes, files, network activity), while others&#xA;provide persistent &lt;a href=&#34;https://danielroberson.com/zk/20240818115227-backdoor/&#34;&gt;backdoors&lt;/a&gt; or easy&#xA;&lt;a href=&#34;https://danielroberson.com/zk/20240825100253-privilege_escalation/&#34;&gt;privilege escalation&lt;/a&gt;. Many&#xA;rootkits provide both&amp;ndash;providing a full-fledged&#xA;&lt;a href=&#34;https://danielroberson.com/zk/20240825100253-privilege_escalation./&#34;&gt;post-exploitation&lt;/a&gt;&#xA;solution.&lt;/p&gt;&#xA;&lt;p&gt;While there are many techniques used to implement them, most rootkits&#xA;fall into a few main categories: &lt;a href=&#34;https://danielroberson.com/zk/20250305115439-binary_replacement_rootkit/&#34;&gt;binary&#xA;replacement&lt;/a&gt;,&#xA;&lt;a href=&#34;https://danielroberson.com/zk/20240817172614-ld_preload/&#34;&gt;LD_PRELOAD&lt;/a&gt; and &lt;a href=&#34;https://danielroberson.com/zk/20240817172322-dynamic_linker/&#34;&gt;dynamic&#xA;linker&lt;/a&gt; abuse, &lt;a href=&#34;https://danielroberson.com/zk/20240824154838-lkm/&#34;&gt;Loadable Kernel&#xA;Modules (LKMs)&lt;/a&gt;, and debugging/tracing&#xA;framework abuse (&lt;a href=&#34;https://danielroberson.com/zk/20250412111612-ftrace/&#34;&gt;ftrace&lt;/a&gt;,&#xA;&lt;a href=&#34;https://danielroberson.com/zk/20250403095353-kprobe/&#34;&gt;kprobes&lt;/a&gt;,&#xA;&lt;a href=&#34;https://danielroberson.com/zk/20250404082411-ebpf/&#34;&gt;eBPF&lt;/a&gt;).&lt;/p&gt;</description>
    </item>
    <item>
      <title>Linux Persistence: Processes</title>
      <link>https://danielroberson.com/post/linux-process-persistence/</link>
      <pubDate>Fri, 11 Apr 2025 00:00:00 +0000</pubDate>
      <guid>https://danielroberson.com/post/linux-process-persistence/</guid>
      <description>&lt;h1 id=&#34;linux-persistence-processes&#34;&gt;Linux Persistence: Processes&lt;/h1&gt;&#xA;&lt;p&gt;Malware doesn&amp;rsquo;t appear on a system by magic. At some point in the&#xA;attack chain, the adversary needs to spawn, inject into, or hijack a&#xA;process. Whether it&amp;rsquo;s installing itself, poking around, or&#xA;&lt;a href=&#34;https://danielroberson.com/zk/20240818161525-exfiltration/&#34;&gt;exfiltrating&lt;/a&gt; data, code has to&#xA;run&amp;ndash;and the vessel to run code is almost always a&#xA;&lt;a href=&#34;https://danielroberson.com/zk/20240822142618-process/&#34;&gt;process&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;This post covers how attackers can abuse processes for&#xA;&lt;a href=&#34;https://danielroberson.com/zk/20240806091403-persistence/&#34;&gt;persistence&lt;/a&gt; on Linux and Unix-like&#xA;systems. It isn&amp;rsquo;t a deep dive into &lt;a href=&#34;https://danielroberson.com/zk/20240806091012-process_injection/&#34;&gt;process&#xA;injection&lt;/a&gt;,&#xA;&lt;a href=&#34;https://danielroberson.com/zk/20240816142450-evasion_network_security/&#34;&gt;evasion&lt;/a&gt;, or&#xA;&lt;a href=&#34;https://danielroberson.com/zk/20240819133504-anti_forensics/&#34;&gt;anti-forensics&lt;/a&gt;&amp;ndash;those are entire&#xA;topics on their own&amp;ndash;but it &lt;em&gt;does&lt;/em&gt; establish the foundation you need&#xA;to understand how process-based persistence works and what signs&#xA;defenders should look for.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Defanging Linux LKM Rootkits With cleanup_module()</title>
      <link>https://danielroberson.com/post/defanging-lkms/</link>
      <pubDate>Sat, 05 Apr 2025 00:00:00 +0000</pubDate>
      <guid>https://danielroberson.com/post/defanging-lkms/</guid>
      <description>&lt;h1 id=&#34;defanging-linux-lkm-rootkits-with-cleanup_module&#34;&gt;Defanging Linux LKM Rootkits With cleanup_module()&lt;/h1&gt;&#xA;&lt;p&gt;I recently came across a &lt;a href=&#34;https://github.com/MatheuZSecurity/UnhookingLinuxEdr&#34;&gt;Github&#xA;repository&lt;/a&gt; that&#xA;demonstrated a technique to degrade the integrity of&#xA;&lt;a href=&#34;https://danielroberson.com/zk/20240819155516-edr/&#34;&gt;EDR&lt;/a&gt; software by directly invoking cleanup logic&#xA;common to &lt;a href=&#34;https://danielroberson.com/zk/20240824154838-lkm/&#34;&gt;Loadable Kernel Modules (LKMs)&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;After digging in and testing this for myself, I found the technique&#xA;both sound and technically straightforward.&lt;/p&gt;&#xA;&lt;p&gt;In short, every(?) LKM is defined by a &lt;a href=&#34;https://github.com/torvalds/linux/blob/master/include/linux/module.h#L412&#34;&gt;&lt;em&gt;struct&#xA;module&lt;/em&gt;&lt;/a&gt;&#xA;entry, which includes metadata about the module including things such&#xA;as its name, status, versioning information, etc. One particularly&#xA;interesting member of &lt;em&gt;struct modules&lt;/em&gt; is &lt;em&gt;exit&lt;/em&gt;, a pointer to the&#xA;module&amp;rsquo;s &lt;a href=&#34;https://danielroberson.com/zk/20250405122243-destructor/&#34;&gt;destructor&lt;/a&gt;&#xA;function. Regardless of what the original function is named in the&#xA;module&amp;rsquo;s source code, it gets exported as a symbol&#xA;&lt;a href=&#34;https://danielroberson.com/zk/20241103140030-symbols/&#34;&gt;symbol&lt;/a&gt; named&#xA;&lt;a href=&#34;https://danielroberson.com/zk/20250404082835-cleanup_module/&#34;&gt;&amp;quot;&lt;em&gt;cleanup_module&lt;/em&gt;&amp;quot;&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Linux Persistence: atd</title>
      <link>https://danielroberson.com/post/linux-atd-persistence/</link>
      <pubDate>Tue, 01 Apr 2025 00:00:00 +0000</pubDate>
      <guid>https://danielroberson.com/post/linux-atd-persistence/</guid>
      <description>&lt;h1 id=&#34;linux-persistence-atd-and-at-jobs&#34;&gt;Linux Persistence: atd and at Jobs&lt;/h1&gt;&#xA;&lt;p&gt;On Linux and Unix-like systems, the &lt;a href=&#34;https://danielroberson.com/zk/20250401104343-atd&#34;&gt;&lt;em&gt;atd&lt;/em&gt;&lt;/a&gt;&#xA;daemon allows users to schedule one-time command execution. It is&#xA;similar to &lt;a href=&#34;https://danielroberson.com/post/linux-cron-persistence/&#34;&gt;&lt;em&gt;cron&lt;/em&gt;&lt;/a&gt;, but instead of&#xA;recurring jobs, &lt;em&gt;at&lt;/em&gt; runs a command &lt;strong&gt;once&lt;/strong&gt; at a specified time in&#xA;the future.&lt;/p&gt;&#xA;&lt;p&gt;This system was far more common in a couple of decades ago in the days&#xA;of actual shared, multi-user Unix systems. A sysadmin might need to&#xA;reboot a machine or restart a service but see a dozen users actively&#xA;working. Rather than booting everyone off the system, they could defer&#xA;the action with &lt;em&gt;at&lt;/em&gt;, scheduling it for midnight or some off-peak&#xA;time.  Users, too, might queue up resource-heavy jobs to run after&#xA;hours out of courtesy to others on the system.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Linux Persistence: SSH</title>
      <link>https://danielroberson.com/post/linux-ssh-persistence/</link>
      <pubDate>Sat, 29 Mar 2025 00:00:00 +0000</pubDate>
      <guid>https://danielroberson.com/post/linux-ssh-persistence/</guid>
      <description>&lt;h1 id=&#34;linux-persistence-ssh&#34;&gt;Linux Persistence: SSH&lt;/h1&gt;&#xA;&lt;p&gt;This is a long-form blog post about methods attackers use to achieve&#xA;persistence by leveraging SSH on Linux and Unix-like systems. This&#xA;post ended up being much longer than I originally anticipated&amp;ndash;there&#xA;are a ton of ways to establish persistence and enable lateral movement&#xA;by abusing SSH.&lt;/p&gt;&#xA;&lt;p&gt;Despite the length, I&amp;rsquo;ve probably still missed a few techniques. I&amp;rsquo;ll&#xA;likely revisit this post over time as I come across new methods and&#xA;better approaches.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Linux Hardening: SSH</title>
      <link>https://danielroberson.com/post/ssh-hardening/</link>
      <pubDate>Thu, 06 Mar 2025 00:00:00 +0000</pubDate>
      <guid>https://danielroberson.com/post/ssh-hardening/</guid>
      <description>&lt;h1 id=&#34;introduction&#34;&gt;Introduction&lt;/h1&gt;&#xA;&lt;p&gt;This is a basic guide to hardening OpenSSH systems with a focus on&#xA;Debian and Ubuntu systems. Most of these settings will also work on&#xA;other Linux distributions and Unix-like systems, but some topics such&#xA;as removing the Debian banner or enabling unattended-upgrades are&#xA;specific to these distributions. As such, you need to use your head&#xA;when applying these settings; some may not work well for you as&#xA;written or need to be altered to whatever distribution you are using.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Linux Anti-Forensics: Timestomping</title>
      <link>https://danielroberson.com/post/linux-timestomping/</link>
      <pubDate>Wed, 05 Mar 2025 00:00:00 +0000</pubDate>
      <guid>https://danielroberson.com/post/linux-timestomping/</guid>
      <description>&lt;h1 id=&#34;what-is-timestomping&#34;&gt;What is Timestomping?&lt;/h1&gt;&#xA;&lt;p&gt;Timestomping is an anti-forensics technique used to modify the&#xA;timestamps of files on the file system, allowing attackers to conceal&#xA;when files were written or modifled. By changing timestamps an&#xA;attacker can blend their malicious activity into the system, thus&#xA;reducing the chances of detection during an investigation or casual&#xA;observation.&lt;/p&gt;&#xA;&lt;p&gt;Timestomping is mapped in the MITRE ATT&amp;amp;CK framework as&#xA;&lt;a href=&#34;https://attack.mitre.org/techniques/T1070/006/&#34;&gt;T1070.006&lt;/a&gt; and&#xA;affects all modern operating systems.&lt;/p&gt;&#xA;&lt;p&gt;An example scenario where timestomping may be employed:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Finding Bad with Linux Package Managers</title>
      <link>https://danielroberson.com/post/finding-bad-linux-package-managers/</link>
      <pubDate>Mon, 03 Mar 2025 00:00:00 +0000</pubDate>
      <guid>https://danielroberson.com/post/finding-bad-linux-package-managers/</guid>
      <description>&lt;p&gt;Full-disclosure: I wrote about this on my previous blog&#xA;&lt;a href=&#34;https://dmfrsecurity.com/2020/02/25/finding-bad-with-package-managers/&#34;&gt;https://dmfrsecurity.com/2020/02/25/finding-bad-with-package-managers/&lt;/a&gt;&#xA;and most of the content of this post is copied from this post. The&#xA;dmfrsecurity.com blog will likely be decommissioned in the near&#xA;future.&lt;/p&gt;&#xA;&lt;h1 id=&#34;introduction&#34;&gt;Introduction&lt;/h1&gt;&#xA;&lt;p&gt;Most Linux distributions use package managers (like RPM or dpkg) to&#xA;streamline software installation and updates, making it easier to&#xA;manage dependencies. A lesser-known but crucial feature provided by&#xA;package managers is the ability to verify the integrity of the files&#xA;installed by a package. This post will explore how to use package&#xA;managers to uncover malware and persistence mechanisms on Linux&#xA;systems.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Linux Persistence: Cron</title>
      <link>https://danielroberson.com/post/linux-cron-persistence/</link>
      <pubDate>Sun, 10 Nov 2024 00:00:00 +0000</pubDate>
      <guid>https://danielroberson.com/post/linux-cron-persistence/</guid>
      <description>&lt;h1 id=&#34;introduction-to-cron-persistence&#34;&gt;Introduction to Cron Persistence&lt;/h1&gt;&#xA;&lt;p&gt;A very common tactic for persistence is to use the &lt;a href=&#34;https://danielroberson.com/zk/20240818082024-cron/&#34;&gt;cron&lt;/a&gt; daemon. Cron is a service found on&#xA;Linux and Unix-like operating systems that enables the users of a&#xA;system to schedule arbitrary tasks to run in the future.&lt;/p&gt;&#xA;&lt;p&gt;This technique is mapped in the MITRE ATT&amp;amp;CK framework as&#xA;&lt;a href=&#34;https://attack.mitre.org/techniques/T1053/003/&#34;&gt;T1053.003&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Cron is an attractive choice for attackers and malware to use as&#xA;persistence because it is almost always installed and active for all&#xA;users of a system. If an attacker compromises a user or service&#xA;account, chances are they can install cron jobs as that user.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Linux Persistence: Startup Scripts</title>
      <link>https://danielroberson.com/post/linux-startup-script-persistence/</link>
      <pubDate>Sun, 10 Nov 2024 00:00:00 +0000</pubDate>
      <guid>https://danielroberson.com/post/linux-startup-script-persistence/</guid>
      <description>&lt;h1 id=&#34;linux-persistence-startup-scripts&#34;&gt;Linux Persistence: Startup Scripts&lt;/h1&gt;&#xA;&lt;p&gt;A key feature of most operating systems is the ability to&#xA;automatically run programs or scripts during startup, reboot, or state&#xA;transitions (e.g., resuming from hibernation, connecting to a network).&lt;/p&gt;&#xA;&lt;p&gt;Linux offers several mechanisms to handle this, including SysV-style&#xA;init scripts, &lt;a href=&#34;https://danielroberson.com/zk/20240925105353-systemd/&#34;&gt;&lt;code&gt;systemd&lt;/code&gt;&lt;/a&gt; units, and&#xA;legacy &lt;code&gt;init.d&lt;/code&gt; scripts:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;&lt;code&gt;systemd&lt;/code&gt; &lt;a href=&#34;https://danielroberson.com/zk/20241003150259-systemd_unit/&#34;&gt;unit files&lt;/a&gt; can run&#xA;programs at boot or on a schedule, similar to&#xA;&lt;a href=&#34;https://danielroberson.com/zk/20240818082024-cron/&#34;&gt;cron&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;&lt;code&gt;/etc/init.d&lt;/code&gt; scripts are invoked by the &lt;a href=&#34;https://danielroberson.com/zk/20240828170759-init_process/&#34;&gt;init&#xA;process&lt;/a&gt; during early boot.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Linux Persistence: User Accounts</title>
      <link>https://danielroberson.com/post/linux-user-persistence/</link>
      <pubDate>Sun, 27 Jun 2021 00:00:00 +0000</pubDate>
      <guid>https://danielroberson.com/post/linux-user-persistence/</guid>
      <description>&lt;h1 id=&#34;overview&#34;&gt;Overview&lt;/h1&gt;&#xA;&lt;p&gt;Using the existing logon facilities on a *nix host is a popular and&#xA;straightforward method used by attackers to persist on a system. Once&#xA;an attacker has compromised a set of credentials, they can log in as&#xA;if they were an authorized user.&lt;/p&gt;&#xA;&lt;h1 id=&#34;how-attackers-obtain-credentials&#34;&gt;How attackers obtain credentials&lt;/h1&gt;&#xA;&lt;p&gt;Attackers can obtain valid credentials using several methods:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;&lt;strong&gt;Default credentials&lt;/strong&gt;. A system may come with a valid set of&#xA;credentials configured out of the box. This practice is common in&#xA;consumer equipment and virtual machine appliances. A classic example&#xA;of a default credential is admin/admin.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Review: Adversarial Tradecraft in Cybersecurity</title>
      <link>https://danielroberson.com/post/adversarial-tradecraft-in-cybersecurity/</link>
      <pubDate>Tue, 15 Jun 2021 00:00:00 +0000</pubDate>
      <guid>https://danielroberson.com/post/adversarial-tradecraft-in-cybersecurity/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://danielroberson.com/zk/20240924093811-borges2021/&#34;&gt;Book notes&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;This is my review of &lt;a href=&#34;https://www.amazon.com/Adversarial-Tradecraft-Cybersecurity-real-time-computer/dp/1801076200&#34;&gt;Adversarial Tradectaft in Cybersecurity: Offense&#xA;versus defense in real-time computer conflict&lt;/a&gt; by Dan Borges.&lt;/p&gt;&#xA;&lt;p&gt;I was excited when I heard that Dan was writing a book. I have played&#xA;in several games alongside him and really enjoy working with him each&#xA;time. I also make heavy use of gscript when I play these kinds of&#xA;CTFs, which he was a co-author of. As soon as I saw it on sale on&#xA;Amazon, I pre-ordered it.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
