Skip to content

Instantly share code, notes, and snippets.

View XVilka's full-sized avatar
💭
Rusting

Anton Kochkov XVilka

💭
Rusting
View GitHub Profile
@pastcompute
pastcompute / gist:8b3788b9263c515a3d97
Created June 19, 2014 11:41
Radare2 macro (work in progress) for string scanning a stripped / embedded MIPS binary for strings
# Assumes strings are referenced downwards from the top of a segment
# e.g - set
f string_end @ 0x80620000
# then addui a0,a0,-12288 <-- string is at 0x8061d000
# This used to add a comment with the text but that broke recently
# So now it adds a comment String_addressofstring
# It adds a xref mut I am still perfecting that
@petermanser
petermanser / _gitlab_config.md
Last active September 9, 2016 19:48
Gitlab 5.4 - Gmail configuration

Gitlab 5.4 - Gmail configuration

In order to send messages through a Gmail account (also applicable to Google Apps accounts) add the following parts to your config files:

Files:

  • config/environments/production.rb
  • config/gitlab.yml
@brettle
brettle / Creating a bootable usb stick containing a direct install of Ubuntu 14.04 from Fedora 23.md
Last active September 26, 2017 05:53
Creating a bootable usb stick containing a direct install of Ubuntu 14.04 from Fedora 23

Instructions

  1. Download the Ubuntu 14.04 Live Desktop (64-bit) iso.
  2. Enable virtualization in the BIOS.
  3. sudo dnf install qemu-kvm
  4. Install the UEFI bios images.
  5. As root, boot the ISO in a virtual machine:
isopath=/path/to/ubuntu-14.04.3-desktop-amd64.iso
stickdev=/dev/sdX # Make sure this is set to the device for your usb stick
qemu-kvm -drive file=$stickdev,format=raw -m 2048 -pflash /usr/share/edk2.git/ovmf-x64/OVMF-pure-efi.fd -cdrom $isopath
This diff is a modified version of a diff written by Arnis Lapsa.
[ The original can be found here: https://gist.github.com/ArnisL/6156593 ]
This diff adds support to tmux for 24-bit color CSI SRG sequences. This
allows terminal based programs that take advantage of it (e.g., vim or
emacs with https://gist.github.com/choppsv1/73d51cedd3e8ec72e1c1 patch)
to display 16 million colors while running in tmux.
The primary change I made was to support ":" as a delimeter as well
@atheriel
atheriel / macroexpand.c
Last active January 20, 2018 07:58
Can one write a Python extension in Rust?
PyObject * RustPy_InitModule(const char *name, PyMethodDef *methods, const char *doc) {
// return Py_InitModule4(name, methods, doc, (PyObject *) NULL, PYTHON_API_VERSION);
return Py_InitModule3(name, methods, doc);
}
RARVM reversible/patchme
Modified 'unrar' source to dump context and disassembly.
Wrote two separate solvers since the challenge was broken.
To build the disassembler/debugger:
- unzip unrar-src-disassembler.zip -d unrar
- cd unrar
@hugsy
hugsy / QuickTip1.md
Last active June 18, 2020 22:29
Using new syscalls to bypass ptrace-protected process and read/write arbitrary memory.

Even though well known methods exist to bypass ptrace deactivation on a process when spawning (fake ptrace() preloading, breakpoint on ptrace(), etc... ), it is trickier when process is already protected.

Thankfully Linux 3.2+ was generous enough to provide read/write capabilities to another process with 2 new system calls: sys_process_vm_readv and sys_process_vm_writev. (see https://github.com/torvalds/linux/blob/master/arch/x86/syscalls/syscall_64.tbl#L319)

Manual says:

These system calls transfer data between the address space of the calling

diff --git a/colour.c b/colour.c
index a56ddce..8098f83 100644
--- a/colour.c
+++ b/colour.c
@@ -29,305 +29,85 @@
* of the 256 colour palette.
*/
-struct colour_rgb {
- u_char i;
@ivg
ivg / bytoy.ml
Last active August 12, 2020 15:41
Lifting a toy bytecode using Core Theory
open Core_kernel
open Bap_core_theory
open Bap.Std
open KB.Syntax
include Self()
let package = "bytoy"
type name = string [@@deriving equal,sexp]
type oper = Reg of int | Imm of int [@@deriving equal,sexp]

radare2 is a very cool set of tools that you probably don't know how to use! Let's go through a simple exploit CTF challenge to understand how to use it for exploit development.

We'll be focusing on "ropasaurus rex" which is a simple challenge from Plaid CTF After checking out the latest and greatest radare from git, let's get started!

Open up ropasaurusrex in r2 and call analyze on the binary. We can list the functions with "afl"