This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import socket | |
| import os | |
| def child(sock): | |
| print 'child running! echo server starting' | |
| while True: | |
| ret = sock.recv(64) | |
| if ret == '': | |
| print 'child server exiting!' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # coding=utf-8 | |
| from nclib import * | |
| import socket | |
| import sys | |
| import struct | |
| class XXX(object): | |
| REALOFFSET = 221040 | |
| INFOFFSET = 0x30cad |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git config credential.helper store |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mkdir /mnt/tmpram | |
| mount -t tmpfs -o size=512m tmpfs /mnt/tmpram/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <string.h> | |
| #include <sys/stat.h> | |
| int main(int argc, const char *argv[]) | |
| { | |
| unsigned long long a= 0xaaaaaaaaaaaaaaaa; | |
| struct stat s = { | |
| .st_dev = 0xffffffffffffffff, | |
| .__pad1 = 0x41, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for arm, dbg | |
| CC=arm-linux-gnueabi-gcc ../glibc-2.23/configure --prefix=/usr/arm-linux-gnueabi/ arm-linux-gnueabi --enable-debug | |
| CC=arm-linux-gnueabi-gcc ../glibc-2.23/configure --prefix=/usr/arm-linux-gnueabi/ arm-linux-gnueabi | |
| ../glibc-2.23/configure --prefix=/lib/x86_64-linux-gnu | |
| make -j `nproc` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| qemu-arm -d mmu // show maps | |
| -g 1234 // debug gdb | |
| target remote :1234 // in gdb | |
| file myfile // get symbols |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <string.h> | |
| #include <err.h> | |
| #include <sys/mman.h> | |
| int main(int argc, const char *argv[]) | |
| { | |
| char a[] = "libc.so.6"; | |
| char b[] = "ld-linux-x86-64.so.2"; | |
| /* char *ldbase = (char*)0x0007ffff7dd7000; */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if you want to pipe some data somewhere, but suppress the EOF at the end so you can still interactively type stuff in stdin, use cat | |
| cat file - | thing_that_reads_Stdin | |
| (echo "stuff" && cat) | thing_ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| How to chroot | |
| sudo debootstrap xenial chroot1604 | |
| sudo chroot chroot1604 | |
| echo "deb http://archive.ubuntu.com/ubuntu xenial main universe restricted multiverse" > /etc/apt/sources.list |