惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

Black Hills Information Security, Inc.

Same Problem, Different Angles: When Red Team and Blue Team Actually Talk to Each Other How to Identify and Exploit New Vulnerabilities Swapper – A Pure Regex Match/Replace Burp Extension A Practical Guide to BloodHound Data Collection Network Engineering Basics Signed, Trusted, and Abused: Proxy Execution via WebView2 Getting Started In Pentesting – Advice From The BHIS Pentest Lead Cloud Security: Tips and Resources for Securing the Cloud Lessons From A Chatbot Incident How to Lead Effective Tabletops Understanding GRC: How to Navigate Risks and Compliance Standards The “P” in PAM is for Persistence: Linux Persistence Technique Malware Analysis: How to Analyze and Understand Malware OSINT: How to Find, Use, and Control Open-Source Intelligence What to Do with Your First Home Lab When the SOC Goes to Deadwood: A Night to Remember Social Engineering and Microsoft SSPR: The Road to Pwnage is Paved with Good Intentions Common Cyber Threats Finding the Right Penetration Testing Company Deceptive-Auditing: An Active Directory Honeypots Tool The Curious Case of the Comburglar How to Set Smart Goals (That Actually Work For You) Inside the BHIS SOC: A Conversation with Hayden Covington Abusing Delegation with Impacket (Part 3): Resource-Based Constrained Delegation Why You Got Hacked – 2025 Super Edition Abusing Delegation with Impacket (Part 2): Constrained Delegation Abusing Delegation with Impacket (Part 1): Unconstrained Delegation GoSpoof – Turning Attacks into Intel Model Context Protocol (MCP) Bypassing WAFs Using Oversized Requests Getting Started with AI Hacking Part 2: Prompt Injection Wrangling Windows Event Logs with Hayabusa & SOF-ELK (Part 2) DomCat: A Domain Categorization Tool Wrangling Windows Event Logs with Hayabusa & SOF-ELK (Part 1) Microsoft Store and WinGet: Security Risks for Corporate Environments Default Web Content MailFail Commonly Abused Administrative Utilities: A Hidden Risk to Enterprise Security Stop Spoofing Yourself! Disabling M365 Direct Send Bypassing CSP with JSONP: Introducing JSONPeek and CSP B Gone Offensive Tooling Cheatsheets: An Infosec Survival Guide Resource DNS Triage Cheatsheet GraphRunner Cheatsheet Burp Suite Cheatsheet Impacket Cheatsheet Wireshark Cheatsheet Hashcat Cheatsheet EyeWitness Cheatsheet Nmap Cheatsheet Netcat (nc) Cheatsheet Hunt for Weak Spots in Your Wireless Network with Airodump-ng from the Aircrack-ng Suite Detecting ADCS Privilege Escalation Vulnerability Scanning with Nmap Getting Started with NetExec: Streamlining Network Discovery and Access How to Use Dirsearch Augmenting Penetration Testing Methodology with Artificial Intelligence – Part 3: Arcanum Cyber Security Bot How to Design and Execute Effective Social Engineering Attacks by Phone Abusing S4U2Self for Active Directory Pivoting Why Use a Macro Pad? Espanso: Text Replacement, the Easy Way Caging Copilot: Lessons Learned in LLM Security Augmenting Penetration Testing Methodology with Artificial Intelligence – Part 2: Copilot Augmenting Penetration Testing Methodology with Artificial Intelligence – Part 1: Burpference Intercepting Traffic for Mobile Applications that Bypass the System Proxy How to Root Android Phones Communicating Security to the C-Suite: A Strategic Approach Offline Memory Forensics With Volatility Getting Started with AI Hacking: Part 1 Go-Spoof: A Tool for Cyber Deception How to Test Adversary-in-the-Middle Without Hacking Tools Canary in the Code: Alert()-ing on XSS Exploits How to Hack Wi-Fi with No Wi-Fi Why Your Org Needs a Penetration Test Program Burp Suite Extension: Copy For Light at the End of the Dark Web Wi-Fi Forge: Practice Wi-Fi Security Without Hardware Avoiding Dirty RAGs: Retrieval-Augmented Generation with Ollama and LangChain Gone Phishing: Installing GoPhish and Creating a Campaign 5 Things We Are Going to Continue to Ignore in 2025 John Strand’s 5 Phase Plan For Starting in Computer Security Questions From a Beginner Threat Hunter GRC for Security Managers: From Checklists to Influence AI Large Language Models and Supervised Fine Tuning Attack Tactics 9: Shadow Creds for PrivEsc w/ Kent & Jordan One Active Directory Account Can Be Your Best Early Warning Introduction to Zeek Log Analysis Indecent Exposure: Your Secrets are Showing Creating Burp Extensions: A Beginner’s Guide Pitting AI Against AI: Using PyRIT to Assess Large Language Models (LLMs) The Top Ten List of Why You Got Hacked This Year (2023/2024) ICS Hard Knocks: Mitigations to Scenarios Found in ICS/OT Backdoors & Breaches Intro to Data Analytics Using SQL Finding Access Control Vulnerabilities with Autorize The Detection Engineering Process Cyber Risk Lessons We Can Learn From Hurricane Preparedness Intro to Desktop Application Testing Methodology What Is Penetration Testing? Adversary in the Middle (AitM): Post-Exploitation Pentesting, Threat Hunting, and SOC: An Overview QEMU, MSYS2, and Emacs: Open-Source Solutions to Run Virtual Machines on Windows
Power Posing with PowerOPS
2017-01-25 · via Black Hills Information Security, Inc.

Brian Fehrman //

ADVISORY: The techniques and tools referenced within this blog post may be outdated and do not apply to current situations. However, there is still potential for this blog entry to be used as an opportunity to learn and to possibly update or integrate into modern tools and techniques.

As described in my last blog post, Powershell Without Powershell – How To Bypass Application Whitelisting, Environment Restrictions & AV (sheeesh…it’s been a bit!), we are seeing more environments in which the execution of PowerShell Scripts are being detected or prevented. One way around those restrictions is to use a C# wrapper program to load the PowerShell scripts and execute them directly in the context of the .NET Framework. It is typically the case, however, that the wrapper has to be modified each time you run a new script. At the very least, you will likely need to modify some sort of config file that is read by the wrapper. This process can be a bit tedious and increases the chances of making a mistake. It would be nice to have all of the scripts consolidated into a single, compact framework. Introducing: PowerOPS Framework (https://github.com/fdiskyou/PowerOPS).

The PowerOPS Framework is the work of numerous people (none of whom is me) and their names are listed at the bottom of the GitHub page. Effectively, the framework is a collection of PowerShell scripts that are commonly used during the post-exploitation phase. Some of the scripts include: PowerView, Invoke-Mimikatz, Invoke-PSExec, and many others. Each script is embedded within the C# code itself so that you don’t need to tote around and load in the scripts. All you have to do is compile the code, run the executable, and enjoy the awesome PowerShell-style interface that enables you to run the script functions with simple commands. You can also run normal PowerShell commands from the interface. This is all done without actually calling the powershell.exe binary.

So how do you get going with it? Well, let’s walk through that process now. The one caveat is that you will need to have .NET Framework 4.0 or greater installed on the target system. For this example, I just installed Microsoft Management Framework 4 (https://www.microsoft.com/en-us/download/details.aspx?id=40855). Next, grab down the PowerOPS project from the GitHub link in the first part of this blog post. Extract the zip file after the download completes.

Downloaded and Extracted PowerOPS Project

Next, open up a command prompt and compile the project by using the following command (making sure to change the directory to match the location of your download):

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe /unsafe 
/reference:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Management.Automation
\v4.0_3.0.0.0__31bf3856ad364e35\System.Management.Automation.dll" 
/reference:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.IO.Compression.dll" 
/out:C:\users\fmc\Desktop\PowerOPS_x64.exe /platform:x64 
"C:\Users\fmc\Downloads\PowerOPS-master\PowerOPS-master\PowerOPS\*.cs"
Compilation Completed

If everything went well, you should now have an executable named PowerOPS_x64.exe on your desktop (or wherever you decided to put it).

PowerOPS Binary

Note that the command given was to compile for an x64 architecture. If you need to target x86 instead, use the following command (again, making sure to change the directory names to match your system):

C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe /unsafe
/reference:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Management.Automation\v4.0_3.0.0.0__31bf
856ad364e35\System.Management.Automation.dll"
/reference:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.IO.Compression.dll"
/out:C:\users\fmc\Desktop\PowerOPS_x86.exe /platform:x86 "C:\Users\fmc\Downloads\PowerOPS
master\PowerOPS-master\PowerOPS\*.cs"

To run the PowerOPS binary, just double-click on it. You should be greeted with a command interface.

PowerOPS Interface

You can see a list of the modules that are currently available by typing show into the interface.

PowerOPS Modules

The commands that are present in each module are already imported for you. To see which commands are available in a module, you can type:

get-command -module <module_name>

For instance, to see the commands for the PowerUp module you would type:

get-command -module PowerUp
Snipper of Commands in PowerView Module

Let’s go ahead and run the Invoke-AllChecks command by simply typing:

Invoke-AllChecks
Snipper of Commands in PowerView Module

What about if a command needs arguments and you can’t remember what they are? No worries! As previously mentioned, you can still use normal PowerShell commands in this framework. Let’s say that we want to run Invoke-ShareFinder but can’t quite remember how. We can get examples for it by typing the following:

Get-Help Invoke-ShareFinder -examples
Getting Invoke-ShareFinder Examples

I bet by now some of you have noticed the Invoke-Mimikatz function and are wondering, “does it work?” Well, yes but it might have a weird glitch. Close down PowerOPS and re-run it as an Administrator.

Attempt to run Mimikatz by typing:

Invoke-Mimikatz

You might get the output pictured below.

Invoke-Mimikatz Unsuccessful

I am not quite sure what the issue is here, but by virtue of complete dumb-luck I found that it seems to work if I first run Invoke-Mimikittenz before running Invoke-Mimikatz. I tried running a few other modules first and it didn’t seem to fix the issue. I plan on looking at this more later…but for now it is fun to run kittenz before katz.

Invoke-Mimikittenz

Invoke-Mimikatz
Running Invoke-Mimikittenz Followed by Invoke-Mimikatz

So, what does AV have to say about this? We recently had our annual Sacred Cash Cow Tipping AV-Bypass webcast (WEBCAST: Sacred Cash Cow Tipping 2016). Sadly, a few AV vendors were feeling left out and they quickly contacted us to let us know…and let us know they did. Don’t worry folks, it’s nothing personal. We just don’t have enough time to include everybody. Lucky for some of you, I will do double-duty and make the time to include you here!

The first AV engine that I tested this against was ESET. ESET, admittedly, has a pretty snazzy interface with lots of cool bells and whistles. I turned on all of them (short of firewalling everything), updated the database, and attempted to run PowerOPS. No alert was given on the initial execution. Next, I ran the Invoke-Mimikatz function and…success! I also did a manual scan on the executable and nothing was reported.

ESET Scan of PowerOPS File
Invoke-Mimikatz not Detected by ESET

Kaspersky though…what about Kaspersky? I installed Kaspersky and also enabled all of the features, with the exception of whitelisting and locking down everything on the firewall. Honestly, if you’re implementing a whitelisting-based approach in your environment then hats off to you! That is a test for another blog post. Here, we are just looking at the detection capabilities. I scanned the executable with Kaspersky and it stated that everything was good. I ran PowerOPS and issued the Invoke-Mimikatz command. The result? Success! At least…so I thought….

The Invoke-Mimikatz call did succeed. After running it again so that I could grab a screenshot for this blog post, however, Kaspersky told me that it had detected the activity and was going to remove the file.

C:\Users\brian\AppData\Local\Microsoft\Windows\INetCacheContent.Word\2017-01-19 16_44_18-Win7x64_Kaspersky - VMware Workstation.png
Kaspersky Detecting Invoke-Mimikatz in PowerOPS

So, what gives? Did it write a new signature? Did its behavioral analysis engine learn something from the program executing? No, nothing quite that cool. It turns out that Kaspersky was taking a while to fully load. It’s unclear if this is due to my VM (4GB, 2 cores, on an PCIe-SSD…) or if it is just the nature of the program. It doesn’t appear that Kaspersky’s detections are effective during this loading window. I just happened to run my test during that time frame and it resulted in the Invoke-Mimikatz function not being detected.

Kaspersky Loading

Dang, what to do now… On recent engagements, I have been skipping the use of Mimikatz on target systems since it does seem to get detected more frequently now. I have typically been using the PowerShell Procdump script (http://poshcode.org/4751)  to dump the lsass process of the target machine. I take that dump file offline and then run Mimikatz against it.  But for this test, I went ahead and grabbed that script and made some slight modifications. After the script executed the code to perform the process dump, I added a sleep time of 10 seconds. The sleep time is to help ensure that the dump routine has completed. After the sleep, I added the following code:

Invoke-Mimikatz -Command “`“sekurlsa::minidump $dmp`” `”sekurlsa::logonPasswords`”

The previous command tells Mimikatz to run against the dump file that was created rather than attempting to scrape the memory directly. Here’s what the snippet of code now looks like in the PowerShell Procdump script:

Modified Powershell Procdump Script

Now, we need to add this into the PowerOPS Framework. The authors made this process quite simple. The first step is to convert the Procdump script to a Base64-encoded form. I just copied and pasted the script into an online converter.

Base64 Encoding Procdump Script

Next, copy the Base64 code and open the PowerOPS.cs file in the PowerOPS directory. Notice the functions that are already present and mimic their structure in order to add the new script. This just involves creating a new function, naming it what you want (ProcDump, in this case), decoding the Base64 version of your script, and returning that decoded string. The snapshot below shows what this looks like. Your Base64 code just goes in between the set of double-quotes.

Added ProcDump Function that Returns Decoded Form of Base64-Encoded Procdump Script

The next step is to open the Program.cs file in the PowerOPS folder. Find the portion in the code that has the series of pipeline.Commands.AddScript calls. Add in a call to the function that you created. You can see the addition in the following screenshot.

C:\Users\brian\AppData\Local\Microsoft\Windows\INetCacheContent.Word\2017-01-19 15_38_03-Win7x64_Kaspersky - VMware Workstation.png
Adding Call to Add the Procdump Script

The final step is needed to get our new functionality to display when we type the show command in the PowerOPS prompt. Go towards the top of the script and find the DisplayModules function. I went ahead and added the Get-ProcessDump string to the last Console. Write call. You can see this in the screenshot below.

C:\Users\brian\AppData\Local\Microsoft\Windows\INetCacheContent.Word\2017-01-19 15_44_20-Win7x64_Kaspersky - VMware Workstation.png

Finally, it’s time to recompile the program. Issue the compilation command that we used earlier. Run the PowerOPS executable as an Administrator. Type the show command to see that the function has been added.

Get-ProcessDump Displayed

Kick off the process dump and Mimikatz invocation against the lsass process by typing the following:

Get-ProcessDump (ps lsass)

And…success! For real this time though!

Successful Dump of Lsass and Password Extraction

In conclusion, I’ve given an overview of the awesome PowerOPS framework and how to get started with it. Having many of the common PowerShell scripts in a single utility is very convenient. Plus, you are given the ability to run these scripts without the direct usage of powershell.exe. It appears to bypass some AV vendors as-is. For others, we had to take a bit of a side-adventure in order to work around their detection methods. This framework also has built-in application-whitelisting bypass techniques that I did not detail here but will do so in future blog posts. PowerOPS is a tool that could very handy for pentesters and I highly encourage you to check it out! ______ Follow Brian on Twitter @fullmetalcache



Ready to learn more?

Level up your skills with affordable classes from Antisyphon!

Pay-Forward-What-You-Can Training

Available live/virtual and on-demand