How to Secure HTML Application (HTA)?

1.3k views Asked by At

I have created one GUI using below code in HTA:

Sub result ( )
    Dim strComputer, objShell, objExec, strPingResults, WshShell
strComputer = Trim( UCase( ComputerNameTextBox.Value ) )
        Set WshShell = CreateObject("WScript.Shell")
        Set objExec = WshShell.Exec("cmd.exe /c  C: \Program Files (x86)\VMware\VMware vSphere CLI\bin & esxcli -s "&strComputer&" -u root -p NTMC_Admin network nic list ")
        strPingResults = LCase(objExec.StdOut.ReadAll)
        ResultsTextArea.Value = ""

        ResultsHiddenText.Value = strComputer   & vbTab
        ResultsHiddenText.Value = strComputer & vbcr & vblf & strPingResults
        ResultsTextArea.Value = ResultsTextArea.Value & strPingResults   
        CopyButton.Disabled = False
        ResetButton.Disabled = False

    ' change mouse pointer back to default
    Document.Body.Style.Cursor = "default"
End Sub

Please help me out to secure my code so that no one can see the this function under any view source.

2

There are 2 answers

5
Hackoo On

You should try to convert your vbscript and your HTA to executables files !

(VbsEdit/HTAEdit), it's a package includes (VbsEdit 32-bit, VbsEdit 64-bit, HtaEdit 32-bit and HtaEdit 64-bit). has a good feature is to compile and convert your vbs or your HTA files into .exe and it is totaly free.

enter image description here

0
htmler On

hta_code.exe extract All resources And HTA either Into Temp folder Of System Or User specified Folder.u can easily reach temp folder while hta is running and copy extracted folder to a safe location because after Hta been closed Extracted command in .exe Delete all files from temp folder.to locate hta in temp folder we can use window search by typing .hta............@teemu is right @hackoo m not sure about htaedit but i will check this out today