News for hackers. Stuff that matters.
Re:Using LD_PRELOAD to cheat, inject features and investigat... by jwilk on Monday December 04, 2017 @06:47AM (#15843200)
Re:Using LD_PRELOAD to cheat, inject features and investigat... by thomasballinger on Monday December 04, 2017 @11:19AM (#15844976)
Here's an idea that I like (so much that I wrote an implementation): use LD_PRELOAD to swap out readline with version that forks on each input. Kill the forked child process and you have undo! https://github.com/thomasballinger/rlundo post: http://ballingt.com/interactive-interpreter-undo/#hacking-fo...
Re:Using LD_PRELOAD to cheat, inject features and investigat... by Fnoord on Monday December 04, 2017 @07:21AM (#15843313)
libfaketime can be used for nefarious things such as using software past its trial stage (same with using serials attached to MAC addresses + mac spoofing) or returning future TOTP data. Its generally useful for QA as well. It could've been used by Apple to avoid the reset bug in iOS 11.1.2

fakechroot is used when you build your own *.deb file.

libeatmydata can be used in environments where you'd destroy the data afterwards anyway, or where you don't need logging or keep state after a reboot. You can also mount a bunch of filesystems such as /tmp and /var/log as tmpfs though.

Re:Using LD_PRELOAD to cheat, inject features and investigat... by jwilk on Monday December 04, 2017 @12:48PM (#15845822)
> fakechroot is used when you build your own *.deb file.

That's "fakeroot", a different program, which is used for simulating superuser privileges.

I was going to mention fakeroot, too, but it doesn't seem have a useful homepage. https://fakeroot.alioth.debian.org/ looks very much uninviting.

fakeroot was written for Debian, and it's still developed by Debian developers, although there's nothing Debian-specific about it. Debian has giving back to the free software community in their Social Contract¹, but in practice there's no culture of making Debian software easily accessible to outsiders. :-(

¹ https://www.debian.org/social_contract §2

Re:Using LD_PRELOAD to cheat, inject features and investigat... by rrix2 on Monday December 04, 2017 @11:25AM (#15845031)
libfaketime is also still crucial for reproduceable builds with a lot of compiers embedding compilation date, too, right?
Re:Using LD_PRELOAD to cheat, inject features and investigat... by jwilk on Monday December 04, 2017 @12:53PM (#15845863)
At least Debian folks didn't have to resort to using libfaketime. Instead, they patch the embedding tools to use timestamp from environment:

https://reproducible-builds.org/specs/source-date-epoch/

Re:Using LD_PRELOAD to cheat, inject features and investigat... by DavidBuchanan on Monday December 04, 2017 @11:43AM (#15845196)
Here's my take on libfaketime, which hooks also hooks syscalls:

https://github.com/DavidBuchanan314/TARDIS

It isn't intended for any kind of serious usage, I mainly just wanted to understand ptrace and LD_PRELOAD.

Re:Using LD_PRELOAD to cheat, inject features and investigat... by gpderetta on Monday December 04, 2017 @08:14AM (#15843542)
Onload [1], which is extensively used in some corners of the computing world, also relies on LD_PRELOAD.

[1] http://www.openonload.org/

Re:Using LD_PRELOAD to cheat, inject features and investigat... by eigengrau on Monday December 04, 2017 @07:09AM (#15843280)
Addendum: https://github.com/sickill/stderred - colorizing wrapper for stderr
Re:Using LD_PRELOAD to cheat, inject features and investigat... by jpablo on Monday December 04, 2017 @08:37AM (#15843648)
There is also retrace (https://github.com/riboseinc/retrace)
Re:Using LD_PRELOAD to cheat, inject features and investigat... by fireflash38 on Monday December 04, 2017 @10:42AM (#15844657)
Re:Using LD_PRELOAD to cheat, inject features and investigat... by xioxox on Monday December 04, 2017 @08:14AM (#15843547)
tsocks [1] is also interesting. It lets you run a program forwarding all its network data through a SOCKS proxy. It's very useful if you want to VPN a single application over a SSH connection.

[1] http://tsocks.sourceforge.net/