metasploit-framework

https://github.com/rapid7/metasploit-framework

Ruby

Metasploit Framework

Msf::Post::Windows::Accounts#delete_user

delete_user(username, server_name = nil)

Summary:
  Deletes a user account from the given server (or local if none given)

Parameters
  username    - The username of the user to delete (not-qualified, e.g. BOB)
  server_name - DNS or NetBIOS name of remote server on which to delete user

Returns:
  One of the following:
     :success          - Everything went as planned
     :invalid_server   - The server name provided was invalid
     :not_on_primary   - Operation allowed only on domain controller
     :user_not_found   - User specified does not exist on the given server
     :access_denied    - You do not have permission to delete the given user

  OR nil if there was an exceptional Windows error (example: ran out of memory)

Caveats:
  nil is returned if there is an *exceptional* Windows error. That error is printed.
  Everything other than ':success' signifies failure

Source | Google | Stack overflow

Edit

git clone [email protected]:rapid7/metasploit-framework.git

cd metasploit-framework

open lib/msf/core/post/windows/accounts.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Msf--Post--Windows--Accounts-delete_user-for-pr


# Commit to git

git add lib/msf/core/post/windows/accounts.rbgit commit -m "better docs for Msf::Post::Windows::Accounts#delete_user"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Msf--Post--Windows--Accounts-delete_user-for-pr

hub pull-request


# Celebrate!