Skip to content

Instantly share code, notes, and snippets.

@rhotav
rhotav / decoder.py
Created January 12, 2024 10:16
Coper Malware Family String Decryption
class StringDecryptor:
def __init__(self, key):
self.key_bytes = bytearray()
self.key_bytes.extend(map(ord, key))
self.reset()
def initialize_sbox(self, key_bytes):
sbox = [i for i in range(256)]
key_length = len(key_bytes)
j = 0
@rhotav
rhotav / dllinjdetect_rekall.py
Last active September 18, 2022 21:44
Rekall automatization
"""
Classic DLL Injection technique detector rekall plugin
by Utku Corbaci ~ Malwation
Twitter: @rhotav
GitHub : @polynomen
"""
suspiciousPids = []
@rhotav
rhotav / blumblumshub.py
Created August 26, 2022 21:33
blumblumshub python implementation
p = 283
q = 79
s = 13
N = p * s
x = []
x.append((s ** 2) % N)
for i in range(1, 25):
x.append((x[i - 1] ** 2) % N)
@rhotav
rhotav / primetest.py
Created August 24, 2022 14:49
Miller-Rabin Primality Test Python Implementation
# Python Version : 3.10.6 64-bit
def main():
number = int(input("Insert an odd number: "))
#step 1 - select a number in this range (n > 2)
if(number <= 2 and
number % 2 == 0):
print("Please insert an odd number in this range (n > 2) ")
return
#step 2 -- n - 1 = 2^k \times m
@rhotav
rhotav / HookManager.cs
Last active January 16, 2021 14:49
Windows API Hooking with C# (MessageBoxA)
using System;
using System.Runtime.InteropServices;
namespace Hook_Example
{
class HookManager
{
[DllImport("kernel32.dll", SetLastError = true)]
static extern bool VirtualProtect(IntPtr lpAddress, uint dwSize,
uint flNewProtect, out uint lpflOldProtect);