Skip to content

Commit

Permalink
Refactor CONTRIBUTING.md and add conventions stub
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrus-and committed Jul 23, 2024
1 parent 7b993b7 commit 1deebf4
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 3 deletions.
60 changes: 57 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ description: Get involved in GTFOBins.
permalink: /contributing/
---

## File format

Feel free to use any file in the [`_gtfobins/`] folder as an example.

Each 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 document enclosed in delimiters: `---` and `...`. The general structure is the following:

```yaml
Expand Down Expand Up @@ -44,14 +48,18 @@ Some functions support additional fields:

- `reverse-shell` and `bind-shell` allows a `limited` flag that is `true` when the example is not able to spawn a full TTY shell.

- `file-write`, `file-read`, `upload`, and `download` allows a `limited` flag that is `true` when the example is not able handle arbitrary binary data.
- `file-write`, `file-read`, `upload`, and `download` allows a `limited` flag that is `true` when the example is not able handle arbitrary binary data;

- `inherit` requires a `from` field that is the name of another executable that the example enables.

Some contexts support additional fields:

- `suid` allows a `limited` flag that is `true` when the example only works with distributions whose default shell does not drop SUID privileges;

- `capabilities` requires a `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.

### Aliases

Additionally, it is possible to add _aliases_ with:

```yaml
Expand All @@ -62,9 +70,55 @@ alias: <gtfobin>

In this case, this entry is an alias of an existing `<gtfobin>`.

Feel free to use any file in the [`_gtfobins/`] folder as an example.
## Conventions

### Placeholders

Use the following placeholder values where appropriate:

| Type | Value |
|----------------------|------------------------|
| Shell executable | `/bin/sh` |
| Command executable | `/bin/id` |
| Network port | `12345` |
| Data to be written | `DATA` |
| Whatever value | `x...x` |
| Input file | `/path/to/input-file` |
| Output file | `/path/to/output-file` |
| Attacker host domain | `attacker.com` |

### Multiline strings

If a multiline string is needed, use the `-` YAML literal variant, i.e., `|-`, for example:

```
some-field: |-
Lorem ipsum...
```

### Links

If needed, link to other entries using relative URLs, e.g, `[gtfobin](../gtfobin)`.

## Local development

To test local changes, start a local instance with:

```
make serve
```

This 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.

Before submitting any pull request, make sure the linter completes successfully:

```
make lint
```

Then use `make clean` to clean everything up.

[YAML]: https://yaml.org/
[`_gtfobins/`]: https://github.com/GTFOBins/GTFOBins.github.io/tree/master/_gtfobins
[`_data/functions.yml`]: https://github.com/GTFOBins/GTFOBins.github.io/blob/master/_data/functions.yml
[`_data/contexts.yml`]: https://github.com/GTFOBins/GTFOBins.github.io/blob/master/_data/contexts.yml
[`_gtfobins/`]: https://github.com/GTFOBins/GTFOBins.github.io/tree/master/_gtfobins
14 changes: 14 additions & 0 deletions assets/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,16 @@ fieldset {
}
}

table {
&, th, td {
border: 1px solid $foreground;
}

th, td {
padding: 0.25em 0.5em;
}
}

// permalink on headings

h2, h3, h4, h5, h5 {
Expand Down Expand Up @@ -210,6 +220,10 @@ h2, h3, h4, h5, h5 {
width: 100%;
border-spacing: 0;

&, th, td {
border: none;
}

thead {
th {
padding: 1em;
Expand Down

0 comments on commit 1deebf4

Please sign in to comment.