Skip to content

Instantly share code, notes, and snippets.

View patryk4815's full-sized avatar

patryk4815

View GitHub Profile
gdb> ARGS: ['cc', '-fPIC', '-fstack-clash-protection', '-O2', '-U_FORTIFY_SOURCE', '-Wformat', '-Wformat-security', '-Werror=format-security', '-fstack-protector-strong', '--param', 'ssp-buffer-size=4', '-fno-strict-overflow', '-fno-omit-frame-pointer', '-mno-omit-leaf-frame-pointer', '-Wl,-dynamic-linker=/nix/store/cnw00vg7w28qsn4jc6vxbwlignc35w4n-glibc-2.40-66/lib/ld-linux-aarch64.so.1', '-g', '-O2', '--print-file-name', 'cyglto_plugin-0.dll', '-U_FORTIFY_SOURCE', '-D_FORTIFY_SOURCE=3', '-B/nix/store/cnw00vg7w28qsn4jc6vxbwlignc35w4n-glibc-2.40-66/lib/', '-idirafter', '/nix/store/kpwwc8ml9cvzv24glz7h2vc5xmdrab96-glibc-2.40-66-dev/include', '-fmacro-prefix-map=/nix/store/kpwwc8ml9cvzv24glz7h2vc5xmdrab96-glibc-2.40-66-dev/include=/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-glibc-2.40-66-dev/include', '-B/nix/store/2qamyiaf2x3d93ai5afbv24ahz524w79-zig-cc-0.15.2/lib', '-target', 'aarch64-linux-gnu.2.28', '-Wno-format-nonliteral', '-Wl,--build-id=sha1', '-ggdb', '-Wa,--compress-debug-sections', '-frandom-seed=ymz
#include <stdio.h>
#include <stdlib.h>
#include <mach/mach.h>
#include <mach/mach_vm.h>
void print_protection(vm_prot_t prot) {
printf("%c%c%c",
(prot & VM_PROT_READ) ? 'r' : '-',
(prot & VM_PROT_WRITE) ? 'w' : '-',
(prot & VM_PROT_EXECUTE) ? 'x' : '-');
/* Compilation: zig cc --target=x86_64-linux-gnu.2.23 -nostdlib -shared -o libc.so.6 shellcode.S */
.section .data
filename:
.string "/flag.txt"
.section .bss
.lcomm buffer, 100
.section .text
import pwndbg.dbg
import pwndbg.aglib.memory
import pwndbg.aglib.kernel.vmmap
from pwndbg.commands.rop import split_range_to_chunks
import time
import gdb
import os
def _delayed_interrupt(timeout_seconds):
time.sleep(timeout_seconds)
This file has been truncated, but you can view the full file.
pwndbg> attachp 2315
Attaching to 2315
[New LWP 2459]
[New LWP 2458]
[New LWP 2457]
[New LWP 2456]
[New LWP 2454]
[New LWP 2445]
[New LWP 2433]
const std = @import("std");
const microzig = @import("microzig");
const rp2xxx = microzig.hal;
const gpio = rp2xxx.gpio;
const time = rp2xxx.time;
const Pio = rp2xxx.pio.Pio;
const StateMachine = rp2xxx.pio.StateMachine;
const c = @cImport({
@cInclude("ngx_config.h");
@cInclude("ngx_core.h");
@cInclude("ngx_string.h");
@cInclude("ngx_http.h");
@cInclude("ngx_event_openssl.h");
});
const ngx_foo_conf_t = extern struct {
enable: c.ngx_flag_t,
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_string.h>
#include <ngx_http.h>
#include <ngx_event_openssl.h>
extern ngx_module_t ngx_foo_module;
typedef struct {
ngx_flag_t enable;
import machine
import os
from micropython import const
import time
import network
import socket
_CMD_TIMEOUT = const(100)
_R1_IDLE_STATE = const(1 << 0)
@patryk4815
patryk4815 / nixos-enter
Created August 3, 2023 20:39
nixos-enter
#!/bin/bash
# shellcheck shell=bash
set -e
# Re-exec ourselves in a private mount namespace so that our bind
# mounts get cleaned up automatically.
if [ -z "$NIXOS_ENTER_REEXEC" ]; then
export NIXOS_ENTER_REEXEC=1
if [ "$(id -u)" != 0 ]; then