1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
| @echo off
Title Masquer la saisie du mot de passe en utilisant le module du HTABOX by Hackoo
mode con cols=75 lines=24 & color 9B
:askpassword
echo Veuillez Taper votre mot de passe
Set MyVBSFile=%tmp%\%~n0.vbs
Set MyHTAFile=%tmp%\%~n0.hta
Call :CreateMyVBS
Cscript.exe //NOLOGO %MyVBSFile%
start /wait mshta.exe "%MyHTAFile%"
for /f %%i in (%tmp%\userIn) do set "password=%%i"
cls
echo Veuillez confirmer de nouveau votre mot de passe
Call :CreateMyVBS
start /wait mshta.exe "%MyHTAFile%"
for /f %%i in (%tmp%\userIn) do set "rpassword=%%i"
Del "%MyVBSFile%" & Del "%MyHTAFile%" & Del %tmp%\userIn
cls
if not "%password%"=="%rpassword%" (
color 9C
echo.
echo Les deux mots de passe saisis ne sont pas identiques !
echo.
echo.
Timeout /NOBREAK /T 3 >nul
cls
goto askpassword
) else (
color 9A
echo. Bravo les deux mots de passe saisis sont identiques !
)
Timeout /NOBREAK /T 3 >nul
Exit
::****************************************************************************************
:#Start
<html>
<head>
<title>Mot de Passe © Hackoo</title>
<hta:application id="htaid"
applicationName="Password"
border="thin"
icon="wlrmdr.exe"
borderStyle="normal"
caption="yes"
contextMenu="no"
maximizeButton="no"
minimizeButton="yes"
navigable="yes"
showInTaskbar="yes"
singleInstance="yes"
sysmenu="yes"
SCROLL="NO"
SHOWINTASKBAR="Yes"
SELECTION="no"
MINIMIZEBUTTON="no"
>
</head>
<META HTTP-EQUIV="MSThemeCompatible" CONTENT="YES">
<BODY TOPMARGIN="1" LEFTMARGIN="1"><CENTER><DIV><SPAN ID="ONSCR"></SPAN></DIV></CENTER></BODY>
<script language="vbscript">
'---------------------------------------------------------------------------------------
Sub Window_OnLoad
CenterWindow 300,150
Call PasswordForm()
Call Parler("Veuillez entrer votre mot de passe")
Call TextFocus()
end sub
'---------------------------------------------------------------------------------------
Sub CenterWindow(x,y)
Dim iLeft,itop
window.resizeTo x,y
iLeft = window.screen.availWidth/2 - x/2
itop = window.screen.availHeight/2 - y/2
window.moveTo ileft,itop
End Sub
'----------------------------------------------------------------------------------------
Sub SavePassword()
set fs=CreateObject("Scripting.FileSystemObject")
strFile=fs.GetAbsolutePathName(fs.BuildPath(fs.GetSpecialFolder(2),"UserIn"))
set ts=fs.OpenTextFile(strFile,2,True)
If PasswordArea.value <> "" Then
ts.WriteLine PasswordArea.value
ts.Close
self.Close 'Pour fermer ce HTA après avoir enregistré le mot de passe comme une variable dans le fichier Userin
else
Msgbox "Le mot de passe est vide ! "& Vbcrlf & "SVP entrez de nouveau votre mot de passe",VbExclamation,"Mot de Passe © Hackoo"
Location.reload(true) 'Pour recharger à nouveau ce HTA
end if
End Sub
'----------------------------------------------------------------------------------------
Sub PasswordForm()
Self.document.title = "Mot de Passe © Hackoo"
Self.document.bgColor = "lightblue"
ONSCR.InnerHTML="<center><FONT COLOR=""#FFFFFF"" SIZE=""+1"" FACE=""VERDANA,ARIAL,HELVETICA,SANS-SERIF"">Taper votre mot de passe</FONT<br>"_
&"<input type=""password"" name=""PasswordArea"" size=""20"" onKeyUp=""TextFocus""><P>"_
&"<input type=""Submit"" STYLE=""HEIGHT:25;WIDTH:110"" value=""OK"" onClick=""SavePassword"">"
END Sub
'----------------------------------------------------------------------------------------
Sub TextFocus
PasswordArea.Focus
End Sub
'----------------------------------------------------------------------------------------
Sub Sleep(MSecs)' Fonction pour faire une pause car wscript.sleep ne marche pas dans un HTA
Set fso = CreateObject("Scripting.FileSystemObject")
Dim tempFolder : Set tempFolder = fso.GetSpecialFolder(2)
Dim tempName : tempName = "Sleeper.vbs"
If Fso.FileExists(tempFolder&"\"&tempName)=False Then
Set objOutputFile = fso.CreateTextFile(tempFolder&"\"&tempName, True)
objOutputFile.Write "wscript.sleep WScript.Arguments(0)"
objOutputFile.Close
End If
CreateObject("WScript.Shell").Run tempFolder&"\"&tempName &" "& MSecs,1,True
'----------------------------------------------------------------------------------------
End Sub
Sub Parler(Message)
Set Sound = CreateObject("WMPlayer.OCX.7")
Sound.URL = "http://translate.google.com/translate_tts?tl=fr&q=" & Message
Sound.Controls.play
Do while Sound.currentmedia.duration = 0
Sleep 100
loop
Sleep (int(Sound.currentmedia.duration)+1)*1000
End Sub
::'***********************************************************************************************
</script>
</body>
</html>
:#End
::***********************************************************************************************
:CreateMyVBS
::'**********************************************************************************************
(
echo. Set fso = CreateObject^("Scripting.FileSystemObject"^)
echo. Set f=fso.opentextfile^("%~f0",1^)
echo. a=f.readall
echo. Set r=new regexp
echo. r.pattern = "(?:^|(?:\r\n))(?::#Start\r\n)([\s\S]*?)(?:\r\n)(?::#End)"
echo. Set Matches = r.Execute^(a^)
echo. If Matches.Count ^> 0 Then Data = Matches^(0^).SubMatches^(0^)
echo. WriteFileText "%MyHTAFile%",Data
echo. f.close
::'**********************************************************************************************
echo.
echo. Function WriteFileText^(sFile,Data^)
echo. Dim objFSO,oTS,sText
echo. Set objFSO = CreateObject^("Scripting.FileSystemObject"^)
echo. Set oTS = objFSO.CreateTextFile^(sFile,2^)
echo. oTS.WriteLine Data
echo. oTS.close
echo. set oTS = nothing
echo. Set objFSO = nothing
echo. End Function
) > %MyVBSFile%
::'*********************************************************************************************** |
Partager