Skip to content

Instantly share code, notes, and snippets.

View sudhackar's full-sized avatar
🎯
Focusing

Sudhakar Verma sudhackar

🎯
Focusing
View GitHub Profile
@sudhackar
sudhackar / 70-udev.rules
Created January 23, 2024 14:33
DeepCool CH510 Digital - usb write with hid
SUBSYSTEM=="input", GROUP="input", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="34d3", ATTRS{idProduct}=="1100", MODE="666", GROUP="plugdev"
KERNEL=="hidraw*", ATTRS{idVendor}=="34d3", ATTRS{idProduct}=="1100", MODE="0666", GROUP="plugdev"
section .data
flag:
db 'y', 0xa, 'y', 0xa, "flag{wh0_n33ds_opc0des_wh3n_you_h4ve_CONTROL?}", 0
times 1000 db 0
c: dd 0
r1: dd 0
r2: dd 0
r3: dd 0
r4: dd 0
r5: dd 0
@sudhackar
sudhackar / flag.py
Created November 16, 2021 10:20
csaw maze euler knight walk solution
from functools import reduce
# copied closed knight walk from https://mathworld.wolfram.com/images/eps-gif/KnightsTours_700.gif
x = [[50, 45, 62, 41, 60, 39, 54, 35],
[63, 42, 51, 48, 53, 36, 57, 38],
[46, 49, 44, 61, 40, 59, 34, 55],
[43, 64, 47, 52, 33, 56, 37, 58],
[26, 5, 24, 1, 20, 15, 32, 11],
[23, 2, 27, 8, 29, 12, 17, 14],
[6, 25, 4, 21, 16, 19, 10, 31],
[3, 22, 7, 28, 9, 30, 13, 18]][::-1]
#include "pin.H"
#include <iostream>
#include <map>
typedef long long LL;
typedef pair<int, int> pii;
#define forup(i, a, b) for (int i = (a); i < (b); ++i)
#define fordn(i, a, b) for (int i = (a); i > (b); --i)
#define rep(i, a) for (int i = 0; i < (a); ++i)
@sudhackar
sudhackar / solve.asm
Created November 28, 2018 18:26
pwnadventure sourcery lab2 csaw ctf 2018 finals
section .text
global _start
_start:
mov eax, 3
mov ebx, 0
mov ecx, input
mov edx, 5
int 80h
@sudhackar
sudhackar / list.dot
Created October 1, 2018 11:45
active process list
digraph foo {
rankdir=LR;
graph [bgcolor=white fontname="Courier" splines=true nodesep=0.0 pad=0.2 ranksep=0.5 center=true];
node [shape=record];
subgraph cluster_sa_ {
label = "PsActive\lProcessHead";
a_flink[label="\l\lflink"];
a_blink[label="\l\lblink"];
};
subgraph cluster_b {
strict digraph "" {
graph [ordering="out"];
null[label=""];
C -> G;
C -> H;
G -> M;
G -> N;
F -> S;
F -> U;
H -> null;
@sudhackar
sudhackar / script.py
Last active November 10, 2019 09:39
Painful IDA coloring
import idc
import idaapi
import sark
base = idc.get_name_ea(0xbadec0de,"SepMandatoryIntegrityCheck")
arr_10 = [0x52, 0x63, 0x6f, 0x78, 0x85, 0x98, 0xa2, 0xad, 0xd2, 0xe2, 0xf3, 0x103, 0x10c, 0x119, 0x148, 0x167, 0x16e, 0x18d, 0x19b, 0x1a8, 0x1b6, 0x1c8, 0x1dc, 0x1e3, 0x1ed, 0x1f6, 0x20d, 0x21c, 0x3e2, 0x22e, 0x251, 0x31c, 0x26f, 0x340, 0x356, 0x35e, 0x36a, 0x38e, 0x39b, 0x295, 0x2cb, 0x2db]
executed_nodes_10 = [sark.CodeBlock(base+i).start_ea for i in arr_10]
arr_8 = [0x52, 0x63, 0x6f, 0x78, 0x85, 0x98, 0xa2, 0xad, 0xd2, 0xe2, 0xf3, 0x103, 0x10c, 0x119, 0x148, 0x167, 0x16e, 0x314, 0x22e, 0x251, 0x26f, 0x295, 0x2cb, 0x2db]
executed_nodes_8 = [sark.CodeBlock(base+i).start_ea for i in arr_8]
@sudhackar
sudhackar / bt.c
Last active September 27, 2020 07:34
x86 bt instruction
/*
* bt.c
*
* gcc -Wall -m32 -masm=intel -o "untitled" "untitled.c" (in directory: /tmp)
*
* Copyright 2018 Sudhakar Verma <sudhakar@payatu>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@sudhackar
sudhackar / no-cache-webserver.py
Created June 4, 2018 10:25
no-cache-webserver
#!/usr/bin/python
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from SocketServer import ThreadingMixIn
import SimpleHTTPServer
import sys
import threading
class MyHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def end_headers(self):