Jump to content
Nytro

Scripting Metasploit for a Real-Life Pentest

Recommended Posts

Posted

Scripting Metasploit for a Real-Life Pentest

March 25, 2015

Ionu? Ambrosie

metasploit.png?w=150&h=194

During a recent internal penetration test, we got to the point where we had to search a lot of Windows machines for Domain Admin tokens. Of course, our objective was to impersonate such a (delegation) token with Metasploit and create our own Domain Admin user.Since the search space was quite large, we had to automate this task by creating a custom Metasploit script. In this post we detail the creation of this script and its results.

A bit of context

During our penetration test we’ve managed to obtain the credentials of a privileged user. This user, let’s call him Robert, had local administrative rights on multiple workstations in the Windows domain.Furthermore, we’ve managed to create a low privileged domain user, which we’ll further denote by OurUser, but we were not able to add it to the Domain Admins group.However, we came up with the idea of using Robert’s credentials to log in to as many hosts as possible and hope we can impersonate a more privileged user. By leveraging its privileges, we hoped we would be able to add OurUser to the Domain Admins group.We’ve used the SMB Login Check Scanner in Metasploit for determining the range of hosts in the local domain which allowed us access with Robert’s credentials. Armed with this list, we were faced with the Sisyphean task of connecting to each host and, using a combination of psexec_psh and reverse_tcp, open a meterpreter shell and then issue the appropriate commands.

Articol complet: Scripting Metasploit for a Real-Life Pentest – Security Café

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...