Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learn PowerShell Core 6.0

You're reading from  Learn PowerShell Core 6.0

Product type Book
Published in Jul 2018
Publisher Packt
ISBN-13 9781788838986
Pages 552 pages
Edition 1st Edition
Languages
Authors (2):
David das Neves David das Neves
Profile icon David das Neves
Jan-Hendrik Peters Jan-Hendrik Peters
Profile icon Jan-Hendrik Peters
View More author details
Toc

Table of Contents (26) Chapters close

Title Page
Dedication
Packt Upsell
Contributors
Preface
1. Current PowerShell Versions 2. PowerShell ISE Versus VSCode 3. Basic Coding Techniques 4. Advanced Coding Techniques 5. Writing Reusable Code 6. Working with Data 7. Understanding PowerShell Security 8. Just Enough Administration 9. DevOps with PowerShell 10. Creating Your Own PowerShell Repository 11. VSCode and PowerShell Release Pipelines 12. PowerShell Desired State Configuration 13. Working with Windows 14. Working with Azure 15. Connecting to Microsoft Online Services 16. Working with SCCM and SQL Server 17. PowerShell Deep Dives 1. PowerShell ISE Hotkeys 2. Assessments 3. Other Books You May Enjoy Index

Obfuscation


Obfuscation is a technique to create unreadable code to hide against logging and detection mechanisms, but still keep its functionality. Still, the problem with all antivirus scanners today is that they are mainly working with definition files. In scripting, it is easy to bypass these kinds of detections by using obfuscation techniques and executing code in a different manner.

Note

A great project to create your own obfuscated scripts is Invoke-Obfuscation, written by Daniel Bohannon: https://github.com/danielbohannon/Invoke-Obfuscation

Take a look at the following line of code:

#Obfuscated script
.("{3}{1}{2}{0}" -f 'Host','ri','te-','W') ("{2}{1}{0}{8}{5}{9}{6}{4}{7}{3}" -f 'hell','owerS','P','uage','tic ','a fan','s','lang',' is ','ta')

As you can see, it is very hard to identify the real purpose of this code. It starts with the dot sourcer, which we want to remove first, so we can split the obfuscated script into parts:

#removing dot sourcing mechanism
#first part of the script...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}