Powershell-enc parameter cannot decode Base64 encoded payload solution

Source: Internet
Author: User
Tags base64

PowerShell's-enc parameter allows a base64-encoded PowerShell script string to be passed as a parameter to execute the PowerShell script, which is often used to bypass the active defense mechanism of antivirus software.

This afternoon in a backdoor program, through the online base64 encoding website encoded string unexpectedly can not be-enc parameters of PowerShell resolution, parsing is all garbled, through find data finally solved the problem

This issue is recorded for subsequent use

Method reference from: http://www.pstips.net/question/5827.html

The required PowerShell script can be encoded using the following script, and the resulting string can be parsed by the-enc parameter of PowerShell

$fileContent = "script to encode"$bytes = [System.text.encoding]::unicode.getbytes ($ Filecontent)$encodedCommand = [Convert]::tobase64string ($bytes$ Encodedcommand

The encoded script can parse the execution with the following command

$encodedCommand

Powershell-enc parameter cannot decode Base64 encoded payload solution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.