Skip to content

Commit

Permalink
Rename custom description to comment
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrus-and committed Aug 13, 2024
1 parent 7d6c122 commit 27ef4b6
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 32 deletions.
16 changes: 8 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ Each entry is defined in a [YAML][] file placed in the [`_gtfobins/`][] folder a

```yaml
---
description:
comment:
functions:
<function>:
- description:
- comment:
version:
code:
contexts:
<context>:
description:
comment:
code:
#
#
Expand All @@ -34,7 +34,7 @@ Where `<function>` and `<context>` are defined in the [`_data/functions.yml`][]

The optional `version` field must outline any particular OS or executable requirements that enable the corresponding function.

The `contexts` object can be omitted altogether, in that case `code` is assumed to be about the `unprivileged` context. When 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. `description` instances can always be omitted, while ultimately there must be one `code` example for each context, either specialized or inherited.
The `contexts` object can be omitted altogether, in that case `code` is assumed to be about the `unprivileged` context. When 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.

### Functions

Expand All @@ -61,13 +61,13 @@ Where:

- the optional `binary` field determines whether the example is able to handle arbitrary binary data or not (defaults to `true`);

- 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 (`description` and `code`);
- 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`);

- 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 (`description` and `code`);
- 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`);

- 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 (`description` and `code`);
- 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`);

- 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 (`description` and `code`);
- 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`);

- the mandayory `from` field that is the name of another executable that the example enables.

Expand Down
34 changes: 17 additions & 17 deletions _layouts/gtfobin.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
{% comment %} function list {% endcomment %}
{% include function_list.html gtfobin=original_gtfobin functions=gtfobin.functions %}

{% comment %} global executable description {% endcomment %}
{% if gtfobin.description %}
{% comment %} global executable comment {% endcomment %}
{% if gtfobin.comment %}
<fieldset>
<legend>Comment</legend>
{{ gtfobin.description | markdownify }}
{{ gtfobin.comment | markdownify }}
</fieldset>
{% endif %}

Expand Down Expand Up @@ -94,11 +94,11 @@ <h2 id="{{ function_name }}" class="function-name">{{- function.label -}}</h2>
{% when "reverse-shell" %}
{% if example.listener %}
{% assign known = function.extra[example.listener] %}
{% assign description = known.description | default: example.listener.description %}
{% assign comment = known.comment | default: example.listener.comment %}
{% assign code = known.code | default: example.listener.code %}
<fieldset>
<legend>Listener</legend>
{{ description | markdownify }}
{{ comment | markdownify }}
{% if code %}
<pre><code>{{- code | escape | strip -}}</code></pre>
{% endif %}
Expand All @@ -107,11 +107,11 @@ <h2 id="{{ function_name }}" class="function-name">{{- function.label -}}</h2>
{% when "bind-shell" %}
{% if example.connector %}
{% assign known = function.extra[example.connector] %}
{% assign description = known.description | default: example.connector.description %}
{% assign comment = known.comment | default: example.connector.comment %}
{% assign code = known.code | default: example.connector.code %}
<fieldset>
<legend>Connector</legend>
{{ description | markdownify }}
{{ comment | markdownify }}
{% if code %}
<pre><code>{{- code | escape | strip -}}</code></pre>
{% endif %}
Expand All @@ -120,11 +120,11 @@ <h2 id="{{ function_name }}" class="function-name">{{- function.label -}}</h2>
{% when "upload" %}
{% if example.receiver %}
{% assign known = function.extra[example.receiver] %}
{% assign description = known.description | default: example.receiver.description %}
{% assign comment = known.comment | default: example.receiver.comment %}
{% assign code = known.code | default: example.receiver.code %}
<fieldset>
<legend>Receiver</legend>
{{ description | markdownify }}
{{ comment | markdownify }}
{% if code %}
<pre><code>{{- code | escape | strip -}}</code></pre>
{% endif %}
Expand All @@ -133,23 +133,23 @@ <h2 id="{{ function_name }}" class="function-name">{{- function.label -}}</h2>
{% when "download" %}
{% if example.sender %}
{% assign known = function.extra[example.sender] %}
{% assign description = known.description | default: example.sender.description %}
{% assign comment = known.comment | default: example.sender.comment %}
{% assign code = known.code | default: example.sender.code %}
<fieldset>
<legend>Sender</legend>
{{ description | markdownify }}
{{ comment | markdownify }}
{% if code %}
<pre><code>{{- code | escape | strip -}}</code></pre>
{% endif %}
</fieldset>
{% endif %}
{% endcase %}

{% comment %} example description {% endcomment %}
{% if example.description %}
{% comment %} example comment {% endcomment %}
{% if example.comment %}
<fieldset>
<legend>Comment</legend>
{{ example.description | markdownify }}
{{ example.comment | markdownify }}
</fieldset>
{% endif %}

Expand Down Expand Up @@ -193,11 +193,11 @@ <h2 id="{{ function_name }}" class="function-name">{{- function.label -}}</h2>
</p>
{% endcase %}

{% comment %} optional local description {% endcomment %}
{% if per_context_info.description %}
{% comment %} optional local comment {% endcomment %}
{% if per_context_info.comment %}
<fieldset>
<legend>Comment</legend>
{{ per_context_info.description | markdownify }}
{{ per_context_info.comment | markdownify }}
</fieldset>
{% endif %}

Expand Down
2 changes: 1 addition & 1 deletion gtfobins.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{% for file in site.gtfobins -%}
{%- capture gtfobin -%}{%- include get_gtfobin_name.html path=file.path -%}{%- endcapture -%}
{{ gtfobin | jsonify -}}: {
{%- assign root_fields = 'description,functions,alias' | split: ',' -%}
{%- assign root_fields = 'comment,functions,alias' | split: ',' -%}
{%- assign comma = false -%}
{%- for field in root_fields -%}
{%- if file[field] -%}
Expand Down
12 changes: 6 additions & 6 deletions linter/linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def _build_schema(self):
non_empty_string = schema.And(str, len)

default_context_example_fields = {
schema.Optional('description'): non_empty_string,
schema.Optional('comment'): non_empty_string,
schema.Optional('code'): non_empty_string,
}

Expand All @@ -45,17 +45,17 @@ def _build_schema(self):
schema.Optional('version'): non_empty_string,
}

description_or_code = {
schema.Or('description', 'code'): non_empty_string,
comment_or_code = {
schema.Or('comment', 'code'): non_empty_string,
}

network_shell_counterpart = schema.Or(
description_or_code,
comment_or_code,
# ...
)

network_file_counterpart = schema.Or(
description_or_code,
comment_or_code,
# ...
)

Expand Down Expand Up @@ -138,7 +138,7 @@ def check_code_coherence(example):
schema.Or({
'alias': non_empty_string,
}, {
schema.Optional('description'): non_empty_string,
schema.Optional('comment'): non_empty_string,
**functions,
})
)
Expand Down

0 comments on commit 27ef4b6

Please sign in to comment.