Skip to content

Instantly share code, notes, and snippets.

@LegalizeAdulthood
LegalizeAdulthood / PortingFromMFCToWxWidgets.md
Last active November 12, 2023 02:34
Porting from MFC to wxWidgets
@gmurdocca
gmurdocca / socat_caesar_dpi.md
Last active January 22, 2024 05:08
Circumventing Deep Packet Inspection with Socat and rot13

Circumventing Deep Packet Inspection with Socat and rot13

I have a Linux virtual machine inside a customer's private network. For security, this VM is reachable only via VPN + Citrix + Windows + a Windows SSH client (eg PuTTY). I am tasked to ensure this Citrix design is secure, and users can not access their Linux VM's or other resources on the internal private network in any way outside of using Citrix.

The VM can access the internet. This task should be easy. The VM's internet gateway allows it to connect anywhere on the internet to TCP ports 80, 443, and 8090 only. Connecting to an internet bastion box on one of these ports works and I can send and receive clear text data using netcat. I plan to use good old SSH, listening on tcp/8090 on the bastion, with a reverse port forward configured to expose sshd on the VM to the public, to show their Citrix gateway can be circumvented.

Rejected by Deep Packet Inspection

I hit an immediate snag. The moment I try to establish an SSH or SSL connection over o

@q3k
q3k / cursed.c
Last active April 3, 2024 09:19
Linux syscalls in .exe executed under Wine
#include <stdio.h>
#include <string.h>
const char *buf = "hello from linux\n";
char * const argv[] = {
"/bin/sh",
"-c",
"echo 'hello from execve'",
NULL,
};
@htruong
htruong / template.js
Last active July 26, 2021 05:20
Zenreader server
export default (title, content) => `
<html>
<head>
<title>${title}</title>
<link
rel="stylesheet"
href="//cdn.jsdelivr.net/combine/npm/purecss@2.0.3/build/base-min.css,npm/purecss@2.0.3/build/grids-min.css,npm/purecss@2.0.3/build/forms-min.css"
/>
<style>
img {
@FreddieOliveira
FreddieOliveira / docker.md
Last active May 9, 2024 02:42
This tutorial shows how to run docker natively on Android, without VMs and chroot.

Docker on Android 🐋📱

Edit 🎉

All packages, except for Tini have been added to termux-root. To install them, simply pkg install root-repo && pkg install docker. This will install the whole docker suite, left only Tini to be compiled manually.


Summary

@m-radzikowski
m-radzikowski / script-template.sh
Last active May 4, 2024 04:13
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@lutangar
lutangar / edupython.md
Last active January 18, 2021 15:06
Alternative à Edupython (ou amienspython) pour Linux et Mac

Alternative à edupython

Edupython (ou amienspython) est un logiciel originalement dérivé de pyscripter (cf. documentation de edupython un logiciel écrit dans le langage de programmation delphi et donc uniquement disponible pour Windows.

Pour les utilisateurs Mac ou Linux (et même pour ceux qui utilisent Windows d'ailleurs !), je vous recommande d'utiliser le logiciel thonny qui est plus moderne, plus simple et donc mieux adapté à des débutants.

Mis au point par l'Université de Tartu en Estonie, Thonny est un IDE (environnement de développement) minimaliste qui permet d'apprendre le Python. https://korben.info/thonny-un-ide-python-pour-les-debutants.html

De plus thonny est entièrement traduit en français.

@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active May 8, 2024 21:42
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@georgexsh
georgexsh / goto.py
Created September 18, 2017 07:47
python goto with system trace function
import sys
def j(lineno):
frame = sys._getframe().f_back
called_from = frame
def hook(frame, event, arg):
if event == 'line' and frame == called_from:
try:
frame.f_lineno = lineno
@Arinerron
Arinerron / root.sh
Last active March 7, 2024 09:24
"Root" via dirtyc0w privilege escalation exploit (automation script) / Android (32 bit)
#!/bin/bash
# Give the usual warning.
clear;
echo "[INFO] Automated Android root script started.\n\n[WARN] Exploit requires sdk module \"NDK\".\nFor more information, visit the installation guide @ https://goo.gl/E2nmLF\n[INFO] Press Ctrl+C to stop the script if you need to install the NDK module. Waiting 10 seconds...";
sleep 10;
clear;
# Download and extract exploit files.
echo "[INFO] Downloading exploit files from GitHub...";