Harness: PowerShell
Weaponization Made
Easy (or at least easier)
Rich Kelley
@RGKelley5
Who is this guy?
• Computer science background
• Prior US Air Force Communications Officer
• Network engineer, software developer, penetration tester
• Co-founder Gray Tier Technologies, LLC
• Currently focused on application pen testing
• Mostly I enjoy writing obscure utilities
 pyHashcat
 Keyboard Walk generators
Why should I care?
• “…Microsoft’s Post-Exploitation Language” – Chris
Campbell (@obsuresec)
• Defenders should be more aware of the damage attackers
can do with PowerShell alone
• We need more research into incident response related to
malicious PowerShell use
 DEF CON 22 - Ryan Kazanciyan and Matt Hastings, Investigating
PowerShell Attacks
PowerShell weaponization problem?
‘How do you get your [PowerShell] scripts running
on your target machines, and effectively get your
results back?’ – Will Schroeder (@harmj0y)
Bottom line
• PowerShell weaponization can be used to be somewhat
cumbersome
• Hopefully I’ve made that a little easier with the Harness
tool set
Hasn’t this problem been solved?
• Yep, but I’m a developer. Why use someone else’s solution
when I can write my own (I’m kidding…sort of)
• Previous solutions were not as seamless as I wanted
 Step 1: Gain access
 Step 2: ?????
 Step 3: PowerShell!
 Step 4: Pwn all things!
• A couple of very cool new solutions have recently been
released
RDP – Paste, Download, or Import
Remote shell – PowerShell encoded
command
Metasploit – exec_powershell
Metasploit – Interactive PS Payloads
Cobalt Strike – Beacon
Other Options
• PowerShell Remoting
 Must be enabled to use
• WMI
• Empire -www.powershellempire.com
My Development Requirements
1. Fully interactive remote PowerShell console
with the same capabilities as the native
PowerShell.exe
2. Ability to seamlessly import modules across the
wire
Demo Time!
Under the hood
• Payload Requirements
 .NET 4.0+
 System.Management.Automation Assembly
• Tested on:
 Windows 7
 Window 8
 Windows 8.1
 Windows Server 2008 R2
 Windows Server 2012
Under the hood
• Listener/Framework Requirements
 Python 3.4
 Asyncio (although could easily be ported to alternative)
 Linux
 Tested on Kali
• Why Python? Why not Ruby? Why not Metasploit?
 Mostly for the learning experience
 I prefer Python to Ruby (calm down)
 Should be simple enough to port to Metasploit module
 ReflectiveHarness can be used with DllInject module
Defense
• Restrict Access to
System.Management.Automation
• Enable monitoring
 New features added to PowerShell 5.0
Thank you!
• Matt Benton (@ruddawg26)
• James Icenogle (@sploitmonkey)
• Matt Graeber (@mattifestation)
• Will Schroeder (@harmj0y)
• Justin Warner (@sixdub)
• Contact:
 Twitter: @RGKelley5
 Email: rk5devmail@gmail.com
 Blog: www.frogstarworldc.com
 Github: https://github.com/Rich5/Harness
Questions?
Bonus
Payload
Socket  ps.BeginInvoke
while script not valid:
accumulate
end
PS C:>
script/cmd
Send results
ls
PS C:> ls
Directory C:
Mode: LastWriteTime
----- ---------------------
d---- 2/2/1015
Handler
PS C:> ls
Bonus
Payload Handler
Socket  ps.BeginInvoke
Inbound script  True
PS C:>
<rs>
PS C:> ^import-module script.ps1
Send results
Socket  byte stream
PS C:> ^import-module script.ps1
Directory C:
Mode: LastWriteTime
----- ---------------------
d---- 2/2/1015
while !rcvd close signal:
accumulate
end </rs>

More Related Content

PPTX
Building an Empire with PowerShell
PPTX
Pwnstaller
PPTX
Catch Me If You Can: PowerShell Red vs Blue
PPTX
Obfuscating The Empire
PPTX
More fun using Kautilya
PDF
Power on, Powershell
PPTX
Powerpreter: Post Exploitation like a Boss
PDF
Continuous intrusion: Why CI tools are an attacker’s best friends
Building an Empire with PowerShell
Pwnstaller
Catch Me If You Can: PowerShell Red vs Blue
Obfuscating The Empire
More fun using Kautilya
Power on, Powershell
Powerpreter: Post Exploitation like a Boss
Continuous intrusion: Why CI tools are an attacker’s best friends

What's hot (20)

PPTX
Owning windows 8 with human interface devices
PPTX
Kautilya: Teensy beyond shell
PPTX
Teensy Programming for Everyone
PPTX
PowerShell for Cyber Warriors - Bsides Knoxville 2016
PPTX
PowerShell for Penetration Testers
PDF
SANS DFIR Prague: PowerShell & WMI
PPTX
Hacking the future with USB HID
PDF
A Year in the Empire
PPTX
BH Arsenal '14 TurboTalk: The Veil-framework
PPTX
The Travelling Pentester: Diaries of the Shortest Path to Compromise
PPTX
Invoke-Obfuscation nullcon 2017
PDF
DEF CON 23 - Rich Kelley - harness powershell weaponization made easy
PPTX
The Veil-Framework
PPTX
Defcon - Veil-Pillage
PPTX
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
PDF
AntiVirus Evasion Reconstructed - Veil 3.0
PDF
Powershell training material
PDF
Veil-PowerView - NovaHackers
PDF
Entomology 101
PPTX
Bsides tampa
Owning windows 8 with human interface devices
Kautilya: Teensy beyond shell
Teensy Programming for Everyone
PowerShell for Cyber Warriors - Bsides Knoxville 2016
PowerShell for Penetration Testers
SANS DFIR Prague: PowerShell & WMI
Hacking the future with USB HID
A Year in the Empire
BH Arsenal '14 TurboTalk: The Veil-framework
The Travelling Pentester: Diaries of the Shortest Path to Compromise
Invoke-Obfuscation nullcon 2017
DEF CON 23 - Rich Kelley - harness powershell weaponization made easy
The Veil-Framework
Defcon - Veil-Pillage
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
AntiVirus Evasion Reconstructed - Veil 3.0
Powershell training material
Veil-PowerView - NovaHackers
Entomology 101
Bsides tampa
Ad

Viewers also liked (6)

PDF
The Seven Most Dangerous New Attack Techniques, and What's Coming Next
PDF
Beyond the Pentest: How C2, Internal Pivoting, and Data Exfiltration Show Tru...
PDF
Understanding the Event Log
PPTX
Lateral Movement with PowerShell
PDF
Hacker’ların Yeni Gozdesi - PowerShell
PPTX
PowerShell - PowerForensics
The Seven Most Dangerous New Attack Techniques, and What's Coming Next
Beyond the Pentest: How C2, Internal Pivoting, and Data Exfiltration Show Tru...
Understanding the Event Log
Lateral Movement with PowerShell
Hacker’ların Yeni Gozdesi - PowerShell
PowerShell - PowerForensics
Ad

Similar to Harness: PowerShell Weaponization Made Easy (or at least easier) (20)

PPTX
Pwning the Enterprise With PowerShell
PDF
The Dark Side of PowerShell by George Dobrea
PPTX
Drilling deeper with Veil's PowerTools
PDF
PowerShell Defcon for Cybersecurity Topics
PDF
Who Should Use Powershell? You Should Use Powershell!
PPTX
Incorporating PowerShell into your Arsenal with PS>Attack
PDF
Ranger BSides-FINAL
PPTX
Powering up on PowerShell - BSides Greenville 2019
PPTX
Lateral Movement - Phreaknik 2016
PDF
From P0W3R to SH3LL
PPTX
PowerShell: The increased use of PowerShell in cyber attacks
PPTX
Introducing PS>Attack: An offensive PowerShell toolkit
PDF
Powering up on PowerShell - BSides Charleston - Nov 2018
PDF
2010 za con_jameel_haffejee
PPTX
Pwning with powershell
PPTX
Automating Post Exploitation with PowerShell
PPTX
Client side attacks using PowerShell
PDF
The State of the Veil Framework
PPTX
Bridging the Gap: Lessons in Adversarial Tradecraft
PPTX
Powering up on power shell avengercon - 2018
Pwning the Enterprise With PowerShell
The Dark Side of PowerShell by George Dobrea
Drilling deeper with Veil's PowerTools
PowerShell Defcon for Cybersecurity Topics
Who Should Use Powershell? You Should Use Powershell!
Incorporating PowerShell into your Arsenal with PS>Attack
Ranger BSides-FINAL
Powering up on PowerShell - BSides Greenville 2019
Lateral Movement - Phreaknik 2016
From P0W3R to SH3LL
PowerShell: The increased use of PowerShell in cyber attacks
Introducing PS>Attack: An offensive PowerShell toolkit
Powering up on PowerShell - BSides Charleston - Nov 2018
2010 za con_jameel_haffejee
Pwning with powershell
Automating Post Exploitation with PowerShell
Client side attacks using PowerShell
The State of the Veil Framework
Bridging the Gap: Lessons in Adversarial Tradecraft
Powering up on power shell avengercon - 2018

Recently uploaded (20)

PPT
What is a Computer? Input Devices /output devices
PDF
August Patch Tuesday
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Five Habits of High-Impact Board Members
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PPT
Geologic Time for studying geology for geologist
PDF
A review of recent deep learning applications in wood surface defect identifi...
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
PPTX
Web Crawler for Trend Tracking Gen Z Insights.pptx
PPTX
Modernising the Digital Integration Hub
PPTX
Tartificialntelligence_presentation.pptx
PDF
Developing a website for English-speaking practice to English as a foreign la...
PDF
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
PDF
A novel scalable deep ensemble learning framework for big data classification...
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PPT
Module 1.ppt Iot fundamentals and Architecture
PDF
CloudStack 4.21: First Look Webinar slides
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
What is a Computer? Input Devices /output devices
August Patch Tuesday
Assigned Numbers - 2025 - Bluetooth® Document
Five Habits of High-Impact Board Members
O2C Customer Invoices to Receipt V15A.pptx
Geologic Time for studying geology for geologist
A review of recent deep learning applications in wood surface defect identifi...
1 - Historical Antecedents, Social Consideration.pdf
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
Web Crawler for Trend Tracking Gen Z Insights.pptx
Modernising the Digital Integration Hub
Tartificialntelligence_presentation.pptx
Developing a website for English-speaking practice to English as a foreign la...
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
A novel scalable deep ensemble learning framework for big data classification...
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
Module 1.ppt Iot fundamentals and Architecture
CloudStack 4.21: First Look Webinar slides
NewMind AI Weekly Chronicles – August ’25 Week III
Univ-Connecticut-ChatGPT-Presentaion.pdf

Harness: PowerShell Weaponization Made Easy (or at least easier)

  • 1. Harness: PowerShell Weaponization Made Easy (or at least easier) Rich Kelley @RGKelley5
  • 2. Who is this guy? • Computer science background • Prior US Air Force Communications Officer • Network engineer, software developer, penetration tester • Co-founder Gray Tier Technologies, LLC • Currently focused on application pen testing • Mostly I enjoy writing obscure utilities  pyHashcat  Keyboard Walk generators
  • 3. Why should I care? • “…Microsoft’s Post-Exploitation Language” – Chris Campbell (@obsuresec) • Defenders should be more aware of the damage attackers can do with PowerShell alone • We need more research into incident response related to malicious PowerShell use  DEF CON 22 - Ryan Kazanciyan and Matt Hastings, Investigating PowerShell Attacks
  • 4. PowerShell weaponization problem? ‘How do you get your [PowerShell] scripts running on your target machines, and effectively get your results back?’ – Will Schroeder (@harmj0y) Bottom line • PowerShell weaponization can be used to be somewhat cumbersome • Hopefully I’ve made that a little easier with the Harness tool set
  • 5. Hasn’t this problem been solved? • Yep, but I’m a developer. Why use someone else’s solution when I can write my own (I’m kidding…sort of) • Previous solutions were not as seamless as I wanted  Step 1: Gain access  Step 2: ?????  Step 3: PowerShell!  Step 4: Pwn all things! • A couple of very cool new solutions have recently been released
  • 6. RDP – Paste, Download, or Import
  • 7. Remote shell – PowerShell encoded command
  • 11. Other Options • PowerShell Remoting  Must be enabled to use • WMI • Empire -www.powershellempire.com
  • 12. My Development Requirements 1. Fully interactive remote PowerShell console with the same capabilities as the native PowerShell.exe 2. Ability to seamlessly import modules across the wire
  • 14. Under the hood • Payload Requirements  .NET 4.0+  System.Management.Automation Assembly • Tested on:  Windows 7  Window 8  Windows 8.1  Windows Server 2008 R2  Windows Server 2012
  • 15. Under the hood • Listener/Framework Requirements  Python 3.4  Asyncio (although could easily be ported to alternative)  Linux  Tested on Kali • Why Python? Why not Ruby? Why not Metasploit?  Mostly for the learning experience  I prefer Python to Ruby (calm down)  Should be simple enough to port to Metasploit module  ReflectiveHarness can be used with DllInject module
  • 16. Defense • Restrict Access to System.Management.Automation • Enable monitoring  New features added to PowerShell 5.0
  • 17. Thank you! • Matt Benton (@ruddawg26) • James Icenogle (@sploitmonkey) • Matt Graeber (@mattifestation) • Will Schroeder (@harmj0y) • Justin Warner (@sixdub) • Contact:  Twitter: @RGKelley5  Email: rk5devmail@gmail.com  Blog: www.frogstarworldc.com  Github: https://github.com/Rich5/Harness
  • 19. Bonus Payload Socket  ps.BeginInvoke while script not valid: accumulate end PS C:> script/cmd Send results ls PS C:> ls Directory C: Mode: LastWriteTime ----- --------------------- d---- 2/2/1015 Handler PS C:> ls
  • 20. Bonus Payload Handler Socket  ps.BeginInvoke Inbound script  True PS C:> <rs> PS C:> ^import-module script.ps1 Send results Socket  byte stream PS C:> ^import-module script.ps1 Directory C: Mode: LastWriteTime ----- --------------------- d---- 2/2/1015 while !rcvd close signal: accumulate end </rs>

Editor's Notes

  • #4: Source: http://www.irongeek.com/i.php?page=videos/showmecon2014/2-02-powershell-and-you-using-microsofts-post-exploitation-language-chris-campbell
  • #5: Ref: www.harmj0y.net/blog/powershell/derbycon-powershell-weapon