Cet Exemple vous montre comment à partir d'un HTA, on peut exécuter quelques commandes MS-DOS.
NB:Je vous recommande de télécharger directement le HTA car il contient des caractères Unicode qui peuvent être illisibles lors du copier et coller du code source.
Source / Exemple :
<html>
<HTA:APPLICATION
ICON="cmd.exe"
APPLICATIONNAME = "Microsoft Windows [version 7.1 7631] Copyright Simulation Dos © Hackoo 2013"
BORDER="dialog"
BORDERSTYLE="complex"
SINGLEINSTANCE="yes"
WINDOWSTATE="maximize"
>
<style>
body{
background-color: Black;
}
</style>
<link rel="stylesheet" media="screen" type="text/css" title="design_encoder" href="http://hackoo.alwaysdata.net/design_encoder.css"/>
<title>Microsoft Windows [version 7.1 7631] Copyright Simulation Dos © Hackoo 2013</title>
<script type="text/Vbscript">
Function RunDos(Command,TempFile)
myDiv.innerHTML = ""
Set ws = CreateObject("WScript.Shell")
If Command="" Then
MsgBox "Attention il faut taper dans le champ de saisie une commande pour l'exécuter",48,"ATTENTION !"
Exit Function
End if
Res = ws.run("cmd /c "&Command&" > "&TempFile,0,True)
On Error Resume Next
RunDos = Err.Number
If Err.Number <> 0 Then
MsgBox Err.Description,16," Erreur"
Exit Function
End If
myDiv.innerHTML = LoadFile(TempFile)
End Function
Function LoadFile(TempFile)
Set fso = CreateObject("Scripting.FileSystemObject")
Set F = fso.OpenTextFile(TempFile,1)
ReadMe = F.ReadAll
Tab = split(ReadMe,vbcrlf)
For i = lbound(Tab) to ubound(Tab)
paragraphe=paragraphe & Tab(i) & "<br>" & vbcrlf
Next
paragraphe = Replace(paragraphe,"‚","é")
paragraphe = Replace(paragraphe,"ÿ"," ")
paragraphe = Replace(paragraphe,"ˆ","ê")
paragraphe = Replace(paragraphe,"‡","ç")
paragraphe = Replace(paragraphe,"“","ô")
paragraphe = Replace(paragraphe,"…","à")
paragraphe = Replace(paragraphe,"","è")
paragraphe = Replace(paragraphe,"ƒ","â")
paragraphe = Replace(paragraphe,"ے"," ")
LoadFile = paragraphe
End Function
Function TempFile()
Set Ws = CreateObject("WScript.Shell")
TempFile = Ws.ExpandEnvironmentStrings("%TEMP%")&"\out.txt"
End Function
</script>
<body text="white">
<center><FONT SIZE="3"><B><I>Quelques exemples de Commandes</I></B></FONT><BR>
<select style="background-color:Black" size="7" name="DropDown">
<option disabled>Microsoft Windows [version 7.1 7631] Copyright Simulation Dos © Hackoo 2013</option>
<option disabled>C:\>_</option>
<option value="Netstat">Netstat</option>
<option value="CD %Programfiles%\Mozilla Firefox\ | Start Firefox.exe">CD %Programfiles%\Mozilla Firefox\ | Start Firefox.exe</option>
<option value="Tracert www.google.fr">Tracert www.google.fr</option>
<option value="Start iexplore">Start iexplore</option>
<option value="Start Notepad">Start Notepad</option>
<option value="Start Winword">Start Winword</option>
<option value="Explorer.exe /n,/e,/root,C:\Program Files">Explorer.exe /n,/e,/root,C:\Program Files</option>
<option value="Ipconfig">IpConfig</option>
<option value="Dir">Dir</option>
<option value="Ping www.yahoo.fr">Ping www.yahoo.fr</option>
<option value="Ping www.google.fr">Ping www.google.fr</option>
</select><br>
<input type="button" onClick="RunDos DropDown.value,TempFile" value="Exécuter l'exemple">
<br>
<B><I>Tapez une Commande : </I></B><input type="text" id="montext" Value="help" size="30"><br><input type="Submit" value="Exécuter la Commande" onclick="RunDos montext.value,TempFile"></center>
<Div id="myDiv"></Div>
</body>
</html>
Conclusion :
Vos Commentaires et vos suggestions sont les Bienvenues !