Re:Userland rootkits are lame (2022)
by benob on Monday July 01, 2024 @01:01AM
(#40842643)
What are uses of LD_PRELOAD that make us keep it?
[ Parent
| on HN ]
Replacing allocators https://github.com/jemalloc/jemalloc/wiki/Getting-Started
Pretending you're running on a remote system https://github.com/viraptor/libremotec
Cheat in games https://github.com/ProfessionallyEvil/LD_PRELOAD-rand-Hijack...
Fixing bugs where the upstream can't do it.
Some uses of LD_PRELOAD off the top of my head:
- GNU stdbuf (BSDs use an env-var instead of hijacking libc)
- fakeroot
- gprofng's data collector
- For a long time it was necessary to use LD_PRELOADto hack around a bug in flashplayer because flashplayer used memcpy when it should have used memmove.
Do you mean the functionality itself (inherent in the capabilities of a dynamic ELF loader) or specifically that it uses an environment variable? Maybe moving it to static configuration in ld.so.conf would cut down on abuse.
tsocks is quite useful for proxying a program's network access over ssh using SOCKS. I use it for accessing geo-blocked servers using command line tools without a full VPN.
Re:Userland rootkits are lame (2022)
by worthless-trash on Monday July 01, 2024 @01:05AM
(#40842664)
Fixing bugs in a function in a library. Overriding libraries.
Re:Userland rootkits are lame (2022)
by freeone3000 on Monday July 01, 2024 @01:57AM
(#40842944)
Patching the binary seems like a better way to do this.
Re:Userland rootkits are lame (2022)
by worthless-trash on Monday July 01, 2024 @04:11AM
(#40843610)
Better long term,but also much harder. Some anti cheat software will be tripped if you do this as they checksum the binaries on disk, that of course can be worked around so its just a matter of understanding your adversary.