Code Monkey home page Code Monkey logo

Comments (4)

cyrus-and avatar cyrus-and commented on May 20, 2024

Hey! That's expected of course, none of the commands listed here will allow you to escalate your privileges in an unintended way, meaning that they're not exploits, that just how they work, there's nothing to fix from the vendor perspective. The goal of GTFOBins is to collect some ways a binary/script can be used to perform some action.

Now, cat is a bit of a stretch here, because yeah, cat reads file right? But it has been added for completeness, and as you can image makes little sense in you just run it from a shell.

(As a side note, we often use the term "restricted shell" in a broad way, but restricted shells though, are particular feature that some shells have, think of it of a very loose jailed environment, and some of the techniques listed here allow to bypass it, but it's quite trivial and not the whole point. See RESTRICTED SHELL in man bash.)

Take for example a scenario in which you have some limited form of command execution via, say, a vulnerable PHP web application, where you only have some commands available, you want to read some file, so you query GTFOBins and you obtain a list of binaries, cat is one of them. So you can use it to reach your goal. Again, the fact that cat reads files is not big news, but still, it's something that GTFOBins should return as an answer to that query.

I hope this makes sense, feel free to ask otherwise. :)

from gtfobins.github.io.

cho-uc avatar cho-uc commented on May 20, 2024

Hello,

Many thanks for your answer! πŸ‘πŸ½
I read up about RESTRICTED SHELL and it makes everything clear now.

Another question:
If you put in cat in the list, is there a reason why you didn't put ls as well?
Using ls can also list up all directories and files outside of the restricted dir.

from gtfobins.github.io.

cyrus-and avatar cyrus-and commented on May 20, 2024

If you put in cat in the list, is there a reason why you didn't put ls as well?
Using ls can also list up all directories and files outside of the restricted dir.

Yeah, as you can imagine the list of functions supported by GTFOBins is only a small subset of all the possible functions that are actually useful in a pentest/hacking context, and the definition is often quite blurry, it would be realistically impossible to map precisely all the functions provided by those binaries.

Also, you might have noticed that there's no file copy, and for the same reason; in those cases we usually just use file write. And same goes to a certain extent with ls: file list would probably be too much, I guess that could be reduced to a file read.

The list of functions is not fixed though but we're quite conservative about it.

from gtfobins.github.io.

cho-uc avatar cho-uc commented on May 20, 2024

Ok, it's clear now.
Many thanks! 😁

from gtfobins.github.io.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.