XOR在一个bat文件的字符串? [英] Xor a string in a bat file?

查看:161
本文介绍了XOR在一个bat文件的字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

总之我想给我的朋友一个bat文件,它执行以下(未经测试)

In short I want to give my friend a bat file which does the below (untested)

echo Your mother is so fat
pause
echo the recursive function computing her mass causes a stack overflow

我可以复制/粘贴他bat文件,所以我不希望妙语要毁了你。如何隐藏文本?我想我可以在字符串存储在一个变量,之前我赞同它,我应该用XOR 32.每个字母,但我不知道如何采取一个字符串,XOR每个字母比回声它显示的笑话。我怎么可能会隐藏文本?我还可以带BASE64 code /解code,但IDK怎么做,要么,如果我只使用一个bat文件

I might copy/paste him the bat file so I don't want the punch line to be ruined. How can I hide the text? I was thinking I can store the string in a variable and before I echo it I should XOR each letter with 32. But I have no idea how to take a string, XOR each letter than echo it to display the joke. How might I hide the text? I could also BASE64 encode/decode it but IDK how to do that either if I am only using a bat file

推荐答案

1)这是一个使用 MSHTA 作为一个命令行工具(与隐藏文本的一种方式ASCII codeS在这种情况下):

1) Here's one way to hide the text using mshta as a command line tool (with ascii codes in this case) :

@echo off
mshta vbscript:execute("CreateObject(""Scripting.FileSystemObject"").GetStandardStream(1).Write(Chr(89) & Chr(111)& Chr(117) & Chr(114) & Chr(32) & Chr(109) & Chr(97) & Chr(109) & Chr(97) & Chr(32) ):Close")|more

2)你可以使用 CERTUTIL 为en code /解code的base64 /十六进制文件,但它需要能够默默地删除临时文件( 更多信息):

2) You can use CERTUTIL to encode/decode base64/hex files but it requires a temporary file that can be silently deleted (more info ):

echo 796f7572206d616d6120697320736f20666174>"%temp%\fat.hex"
certutil -decodehex "%temp%\fat.hex" "%temp%\fat.txt" >nul 2>&1
type "%temp%\fat.txt" 
del /q /f "%temp%\fat.txt" 

3) Dbenh​​am的

@echo off
setlocal

::Define a Linefeed variable
set LF=^


::above 2 blank lines are critical - do not remove.


::Create a string variable with encoded TABs
call :hexprint "0x790x6f0x750x720x200x6d0x610x6d0x610x200x690x730x200x730x6f0x200x660x610x74" var
echo  %var%

exit /b

:hexPrint  string  [rtnVar]
  for /f eol^=^%LF%%LF%^ delims^= %%A in (
    'forfiles /p "%~dp0." /m "%~nx0" /c "cmd /c echo(%~1"'
  ) do if "%~2" neq "" (set %~2=%%A) else echo(%%A
exit /b

这是使用4)卡洛斯genCar功能 找到MakeCab

@echo off
setlocal


break>fat.txt 
 for %%# in (121 111 117 114 32 109 97 109 97 32 105 115 32 115 111 32 102 97 116) do (
    call :genChar %%#
    type %%#.chr>>fat.txt
    del /q /f %%#.chr >nul 2>&1
 )

type fat.txt 
del /q /f fat.txt 

goto :eof

  :genChar
  setlocal
  set "USAGE=echo:Usage: Supply an integer 0-255& goto :EOF"
  if "%~1" equ "" %USAGE%
  set /a "val=%~1" 2>nul
  if "%~1" neq "%val%" %USAGE%
  if %~1 lss 0    %USAGE%
  if %~1 gtr 255  %USAGE%

  set tempfile=%~1.tmp
  set "options=/d compress=off /d reserveperdatablocksize=26"
  if %~1 neq 26  (type nul >"%tempfile%"
  makecab %options% /d reserveperfoldersize=%~1 "%tempfile%" %~1.chr >nul
  type %~1.chr | (
  (for /l %%N in (1 1 38) do pause)>nul&findstr "^">"%tempfile%")
  >nul copy /y "%tempfile%" /a %~1.chr /b
  del "%tempfile%"
  ) else (copy /y nul + nul /a 26.chr /a >nul)
  endlocal

有关更多神秘的脚本,你可以结合hem.Only MSHTA并找到MakeCab解决方案将所有的Windows机器上工作。 FORFILES和CERTUTIL是默认的形式Vista和上面我think.It可以创建几个例子...

for more cryptic script you can combine hem.Only MSHTA and MAKECAB solutions will work on every windows machine. FORFILES and CERTUTIL are default form Vista and above I think.It is possible to create a few more examples ...

这篇关于XOR在一个bat文件的字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆