首页 > 其他分享 >Invoke-PSImage 使用简介

Invoke-PSImage 使用简介

时间:2022-09-28 22:00:54浏览次数:75  
标签:web Invoke script 简介 image will PSImage

github:peewpw/Invoke-PSImage

简介:

Encodes a PowerShell script in the pixels of a PNG file and generates a oneliner to execute

Invoke-PSImage takes a PowerShell script and encodes the bytes of the script into the pixels of a PNG image. It generates a oneliner for executing either from a file of from the web.

It can either create a new image using only the payload data, or it can embed the payload in the least significant bytes of an existing image so that it looks like an actual picture. The image is saved as a PNG, and can be losslessly compressed without affecting the ability to execute the payload as the data is stored in the colors themselves. When creating new images, normal PowerShell scripts are actually significantly compressed, usually producing a png with a filesize ~50% of the original script.

With the embed method, the least significant 4 bits of 2 color values in each pixel are used to hold the payload. Image quality will suffer as a result, but it still looks decent. It can accept most image types as input, but output will always be a PNG because it needs to be lossless. Each pixel of the image is used to hold one byte of script, so you will need an image with at least as many pixels as bytes in your script. This is fairly easy—for example, Invoke-Mimikatz fits into a 1920x1200 image.

参数说明:

-Script [filepath] The path to the script to embed in the Image.

-Out [filepath] The file to save the resulting image to (image will be a PNG)

-Image [filepath] The image to embed the script in. (optional)

-WebRequest Output a command for reading the image from the web using Net.WebClient. You will need to host the image and insert the URL into the command.

-PictureBox Output a command for reading the image from the web using System.Windows.Forms.PictureBox. You will need to host the image and insert the URL into the command.

示例:

Create an image with the script "Invoke-Mimikatz.ps1" embeded in it and output a oneliner to execute from disk:

PS>Import-Module .\Invoke-PSImage.ps1
PS>Invoke-PSImage -Script .\Invoke-Mimikatz.ps1 -Out .\evil-kiwi.png -Image .\kiwi.jpg
[Oneliner to execute from a file]

Create an image with the script "Invoke-Mimikatz.ps1" embeded in it and output a oneliner to execute from the web (you still have to host the image and edit the URL):

PS>Import-Module .\Invoke-PSImage.ps1
PS>Invoke-PSImage -Script .\Invoke-Mimikatz.ps1 -Out .\evil-kiwi.png -Image .\kiwi.jpg -WebRequest
[Oneliner to execute from the web]

 



标签:web,Invoke,script,简介,image,will,PSImage
From: https://blog.51cto.com/u_472169/5721063

相关文章

  • mysql sleep()函数简介
    语法:sleep(N)通过在MySQL中执行selectsleep(N)可以让此语句运行N秒钟: ......
  • 分布式自增ID算法Snowflake简介
    背景过去的项目开发中,我们常常选用的数据库是mysql,mysql以其体积小、速度快等优势,备受中小型项目的青睐。随着项目数据量的迅速增长,mysql已无法满足我们的项目需求,数据迁移......
  • boost库简介(转)
    C++库.首先,应该先知道boost是一个什么东西,其实这个东西就是一个c++的准标准类库。那么c++的标准库都有那些,我知道的,也是最近用的最多的,也就是c++的STL(标准模板方法)中的lis......
  • CefSharp简介
    引言在WPF开发中,经常会有混合开发的需求,即在WPF中加载网页,目前最常用也是最流行的方式是CefSharp,它的功能非常强大,可以提供较为完善的开发和使用体验,但是CefSharp也有一定......
  • HTML——简介-入门
    W3C标准:网页主要由三部分组成结构:HTML表现:CSS行为:JavaScript HTML快速入门  1、新建文本文件,后缀改为.html  2、编写HTML结构标签(不区分大小写)     ......
  • 3.TCP-IP & Linux 模型简介
    Dearall,  更新一节Linux网络驱动视频——3.TCP-IP&Linux模型简介,下节课开始正式编写driver。  B站链接:https://www.bilibili.com/video/BV1DG4y1s7ad/?vd_......
  • P2(从2开始的) MAVEN的简介
    注:笔记内容摘抄自视频,侵权删!3项目构建工具摘要:新型公司使用grandle4Maven四大特性4.1依赖管理系统听不太懂,大概就是下载jar包只需要配置,不需要手动下载4.2多模......
  • Ansible简介
    Ansible是一种常用的自动运维化工具,基于python开发,分布式,无需客户端,轻量级,配置语言采用YAML。Ansible 的特性:1.模块化:调用特定的模块,完成特殊的任务。2.Paramiko(......
  • nextTick简介
    在说nextTick之前,我们先介绍一下这节课案例的需求,我们还是有一个数组,里面有几个超级英雄,把他们渲染到了一个ul里,我们现在要获取这个ul的高度<template><div><ul......
  • 知识点2-1 B+树(5)myISAM简介
    myISAM简介MyISAM的B+Tree的叶子节点上的data,并不是数据本身,而是数据存放的地址。主索引和辅助索引没啥区别,只是主索引中的key一定得是唯一的。这里的索引都是非聚簇索引......