9 comments

  • jraph20 days ago
    &gt; If one did wish to use Singularity for nefarious purposes, however, the code is MIT licensed and freely available — using it in that way would only be a crime, not an instance of copyright infringement.<p>Too bad the author picked the MIT license. Had they picked (A)GPL, it would have forced the criminals to distribute a copy of LICENSE.TXT alongside their improved copy of the source code on systems they compromise. Failing this, using it in that way would be both a crime and an instance of copyright infringement.<p>Although, it occurs to me that if they don&#x27;t give credits to the original author, it&#x27;s also already a copyright infringement under the MIT.
    • jjmarr19 days ago
      If I might interject for a moment, you should&#x27;ve recommended the (A)GPLv3.<p>The anti-tivoization clause in Version 3 would allow users to modify and replace the rootkit with their own, more or less malicious version, even if it would otherwise violate copyright law.
    • Onavo19 days ago
      It&#x27;s nice until you get spammed with emails from angry users. I think it happened to the sqlite and other popular open source project authors. Non technical users think they are polluting their computer.<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=42358470">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=42358470</a>
      • rascul19 days ago
        It happened to thttpd<p><a href="https:&#x2F;&#x2F;www.acme.com&#x2F;software&#x2F;thttpd&#x2F;repo.html" rel="nofollow">https:&#x2F;&#x2F;www.acme.com&#x2F;software&#x2F;thttpd&#x2F;repo.html</a>
        • Alive-in-202519 days ago
          The person in that thread could explain the situation a lot more better to the non technical users. You could do this:<p>&quot;I don&#x27;t know what happened to your computer but you seem to be saying someone hacked your computer and installed some software and you found acme.com mentioned on it. This was not done by me. acme.com is open source software that is freely available to anyone. This is the same as if someone installed software on your computer that mentions the google chrome web browser - that would not indicate google had anything to do with that action, since google chrome is freely available too.&quot;
      • pseudohadamard19 days ago
        This is why our temp files have names like malware_dropper.exe and bitcoin_scam.xls. If anyone sees those they assume it&#x27;s some virus and don&#x27;t bother us with them.
    • kazinator19 days ago
      &gt; <i>crime and an instance of copyright infringement.</i><p>Well-made distinction; +1.
    • written-beyond19 days ago
      Thank you for the laugh!
    • ilvez20 days ago
      It&#x27;s probably an old joke, but heard it here first. LOL
      • jraph20 days ago
        I don&#x27;t know about you, but for ethical reasons, I only allow libre rootkits to run on my systems.
        • fc417fc80219 days ago
          It&#x27;s just like a gun free zone. You glue a prominent sign to your laptop that uses bright colors and an imposing font. &quot;No proprietary software permitted!&quot; Problem solved.
          • throawayonthe19 days ago
            i think this comment is referring to the uniquely american controversy over &quot;gun free zones&quot;, ie zones where... you aren&#x27;t allowed to carry firearms by law, often marked with a sign<p>which i find very entertaining, saying &quot;a sign can&#x27;t stop a criminal!&quot; as if that&#x27;s not the case with any law enforced via threat of criminal prosecution
            • fc417fc80219 days ago
              I don&#x27;t think I&#x27;d call it a controversy exactly. There are places where the signs make sense (ex court buildings) and then there are places where they are purely performative. When a school in the ghetto that suffers gang related violence prominently posts such signs they rightfully get made fun of. Meanwhile most schools (at least where I grew up) either don&#x27;t bother to post such signs or only post a subdued &quot;all weapons illegal&quot; near the entrance (that includes even pocket knives BTW it&#x27;s not just a gun thing).<p>Another great one is &quot;drug free zone&quot; seen plastered all over a seedy highschool. Drugs are blanket illegal everywhere here. The US has made an art form out of persecuting drug users. We&#x27;ve peddled our &quot;war on drugs&quot; globally. What could possibly be the point of posting such a sign?
              • pests19 days ago
                &gt; What could possibly be the point of posting such a sign?<p>If you want a real answer, its increased penalties &#x2F; extra charges if caught in the &quot;zone&quot;.
        • sva_20 days ago
          Do you compile them yourself then? For possible arch specific optimizations
          • da_chicken19 days ago
            Are you even free if your rootkit isn&#x27;t part of Gentoo Stage 0?
    • reactordev20 days ago
      They checked with their lawyers first… lol.<p>Pretty sure all laws are null and void in their mind.
    • matheuzsec19 days ago
      HAHAHAHAHAH I genuinely laughed a lot, thank you
  • TacticalCoder19 days ago
    &gt; The Ftrace mechanism can be disabled at run time, of course — so Singularity helpfully enables it automatically and blocks any attempts to turn it off.<p>Can a kernel be compiled with Ftrace forced off? If it can be disabled at runtime, I take it it&#x27;s not mandatory for the kernel to work. And I don&#x27;t just mean off: I mean striping the Ftrace code path (dead code elimination or whatever).<p>I&#x27;m also interested in other measures, like a unified kernel moreover without the ability to load modules but this is not what my question is about. I&#x27;d like to know if Ftrace can just be turned off for good at kernel compile time.
    • suprjami19 days ago
      Looks like yes<p>grep FTRACE &#x2F;boot&#x2F;config*
  • bmitch302020 days ago
    Previously discussed at <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=46498658">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=46498658</a>
  • XorNot20 days ago
    Man I just discovered this as a good guide on how to exceed the normal limits on Linux kernel modules.<p>Been working on a derviative which hooks the VFS to allow dynamically remapping file paths on a per process basis so I can force badly behaved apps to load custom TLS certificates (looking at you Bazil builds in nixpkgs).<p>(If anyone knows something which already does this it would save me a lot of yak shaving)
    • st_goliath20 days ago
      &gt; how to exceed the normal limits on Linux kernel modules.<p>Uh, what limits? I&#x27;m not aware of <i>anything</i> that would stop your module, once probed, from reaching around the back of the kernel and futzing around in the internals of another driver&#x2F;device in a completely unrelated subsystem, or subsystem internals. SoC&#x2F;SoM vendors <i>love</i> to pull that kind of crap in their BSPs.<p>&gt; hooks the VFS to allow dynamically remapping file paths on a per process basis<p>Instead of messing with kernel VFS internals, you could try:<p>- patching the offending application or package (ideally make the path configurable and contribute that back upstream)<p>- running the application in a mount namespace and bind-mount something over the path<p>- use LD_PRELOAD to wrap fopen&#x2F;open&#x2F;openat (I&#x27;m pretty sure, ready made solutions for this already exist)
      • fc417fc80219 days ago
        &gt; use LD_PRELOAD to wrap fopen&#x2F;open&#x2F;openat (I&#x27;m pretty sure, ready made solutions for this already exist)<p>I think I would literally recompile libc to patch fopen&#x2F;open&#x2F;openat long before I would even begin to consider writing a kernel module to mess with filesystem paths on a per-process basis.<p>I feel like if you find yourself seriously considering writing a kernel module then you are either contributing to kernel development, or have embarked on an adventure specifically to learn about kernel internals, or have take a <i>very</i> wrong turn.
        • thwarted19 days ago
          LD_PRELOAD has nothing to do with the kernel, it&#x27;s entirely resolved in user space; in this context, it would be used to replace libc functions.<p>&gt; I think I would literally recompile libc to patch fopen&#x2F;open&#x2F;openat<p>That&#x27;s literally the functionality that LD_PRELOAD provides without having to recompile libc.
          • fc417fc80219 days ago
            Yes, I am aware. I was suggesting that even going to the ridiculous length of patching and replacing libc system wide would likely make more sense than authoring a custom kernel module to accomplish most tasks for which such options are applicable.
            • XorNot19 days ago
              Statically compiled binaries don&#x27;t use libc. Golang is one, anything with Rust and MUSL is another, and reliably injecting an environment variables into Nix is well..not reliable. It also links its own hashed libc paths which you can&#x27;t predict and which shouldn&#x27;t be different to any process which isn&#x27;t trying to establish TLS connections.<p>It&#x27;s not like I didn&#x27;t try this stuff.
              • fc417fc80219 days ago
                You can hook the system call to open a file regardless of libc use. If for some strange reason you really wanted to patch libc and the program you&#x27;re using statically links it (ex musl) that isn&#x27;t an issue - just patch the relevant libc implementation and recompile. But more generally, if you have access to the source code then why would you not directly patch the program in question instead of resorting to these sorts of shenanigans?<p>Seriously, you&#x27;re doing it wrong. Just hook the relevant system call and be done with it. Your usecase is literally one of the first eBPF tutorials that comes up when looking for information about modifying system call arguments. <a href="https:&#x2F;&#x2F;github.com&#x2F;eunomia-bpf&#x2F;bpf-developer-tutorial&#x2F;tree&#x2F;main&#x2F;src&#x2F;34-syscall" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;eunomia-bpf&#x2F;bpf-developer-tutorial&#x2F;tree&#x2F;m...</a>
            • matheuzsec19 days ago
              [dead]
    • linuxftw20 days ago
      &gt; Been working on a derviative which hooks the VFS to allow dynamically remapping file paths on a per process basis so I can force badly behaved apps to load custom TLS certificates (looking at you Bazil builds in nixpkgs).<p>chroot or namespaces&#x2F;containers?
      • fc417fc80219 days ago
        Well he said nix so it&#x27;s probably hardcoded to load from the store. Tampering with the store itself might have unintended consequences if anything else references the same certificate package.
    • never_inline19 days ago
      +1 for userns, there&#x27;s also proot (userspace chroot) and fakechroot (using LD_PRELOAD).
  • markus_zhang20 days ago
    Ah this is so interesting. Rootkits are difficult to implement already, and RE them definitely is another level. Now we have a guidance.
  • kazinator19 days ago
    Sorry, I like my rootkits proprietary, closed-source, with a click-through&#x2F;shrinkwrap EULA.
    • yunnpp19 days ago
      And then having to accept a privacy policy after you buy&#x2F;install the rootkit.
  • exabrial19 days ago
    &gt; Users who feel their computers are too secure can install the Singularity kernel module in order to allow remote code execution, disable security features, and hide files and processes from normal administrative tools.<p>Hah
  • sabdarmdhn19 days ago
    Since i dont know about Linux Rootkit, isnt this gonna raise the potential of Cyberattack?
    • Retr0id19 days ago
      No, plenty of open-source linux rootkits already exist (although this one does look more modern&#x2F;maintained than most).
  • siliconunit19 days ago
    as much as I&#x27;m all for the freedom of knownledge, given the sorry state of the world, releasing these tools to imbecils is not peak foresight.. mcafee for linux next ha..&#x2F;s
    • void-star19 days ago
      Public Linux rootkits have been around a very very long time. Nothing new here in that regard. Also Linux AV has been around almost as long…<p>This effort is more useful to up and coming defenders and security researchers than attackers by far.
    • rurban19 days ago
      Most such rootkits source code is online and easy to find. So that rootkit finders get better.