Skip to content

Commit

Permalink
Added new filters and changed contribute page
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnWoodman committed Dec 10, 2020
1 parent 6ed145b commit 5da4427
Show file tree
Hide file tree
Showing 51 changed files with 591 additions and 652 deletions.
8 changes: 8 additions & 0 deletions _data/OS.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
Linux:
label: Linux
description: Command can be run on Linux.

Windows:
label: Windows
description: Command can be run on Windows.
12 changes: 12 additions & 0 deletions _data/attack_types.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
Enumeration:
label: Enumeration
description: Command focuses on enumeration.

Exploitation:
label: Exploitation
description: Command focuses on exploitation.

Persistance:
label: Persistance
description: Command focuses on persistence.
2 changes: 0 additions & 2 deletions _data/items.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
# this is the rendering order of items

Username:
label: Username
description: You've found username(s) and need to know what you can do with them.
Expand Down
14 changes: 0 additions & 14 deletions _data/filters.yml → _data/services.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
# this is the rendering order of filters

SMB:
label: SMB
description: You've found the SMB service open and need to know what you can do with it.
Expand All @@ -24,15 +22,3 @@ RPC:
LDAP:
label: LDAP
description: You've found the LDAP service open and need to know what you can do with it.

Enumeration:
label: Enumeration
description: Command is focused on enumeration.

Linux:
label: Linux
description: Command can be run on Linux.

Windows:
label: Windows
description: Command can be run on Windows.
97 changes: 78 additions & 19 deletions _includes/bin_table.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@

<div id="bin-search-wrapper">

<ul id="bin-search-filters" class="filter-list">
<h3>Filters:</h3>
{% for filter_pair in site.data.filters %}
{% assign filter_id = filter_pair[0] %}
{% assign filter = filter_pair[1] %}
<li><input type="checkbox" id="{{ filter.label }}" name="filter_name" onclick='handleChange(this, "{{ filter.label }}");'><label id="{{ filter.label }}_label" for="{{ filter.label }}" data-title="{{ filter.description | replace: '\n', ' ' }}">{{ filter.label }}</label></li>
{% endfor %}
</ul>
<ul id="bin-search-filters" class="filter-list">
<h3>What you have:</h3>
{% for item_pair in site.data.items %}
Expand All @@ -23,9 +15,33 @@ <h3>What you have:</h3>
<li><input type="checkbox" id="{{ item.label }}" name="item_name" onclick='handleChange(this, "{{ item.label }}");'><label id="{{ item.label }}_label" for="{{ item.label }}" data-title="{{ item.description | replace: '\n', ' ' }}">{{ item.label }}</label></li>
{% endfor %}
</ul>
<ul id="bin-search-filters" class="filter-list">
<h3>Services:</h3>
{% for service_pair in site.data.services %}
{% assign service_id = service_pair[0] %}
{% assign service = service_pair[1] %}
<li><input type="checkbox" id="{{ service.label }}" name="service_name" onclick='handleChange(this, "{{ service.label }}");'><label id="{{ service.label }}_label" for="{{ service.label }}" data-title="{{ service.description | replace: '\n', ' ' }}">{{ service.label }}</label></li>
{% endfor %}
</ul>
<ul id="bin-search-filters" class="filter-list">
<h3>Attack Type:</h3>
{% for attack_pair in site.data.attack_types %}
{% assign attack_id = attack_pair[0] %}
{% assign attack = attack_pair[1] %}
<li><input type="checkbox" id="{{ attack.label }}" name="attack_name" onclick='handleChange(this, "{{ attack.label }}");'><label id="{{ attack.label }}_label" for="{{ attack.label }}" data-title="{{ attack.description | replace: '\n', ' ' }}">{{ attack.label }}</label></li>
{% endfor %}
</ul>
<ul id="bin-search-filters" class="filter-list">
<h3>OS:</h3>
{% for OS_pair in site.data.OS %}
{% assign OS_id = OS_pair[0] %}
{% assign OS = OS_pair[1] %}
<li><input type="checkbox" id="{{ OS.label }}" name="OS_name" onclick='handleChange(this, "{{ OS.label }}");'><label id="{{ OS.label }}_label" for="{{ OS.label }}" data-title="{{ OS.description | replace: '\n', ' ' }}">{{ OS.label }}</label></li>
{% endfor %}
</ul>

<input id="bin-search" type="text" placeholder="Search among {{ site.wadcoms | size }} commands: <command> +<filter> ..."/>
</div>
<input id="bin-search" type="text" placeholder="Search among {{ site.wadcoms | size }} commands: <command> +<filter> ..."/>

<div id="bin-table-wrapper">
<table id="bin-table">
Expand All @@ -37,7 +53,7 @@ <h3>What you have:</h3>
<tbody>
{% for file in site.wadcoms %}
<tr>
<td><div class="bin-name"><a href="{{ file.url }}" id="{{ file.url }}" style="text-decoration: none; color: DarkGreen;">{% include get_code.html page_test=file %}</a><a href="javascript:void(0)" onClick="copyFunction('{{ file.url }}')" style="float: right;"><img src="/assets/copy-button.svg" alt="Copy" title="Copy" id="{{ file.url }}_img"/></a></div><p style="margin-top: -12px;">{% include filter_list.html bin=file %}</p></td>
<td><div class="bin-name"><a href="{{ file.url }}" id="{{ file.url }}" style="text-decoration: none; color: DarkGreen;">{{ file.command }}</a><a href="javascript:void(0)" onClick="copyFunction('{{ file.url }}')" style="float: right;"><img src="/assets/copy-button.svg" alt="Copy" title="Copy" id="{{ file.url }}_img"/></a></div><p style="margin-top: -12px;">{% include filter_list.html bin=file %}</p></td>
</tr>
{% endfor %}
</tbody>
Expand Down Expand Up @@ -96,9 +112,14 @@ <h3>What you have:</h3>
var noResults = true;

var allItems = document.getElementsByName("item_name");
var allFilters = document.getElementsByName("filter_name");
var allFilters = document.getElementsByName("service_name");
var allAttacks = document.getElementsByName("attack_name");
var allOS = document.getElementsByName("OS_name");
var allItems_parsed = [];
var allFilters_parsed = [];
var allAttacks_parsed = [];
var allOS_parsed = [];

allFilters.forEach((f) => {
allFilters_parsed.push(f.id.toLowerCase());
});
Expand All @@ -107,6 +128,14 @@ <h3>What you have:</h3>
allItems_parsed.push(i.id.toLowerCase());
});
var item_chosen = functionPatterns.filter(element => allItems_parsed.includes(element));
allAttacks.forEach((a) => {
allAttacks_parsed.push(a.id.toLowerCase());
});
var attack_chosen = functionPatterns.filter(element => allAttacks_parsed.includes(element));
allOS.forEach((o) => {
allOS_parsed.push(o.id.toLowerCase());
});
var os_chosen = functionPatterns.filter(element => allOS_parsed.includes(element));

document.querySelectorAll('#bin-table tbody tr').forEach(function (row) {
var show = true;
Expand Down Expand Up @@ -160,7 +189,7 @@ <h3>What you have:</h3>
}
var filled = true;
var found_binName = false;
if (binName.indexOf(binPattern) !== -1) {
if (binName.indexOf(binPattern) !== -1 && binPattern.length !== 0) {
found_binName = true;
}

Expand All @@ -175,25 +204,55 @@ <h3>What you have:</h3>

{% endfor %}
});
var found_filter = false;

var found_filter = -1;
if (filter_chosen.length !== 0) {
found_filter = false;
found_filter = 0;
filter_chosen.forEach((f) => {
functionElems.forEach((i) => {
if (i.innerText.toLowerCase() == f) {
found_filter = true;
found_filter = found_filter + 1;
}
});
});
}

var found_attack = -1;
if (attack_chosen.length !== 0) {
found_attack = 0;
attack_chosen.forEach((a) => {
functionElems.forEach((i) => {
if (i.innerText.toLowerCase() == a) {
found_attack = found_attack + 1;
}
});
});
}

var found_os = -1;
if (os_chosen.length !== 0) {
found_os = 0;
os_chosen.forEach((o) => {
functionElems.forEach((i) => {
if (i.innerText.toLowerCase() == o) {
found_os = found_os + 1;
}
});
});
}

if (!filled && (functionPatterns.length != 0 && !found_filter) || !found_binName || (found_filter && !filled && item_chosen.length !== 0) || (!found_filter && filled && filter_chosen.length !== 0)) {
row.style.display = 'none';
if ((!filled && (found_attack < 1 && found_filter < 1 && found_os < 1 && !found_binName)) || (found_attack == 0 || found_filter == 0 || found_os == 0) || (!filled && item_chosen.length !== 0) || ((found_attack !== attack_chosen.length && found_attack !== -1) || (found_filter !== filter_chosen.length && found_filter !== -1) || (found_os !== os_chosen.length && found_os !== -1)) || (binPattern.length !== 0 && !found_binName)) {
row.style.display = 'none';
} else {
row.style.display = '';
noResults = false;
row.style.display = '';
noResults = false;
}

if (functionPatterns.length == 0 && binPattern.length == 0) {
row.style.display = '';
noResults = false;
}

});

// update the search message visibility
Expand Down
30 changes: 24 additions & 6 deletions _includes/filter_list.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,33 @@
<ul class="filter-list">
{% for attack_pair in site.data.attack_types %}
{% assign attack_id = attack_pair[0] %}
{% assign attack = attack_pair[1] %}
{% if include.bin.attack_types contains attack_id %}
<li><a href="{{ include.bin.url }}#{{ attack_id }}">{{ attack.label }}</a></li>
{% endif %}
{% endfor %}

{% for item_pair in site.data.items %}
{% assign item_id = item_pair[0] %}
{% assign item = item_pair[1] %}
{% unless include.bin.items[item_id] %}{% continue %}{% endunless %}
{% if include.bin.items contains item_id %}
<li><a href="{{ include.bin.url }}#{{ item_id }}">{{ item.label }}</a></li>
{% endif %}
{% endfor %}

{% for service_pair in site.data.services %}
{% assign service_id = service_pair[0] %}
{% assign service = service_pair[1] %}
{% if include.bin.services contains service_id %}
<li><a href="{{ include.bin.url }}#{{ service_id }}">{{ service.label }}</a></li>
{% endif %}
{% endfor %}

{% for filter_pair in site.data.filters %}
{% assign filter_id = filter_pair[0] %}
{% assign filter = filter_pair[1] %}
{% unless include.bin.filters[filter_id] %}{% continue %}{% endunless %}
<li><a href="{{ include.bin.url }}#{{ filter_id }}">{{ filter.label }}</a></li>
{% for OS_pair in site.data.OS %}
{% assign OS_id = OS_pair[0] %}
{% assign OS = OS_pair[1] %}
{% if include.bin.OS contains OS_id %}
<li><a href="{{ include.bin.url }}#{{ OS_id }}">{{ OS.label }}</a></li>
{% endif %}
{% endfor %}
</ul>
14 changes: 13 additions & 1 deletion _includes/filters_description.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
<dl>
{% for filter_pair in site.data.filters %}
{% for filter_pair in site.data.services %}
{% assign filter = filter_pair[1] %}
<dt class="filter-name">{{ filter.label }}</dt>
<dd>{{ filter.description | markdownify }}</dd>
{% endfor %}

{% for attack_pair in site.data.attack_types %}
{% assign attack = attack_pair[1] %}
<dt class="filter-name">{{ attack.label }}</dt>
<dd>{{ attack.description | markdownify }}</dd>
{% endfor %}

{% for os_pair in site.data.OS %}
{% assign os = os_pair[1] %}
<dt class="filter-name">{{ os.label }}</dt>
<dd>{{ os.description | markdownify }}</dd>
{% endfor %}
</dl>
14 changes: 0 additions & 14 deletions _includes/get_code.html

This file was deleted.

19 changes: 7 additions & 12 deletions _layouts/bin.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,19 @@
{{ page.description | markdownify }}

Command:
{% for item_pair in site.data.items %}
{% assign item_id = item_pair[0] %}
{% assign item = item_pair[1] %}
{% assign examples = page.items[item_id] %}
{% unless examples %}{% continue %}{% endunless %}
<ul class="examples">

{% assign code_es = examples.first.code | escape | strip_newlines %}
{% if code_es != "empty" %}
<li>
<pre><code id="code_text">{{ examples.first.code | escape | strip_newlines }}<a href="javascript:void(0)" onClick="copyFunction_com()" style="float: right; margin-bottom: -5px;"><img src="/assets/copy-button.svg" alt="Copy" title="Copy" id="code_img"/></a></code></pre>
<pre><code id="code_text">{{ page.command | escape | strip_newlines }}<a href="javascript:void(0)" onClick="copyFunction_com()" style="float: right; margin-bottom: -5px;"><img src="/assets/copy-button.svg" alt="Copy" title="Copy" id="code_img"/></a></code></pre>
</li>
{% break %}
{% endif %}

</ul>
{% endfor %}

References:
<ul style="list-style-type:none;">
{% for reference in page.references %}
<li><a href="{{ reference }}">{{ reference }}</a></li>
{% endfor %}
<ul>
<script>

function copyFunction_com() {
Expand Down
Binary file added _wadcoms/.Dementor.md.swp
Binary file not shown.
27 changes: 11 additions & 16 deletions _wadcoms/Dementor.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,16 @@ description: |
Password: password123
command: |
python3 dementor.py -u john -p password123 -d test.local 10.10.10.2 10.10.10.1
items:
Password:
- code: |
python3 dementor.py -u john -p password123 -d test.local 10.10.10.2 10.10.10.1
Username:
- code: |
empty
filters:
RPC:
- code: |
empty
Linux:
- code: |
empty
Windows:
- code: |
empty
- Password
- Username
services:
- RPC
OS:
- Linux
- Windows
attack_types:
- Exploitation
---
21 changes: 8 additions & 13 deletions _wadcoms/Enum4Linux-Creds.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,13 @@ description: |
Password: password123
command: |
enum4linux -u john -p password123 -a 10.10.10.1
items:
Username:
- code: |
enum4linux -u john -p password123 -a 10.10.10.1
Password:
- code: |
empty
filters:
Enumeration:
- code: |
empty
Linux:
- code: |
empty
- Username
- Password
attack_types:
- Enumeration
OS:
- Linux
---
Loading

0 comments on commit 5da4427

Please sign in to comment.