Coder Social home page Coder Social logo

b64xfunc's Introduction

b64xFunc - Base64 Encode PS1 Scripts by Function

b64xFunc encodes a ps1 script function by function and generates a series of powershell commands to rebuild the original ps1 functionality in memory.

Powershell has a command length limit of 8,191 characters. This limits the size of ps1 scripts that can be executed using the powershell -enc parameter. By encoding large ps1 files function by function, b64xFunc can bypass this command length restriction.

Usage:
   b64xFunc.py -file FILE	  Load ps1 from file
   b64xFunc.py -url URL           Load ps1 from url
   b64xFunc.py -cmd "CMD"	  Encode a single command

Full Example:
   (kali)   b64xFunc.py -file powerview.ps1 > test.ps1
   (kali)   b64xFunc.py -file Invoke-Kerberoast.ps1 >> test.ps1
   (target) Import-Module ./test.ps1
   (target) Invoke-Kerberoast | fl

Sample Output

python b64xFunc.py -url https://raw.githubusercontent.com/PowerShellEmpire/PowerTools/master/PowerView/powerview.ps1

iex ([System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String("ZnVuY3Rpb24gTmV...pbGRlcgp9Cg==")))
iex ([System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String("ZnVuY3Rpb24gZnV...ydGllcwp9Cg==")))
iex ([System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String("ZnVuY3Rpb24gQWR...zCiAgICB9Cn0K")))
iex ([System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String("ZnVuY3Rpb24gcHN...lVHlwZSgpCn0K")))
[... output truncated ...]

b64xfunc's People

Contributors

4lph4b avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.