Skip to content

Instantly share code, notes, and snippets.

View Mon-ius's full-sized avatar
🎯
Focusing

Monius Mon-ius

🎯
Focusing
View GitHub Profile
@0xquad
0xquad / chroot-esc.c
Last active December 19, 2022 02:10
chroot jail escape methods
/*
* Simple chroot jail escape
* Copyright (c) 2015, Alexandre Hamelin <alexandre.hamelin gmail.com>
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
@gjiazhe
gjiazhe / 正则
Created September 14, 2016 05:32
/******************** 正则相关常量 ********************/
/**
* 正则:手机号(简单)
*/
public static final String REGEX_MOBILE_SIMPLE = "^[1]\\d{10}$";
/**
* 正则:手机号(精确)
* <p>移动:134(0-8)、135、136、137、138、139、147、150、151、152、157、158、159、178、182、183、184、187、188</p>
* <p>联通:130、131、132、145、155、156、175、176、185、186</p>
* <p>电信:133、153、173、177、180、181、189</p>
@c3c
c3c / redis-lua-linux-x86-poc.py
Created February 24, 2017 09:29
Redis Lua 5.1 sandbox escape 32-bit Linux exploit
## Redis Lua 5.1 sandbox escape 32-bit Linux exploit
## Original exploit by corsix and sghctoma
## Author: @c3c
## It's possible to abuse the Lua 5.1 sandbox to obtain RCE by loading modified bytecode
## This concept is fully explained on corsix' gist at https://gist.github.com/corsix/6575486
## This version uses pieces of the 32-bit Windows exploit made by corsix and the 64-bit Linux exploit made by sghctoma; as expected, a few offsets were different
## sghctoma's exploit uses the arbitrary memory read to leak pointers to libc and find the address of "system" http://paper.seebug.org/papers/Security%20Conf/Defcon/2015/DEFCON-23-Tamas-Szakaly-Shall-We-Play-A-Game.pdf
## This code is much the same, except the process is done using pwntools' DynELF
## Furthermore, attempting to leak addresses in libc appears to cause segfaults on my 32-bit Linux, in which case, you will need to obtain the remote libc version
@jornane
jornane / GROW.md
Created October 23, 2017 12:12
How to grow a partition in Linux

How to grow a partition in Linux

This guide will walk you through the steps required to grow a partition in Linux. You will have to reboot through this guide.

  1. If possible, make a snapshot.

Often, you will want to grow the partition table because you made your virtual hard disk too small, and you tried to extend it in your hypervisor, only to find out that your partition is still the same size as it was before.

@mbbx6spp
mbbx6spp / config
Created November 22, 2017 16:19
Blocked SSH port, GitHub workaround
# Put in your ~/.ssh/config
### Problem
#
# You are on a public WiFi network that blocks SSH ports but you don't want to switch
# to pushing your Github changes to GH remotes via HTTPS nor do you want to change the
# remote hostname in all your repos.
Host github.com
Hostname ssh.github.com
@mbinna
mbinna / effective_modern_cmake.md
Last active July 20, 2024 22:17
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@jancurn
jancurn / proxy-chain-example.js
Last active February 29, 2024 07:26
Example showing how to use the proxy-chain NPM package to let headless Chrome use a proxy server with username and password
const puppeteer = require('puppeteer');
const proxyChain = require('proxy-chain');
(async() => {
const oldProxyUrl = 'http://bob:password123@proxy.example.com:8000';
const newProxyUrl = await proxyChain.anonymizeProxy(oldProxyUrl);
// Prints something like "http://127.0.0.1:45678"
console.log(newProxyUrl);
@profOnno
profOnno / Alpine_linux_on_tilaa.md
Last active February 25, 2024 13:35
Alpine linux on Tilaa

Introduction

Tilaa is my vps provider but doesn't have alpine in the install options After playing around with the vps systems... coreos ubuntu.. i did make mistakes... coreos got invaded ... opened a webgui... forgot to protect it... needed to get some data from it. So used the Tilaa rescue boot (in the Dashboard) and mounted the disks. Also used it when i increased the disk size for an installation (if I remember correctly), deleting the partition, creating a new one with the same starting address), do a resize2fs to expand and voila.. Bob was my uncle.

After playing arround with Alpine Linux in coreos and ubuntu lxd. I thought it would be a nice distro to get running straight from the vps. A weekend without sunlight but with pixellight I got it running, needs another iteration to make it a smooth experiance :o.

DISCLAIMER Any action you take upon the information on this page is strictly at your own risk, I won't be liable for any losses and damages in connection with the use of this page.

St

Exploiting Lua 5.1 on x86_64

The following Lua program generates a Lua bytecode program called lua-sandbox-rce.luac, which in turn spawns a shell from within Lua 5.1 sandbox. The remainder of this document attempts to explain how this program works by a whirlwind tour of relevent bits of the Lua 5.1 virtual machine.

function outer()
  local magic -- In bytecode, the stack slot corresponding to this local is changed
  local function middle()
    local co, upval
    local ub1 = {[0] = -- Convert uint8_t to char[1]
@gdamjan
gdamjan / README.md
Last active February 7, 2024 21:11
run a minimal alpine based initramfs in VM machine

in 5 easy steps

1

get cloud-hypervisor or firecracker

2

compile a kernel (use the provided x_kernel_config file), you'll need the stripped ELF file in arch/x86/boot/compressed/vmlinux.bin or the compressed bzImage for cloud-hypervisor.