logoalt Hacker News

GTFOBins

262 pointsby StefanBatorytoday at 6:27 AM67 commentsview on HN

Comments

RagingCactustoday at 7:20 AM

Seeing the confusion in the comments I want to provide some examples of situations where this might come up in a security or CTF context:

* You have a restricted shell or other way to execute a restricted set of commands or binaries, often with arbitrary parameters. You can use GTFOBins in interesting ways to read files, write files, or even execute commands and ultimately break out of your restricted context into a shell.

* Someone allowed sudo access or set the SUID bit on a GTFOBin. Using these tricks, you may be able to read or write sensitive files or execute privileged commands in a way the person configuring sudo did not know about.

show 4 replies
Terr_today at 9:10 AM

> restic - Shell, Command, Upload

Well, now I feel a little vindicated tinkering so that my backup wouldn't run as root. Instead it runs as a regular user with read-all-files capabilities [0] and no login shell.

Of course, that's still probably overkill on my desktop, and any attacker that got that far would still be able to read basically every file on the computer and sneak backdoors into the backup...

[0] https://man7.org/linux/man-pages/man7/capabilities.7.html

laserbeamtoday at 7:14 AM

I am confused. Is this saying that if you don't have access to `cat`, instead of `cat /path/to/input-file` you can use `base64 /path/to/input-file | base64 --decode`?

Or is it saying that `base64 /path/to/input-file | base64 --decode` can bypass read file permission flags?

show 5 replies
scrafttoday at 10:51 AM

The last time I used anything similar to this was circa 1995 at secondary school, using Windows 3.11 computers, that has been set up so you could only launch a small number of authorised applications.

One of those was Word.

In Word you could write macros and use shell to launch other applications.

Suddenly the locked down computer that exposed a handful of applications could run anything (well anything a Windows 3.11 machine in 1995 could run).

It was quite exciting at the time, I don't feel like I have hit the same sort of issues since. Ocassionally I see people say that some touch screen information displays (in shops/shopping centres etc) have ways to escape from kiosk mode (locked to an app) so you can use them for anything, I guess that is similar.

regeckstoday at 7:52 AM

Haha, as a former maintainer to one of these tools, it makes me laugh to see someone pop a shell. Creative, nice work, nice resource.

Tepixtoday at 11:09 AM

Wouldn't it be useful to show ways to mitigate these bypasses?

For example getting a shell with more:

- Setting SHELL to /bin/false before invoking more

- Switching to less in secure mode

- if using more with sudo: NOEXEC flag

mobeigitoday at 11:04 AM

Very neat, definitely some creative approaches in there I didn't expect like `yt-dlp`. Maybe I shouldn't have that just sitting around :)

mettamagetoday at 8:35 AM

I have used this extensively while playing on hackthebox.eu

tgvtoday at 7:16 AM

I'm not sure I get it. base64 is on the list. That can't do anything but read a file to which the user already has access, I think. Am I mistaken or does "a curated list of Unix-like executables that can be used to bypass local security restrictions in misconfigured systems" not mean what I think it does?

show 3 replies
jstrebeltoday at 7:01 AM

But you would already have to have shell access to the system to execute those commands, right?

show 6 replies
alex-moontoday at 8:12 AM

As someone who has had to do some grub editing on the computer in an AirBnB because peripherals were all messed up on the guest account (no internet, no sound, you could only see a tiny part of the screen, I honestly don't know how they had managed to do it) I am super pleased to see this resource. Stuff like this is a bit, you know, hopefully you never need this, but when you do, it is so useful to have it.

biosboiiitoday at 9:31 AM

they should finetune the LLMs with this

show 1 reply
npodbielskitoday at 7:09 AM

Ok. It have hundrends o example for all sort of tools, 7z, dig, git. Those are very popular.

Question from security newbie. Why it is not used to hack all sort of servers all the time then?

show 5 replies
snvzztoday at 9:19 AM

The problem is ambient security, UNIX's security model.

Systems with capability-based security, such as seL4[0], do not suffer from this category of problem.

0. https://sel4.systems/About/

stackghosttoday at 6:54 AM

These come up in CTFs all the time. One trick I don't see here is you can use `dd` to write into the `/proc` hierarchy to achieve all sorts of fuckery including patching shellcode into a running process.

show 3 replies
zoomeriut55today at 6:48 AM

[dead]