obfuscating batch+HTA hybrid script

霸气de小男生 提交于 2020-01-11 07:26:07

问题


Following is the hybrid batch script:

<!-- :: Batch section
@echo off
setlocal

echo Select an option:
for /F "delims=" %%a in ('mshta.exe "%~F0"') do set "HTAreply=%%a"
echo End of HTA window, reply: "%{HTAreply}%"
pause
goto :EOF
-->


<HTML>
<HEAD>
<HTA:APPLICATION SCROLL="no" SYSMENU="no" >

<TITLE>HTA Buttons</TITLE>
<SCRIPT language="JavaScript">
window.resizeTo(374,100);

function closeHTA(reply){
   var fso = new ActiveXObject("Scripting.FileSystemObject");
   fso.GetStandardStream(1).WriteLine(reply);
   window.close();
}

</SCRIPT>
</HEAD>
<BODY>
   <button onclick="closeHTA(1);">First option</button>
   <button onclick="closeHTA(2);">Second option</button>
   <button onclick="closeHTA(3);">Third option</button>
</BODY>
</HTML>

Output:

I obfuscated it as stated here : [Post#21] https://www.dostips.com/forum/viewtopic.php?t=7990&start=15

but then the HTA app output isn't as before. It is as follows: The entire batch content is displayed in the HTML window.

I want to know why this happens and secondly is there any way to obfuscate this hybrid batch script Same happens when I try to convert the batch file to exe.

Edit

Problem solved. There was an error in html code. apologies. I would have edited to show the problem but I guess it was too trivial to do that.

来源:https://stackoverflow.com/questions/47793813/obfuscating-batchhta-hybrid-script

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!