Ricardo J. Ruiz Fernández

Pentester | OffSec instructor | OSCE3 OSCP GX-PT

Blog Categories About

Calling C# code from Powershell

November 14, 2023 Malware Development

One of the reasons why I like programming some PoCs using C# is the possibility to later run the code in Powershell. In this post we will see some basic examples and how to prepare your C# code to run it using Powershell.

Continue reading →

Alternatives to whoami

November 9, 2023 Malware Development

Some experiments to retrieve the current username without calling whoami.exe or similar binaries, all of them using C# (and P/Invoke).

Continue reading →

StealthyEnv - Get environment variables from PEB structure

November 2, 2023 Malware Development

Alternative to whoami.exe or other well-known binaries to get the environment variables. It is written in C# and I guess it is stealthier because it gets the values parsing the PEB structure.

Continue reading →

Guard Pages Hooking

September 8, 2023 Malware Development

C# PoC of Guard Pages hooking. It is a type of API hooking which can be achieved from userland and does not require patching functions.

Continue reading →

SharpEA - Playing with Extended Attributes (EAs) using C#

August 29, 2023 Malware Development

C# program to read, write and delete Extended Attributes (EAs) to “hide” malicious payloads within NTFS filesystems.

Continue reading →

SharpADS - Playing with Alternate Data Streams (ADS) using C#

August 22, 2023 Malware Development

C# program to write, read, delete or list Alternate Data Streams (ADS) within NTFS.

Continue reading →

Github Star Counter

August 4, 2023 Tools

Python script to count exact total number of stars for any Github user

Continue reading →

C# implementation of GetModuleHandle

July 9, 2023 Malware Development

GetModuleHandle implementation in C# using only the NtQueryInformationProcess API call.

Continue reading →


« Prev 1 2 3 4 5 6 7 8 9 10 11 12 Next »

© 2026 Ricardo J. Ruiz Fernández