Active Directory Attack - SMB Relay

Active Directory Attack - SMB Relay

The next common attack I am covering is SMB Relay. Using once again TCM Security's YouTube video as a guide, the setup is rather straightforward.

However, it should be noted that during the setup of the Domain, it is not mentioned to turn on Network sharing. This is an important step to allow this attack to work.


What is SMB Relay?

SMB Relay (using the tools Responder and ntlmrelayx) allows an attacker to pass-the-hash of a user that has local administrator rights on multiple computers to log in as that user on the endpoint we are attacking.

The scenario is this:

  1. You have run an Nmap scan, identifying endpoints that either have SMB Signing completely disabled, or Enabled, but not required.

sudo nmap --script=smb2-security-mode.nse -p445 192.168.62.0/24        
Identifying two endpoints that have SMB Signing enabled, but not required
Note: Domain Controllers have SMB Signing ENABLED by default.
Showing the Domain Controller, with the default setting of SMB Signing Enabled

2. You modify the Responder.conf file to turn off the HTTP and SMB settings. This allows you to pass everything you find to ntlmrelayx, instead of the way we did it before with LLMNR poisoning.

Turning off HTTP and SMB in the Responder.conf file

3. Next, we start up Responder as we have done before and verify that the settings we turned off, are indeed, turned off.

sudo python3 Responder.py -I eth0 -dw -v        
Verifying the SMB and HTTP settings are turned off. The Auth proxy setting is off by default

4. We can now create a targets.txt file for ntlmrelayx to use. It essentially tells the tool where to pass-the-hash.

Since we are targeting the .132 endpoint, it is the only target in the list. Ideally we will have all of the targets that we find in the list to send the hashes to

5. Now we can use ntlmrelayx to "pass-the-hash" of the local admin user we capture. After we start the tool, we will wait for a user to access a share (like LLMNR poisoning, and for example purposes we are connecting directly to our Kali machine IP).

ntlmrelayx.py -tf targets.txt -smb2support        
Local Admin user accessing the share (our Kali IP in this case)
Attack is successful! We have captured hashes to crack or pass along again

Taking the attack a step further..

Well, that was fun. What's next?

Get a shell, of course. There is a simple flag to add that will add an interactive shell to allow browsing and modification of the contents on the endpoint we compromised using the local admin credentials.

Here's how it works:

  1. Add the -i flag to the ntlmrelayx command, once Responder has been started.

ntlmrelayx.py -tf targets.txt -smb2support -i        
Adding the -i flag gives you an interactive shell

2. Using the netcat tool, we listen on localhost and the port number specified in the above output.

nc 127.0.0.1 11000        
After obtaining the shell, running the help command to see a list of commands

3. Now we can navigate through the directories and files of the endpoint we have compromised with admin rights.

use ADMIN$
ls        
Accessing the ADMIN$ share

Overall, this was quite a bit of fun. I ran into some issues with trying to go too fast (excited!) and accidentally logged into the computers with the wrong accounts to make the attack work. Once I figured out that was the case, it was a simple matter to log into the machine that is "passing the hash" as my local admin user. The other endpoint was logged into as a local user without any admin rights.


Next up are defense strategies for LLMNR and SMB Relay for System Admins to use in an effort to prevent these attacks.


Paul Martin Jr

Network Field Technician | Penetration Tester | Security Researcher | Helping secure SMBs & individuals against cyber threats | eJPT | ISC2 CC

1 个月

James S. This is a great demonstration on the simplicity of this attack. No wonder its commonly exploited when present.

要查看或添加评论,请登录

James S.的更多文章

  • OAuth 2.0 - Authentication Bypass via OAuth implicit flow

    OAuth 2.0 - Authentication Bypass via OAuth implicit flow

    Since we've gone over the basics of what OAuth is, and its common grant types, let's discuss the first vulnerability…

  • What is OAuth, and what are grant types?

    What is OAuth, and what are grant types?

    Today I'm shifting my focus from Active Directory to web applications, by diving into Open Authorization (OAuth2.0).

    2 条评论
  • Web Security Academy Blind SQLi with conditional responses.

    Web Security Academy Blind SQLi with conditional responses.

    Hello everyone! It has been awhile since my last article, and while doing a lab on Portswigger's Web Security Academy…

    1 条评论
  • File Integrity Monitoring: Powershell Edition Pt. II

    File Integrity Monitoring: Powershell Edition Pt. II

    Hello everyone, welcome to Part II! (If you've not read Part I yet, you may do so here.) I'd like to start off by…

  • File Integrity Monitoring: Powershell Edition Pt. 1

    File Integrity Monitoring: Powershell Edition Pt. 1

    Hello everyone! I'd like to start off by giving credit where credit is due: Josh Madakor created the original script…

  • Web Application Front-End Vulnerabilities

    Web Application Front-End Vulnerabilities

    Continuing with my education on Web Application Security, I'd like to showcase four main vulnerabilities examined by…

    2 条评论
  • Active Directory Home Lab

    Active Directory Home Lab

    Hello everyone, I'd like to share some of the setup of my Active Directory home lab. This all started with a casual…

  • Information Security, Access Control, and the Parkerian Hexad..oh my!

    Information Security, Access Control, and the Parkerian Hexad..oh my!

    Happy Sunday everyone! Today I will be focusing on what I have learned in the first part of my new "Fundamentals of…

  • My Hands-On SQL Home Lab

    My Hands-On SQL Home Lab

    Hello, and welcome to another installment of my journey to becoming a Cybersecurity Professional. The past week and a…

    4 条评论
  • ARP Spoofing Lab

    ARP Spoofing Lab

    Hello all! Yesterday was spent in the truck headed home, and thus only podcasts. I learned quite a bit about the latest…

    3 条评论

社区洞察

其他会员也浏览了