Skip to content

Commit

Permalink
Added copy button to command pages
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnWoodman committed Nov 30, 2020
1 parent 92584d0 commit e0832d9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
4 changes: 4 additions & 0 deletions _includes/bin_table.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ <h3>What you have:</h3>
var copyCommand = document.getElementById(file_url);

navigator.clipboard.writeText(copyCommand.innerText).then(() => {
{% for file in site.wadcoms %}
document.getElementById("{{ file.url }}_img").alt = "Copy";
document.getElementById("{{ file.url }}_img").title = "Copy";
{% endfor %}
document.getElementById(file_url + "_img").alt = "Copied";
document.getElementById(file_url + "_img").title = "Copied";
}, () => {
Expand Down
16 changes: 15 additions & 1 deletion _layouts/bin.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,24 @@
{% assign code_es = examples.first.code | escape | strip_newlines %}
{% if code_es != "empty" %}
<li>
<pre><code>{{ examples.first.code | escape }}</code></pre>
<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>
</li>
{% break %}
{% endif %}

</ul>
{% endfor %}

<script>

function copyFunction_com() {
var copyCommand = document.getElementById("code_text");

navigator.clipboard.writeText(copyCommand.innerText).then(() => {
document.getElementById("code_img").alt = "Copied";
document.getElementById("code_img").title = "Copied";
}, () => {
console.log("copy failed");
});
}
</script>
2 changes: 1 addition & 1 deletion index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: WADComs

![logo](/assets/logo.png){:.logo}

WADComs is an interactive cheat sheet, containing a curated list of Unix/Windows offensive tools and their respective commands.
WADComs is an interactive cheat sheet, containing a curated list of offensive security tools and their respective commands, to be used against Windows/AD environments.

If you hate constantly looking up the right command to use against a Windows or Active Directory enfironment (like me), this project should help ease the pain a bit. Just select what information you currently have related to the Windows machine (passwords, usernames, services, etc.), and it will display a list of tools you can try against the machine, along with a template command for easy copy/pasting. See the full list of [items](/items/) and [filters](/filters/).

Expand Down

0 comments on commit e0832d9

Please sign in to comment.