GTFOBins.github.io/_layouts/bin.html

51 lines
1.1 KiB
HTML

---
layout: common
---
{% capture bin_name %}{% include get_bin_name path=page.path %}{% endcapture %}
{% include page_title.html title=bin_name %}
{% include function_list.html bin=page %}
{{ page.description | markdownify }}
{% for function in site.data.functions %}
{% assign function_name = function[0] %}
{% assign examples = page.functions[function_name] %}
{% if examples %}
<h2 id="{{ function_name }}" class="function-name">
{{- site.data.functions[function_name].label -}}
</h2>
{{ site.data.functions[function_name].description | markdownify }}
<ul class="examples">
{% for example in examples %}
{% capture code %}
{%- if function_name == 'suid-enabled' or function_name == 'suid-limited' %}
cp $(which {{ bin_name }}) .
sudo sh -c 'chown 0 ./{{ bin_name }}; chmod +s ./{{ bin_name }}'
{% endif %}
{%- if function_name == 'capabilities-enabled' %}
cp $(which {{ bin_name }}) .
sudo setcap cap_setuid+ep {{ bin_name }}
{% endif %}
{{ example.code }}
{% endcapture %}
<li>
{{ example.description | markdownify }}
<pre><code>{{- code | strip -}}</code></pre>
</li>
{% endfor %}
</ul>
{% endif %}
{% endfor %}