Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
AddUser-SAMR — Create local administrators in Windows using the SAMR API. In C#, Crystal, Python, Rust, Golang, Nim and Deno (Javascript) | Kitploit
Tools/GitHubGitHub/ricardojoserf/adduser-samr
Privilege EscalationPayload GenerationPersistence MechanismsLateral MovementPost-ExploitationIdentity & Access Management (IAM)AuthenticationRed Teaming
GitHubricardojoserf/adduser-samr

AddUser-SAMR

Create local administrators in Windows using the SAMR API. In C#, Crystal, Python, Rust, Golang, Nim and Deno (Javascript)

957822 months agoReviewed by Kitploit
Share
View RepositoryWebsite

AddUser-SAMR

Create local administrators using the SAMR API, operating at a lower level than net.exe, PowerShell's New-LocalUser or NetUserAdd API.

It requires Administrator privileges and if the user exists, it gets added to the group but the password is not updated.

There are 4 implementations in this repo (C#, Python, Rust and Crystal), but there are public versions in other languages such as C++ by @M0nster3 or BOF file by @AgeloVito.

This code serves as complement to this blog post about different techniques to create local accounts.



Usage

The arguments are:

  • -u, --username - Username to create (required)

  • -p, --password - Password for the user (required)

  • -g, --group - Group name (default: "Administrators")

  • -v, --verbose - Enable verbose

  • -h, --help - Show help message

# Basic usage
adduser.exe -u <username> -p <password>

# Specify group
adduser.exe -u <username> -p <password> -g <group>

# Verbose output
adduser.exe -u testuser -p MyPass123 -g Administrators -v

img1



SAMR functions

The tool uses the following SAMR protocol calls:

  • SamConnect - Connect to the SAM server
  • SamEnumerateDomainsInSamServer - Enumerate domains
  • SamLookupDomainInSamServer - Get domain SIDs
  • SamOpenDomain - Open domain handles
  • SamCreateUser2InDomain - Create the user account
  • SamSetInformationUser - Set user password
  • SamLookupNamesInDomain - Find admin group
  • SamOpenAlias - Open group handle
  • SamRidToSid - Convert RID to SID
  • SamAddMemberToAlias - Add user to group


Compilation (for Windows)

C#

Compile using Visual Studio or msbuild.

Crystal

cd Crystal
crystal build adduser.cr --release
.\adduser.exe -u testuser -p MyPass123 -v

Python

You can use the Python script:

cd Python
python adduser.py -u testuser -p MyPass123 -v

Or create a stand-alone binary with:

cd Python
pyinstaller -F adduser.py
.\dist\adduser.exe -u testuser -p MyPass123 -v

Rust

cd Rust && mkdir target
cargo build --release
.\target\release\adduser.exe -u testuser -p MyPass123 -v

Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    795
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    520
  • 3

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    439
  • 4

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    346
  • 5

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    267
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    264

Explore all tools

Browse our collection of tools

View all tools →