IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

VBScript Discussion :

[HTA-VBS-HTML] Utiliser hta à partir du web.


Sujet :

VBScript

  1. #1
    Membre du Club
    Homme Profil pro
    Technicien maintenance
    Inscrit en
    Février 2014
    Messages
    37
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations professionnelles :
    Activité : Technicien maintenance
    Secteur : Industrie

    Informations forums :
    Inscription : Février 2014
    Messages : 37
    Points : 41
    Points
    41
    Par défaut [HTA-VBS-HTML] Utiliser hta à partir du web.
    Bonjour a tous et merci d'avance pour votre aide,

    Je souhaite utiliser un hta à partir d'une page web, le hta (hébergé sur mon serveur) sert a coder et décoder les vbs, Merci

    Le code du codedecode.hta: source Hackoofr
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    	<html>
        <head>
        <title>Encode Decode VBS-VBE Files [XO***]</title>
        <HTA:APPLICATION
          APPLICATIONNAME="Encode & Decode VBS-VBE Files Positrons"
          ID="Encode & Decode Files"
          ICON="Explorer.exe"
          BORDER="dialog"
          INNERBORDER="no"
          MAXIMIZEBUTTON="no"
          SCROLL="no"
          VERSION="1.0"/>
          <bgsound src="http://hackoo.alwaysdata.net/pirates.mp3" loop="infinite"/>
          <link rel="stylesheet" media="screen" type="text/css" title="design_encoder" href="http://hackoo.alwaysdata.net/design_encoder.css"/>
        <style>
        Label
        {
         color : ;
         font-family : "Courrier New";
        }
        input.button {  background-color : #EFEFEF;
                                        color : #000000; cursor:hand;
                                        font-size: 11px; font-family: Verdana, Arial, Helvetica, sans-serif; }
        </style>
        </head>
        <script language="VBScript">
        Sub Window_OnLoad
          CenterWindow 730, 580
        End Sub
        Sub CenterWindow(x,y)
                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 OnClickButtonCancel()
          Window.Close
        End Sub
     
        Sub Decode_Textarea
        Const FOR_READING = 1, FOR_WRITING = 2, BOOL_CREATION = True, BOOL_TRISTATETRUE = -1, BOOL_NO_CREATION = False
        Set objFso = CreateObject("Scripting.FileSystemObject")
        Set Ws = CreateObject("wscript.Shell")
        code = txtBody.value
        Set F = objFso.OpenTextFile("DecodeMe.vbs",2,True)
        F.writeline "Msg=" & code & ""
        F.WriteLine "Set objFso = CreateObject(""Scripting.FileSystemObject"")"
        F.WriteLine "objFso.OpenTextFile(""DecodedFile.txt"",2,True).WriteLine Msg"
        F.Close
        If objFSO.FileExists("DecodeMe.vbs") Then
        Ws.Run "DecodeMe.vbs",True
        End If
        Sleep 2000
        If objFSO.FileExists("DecodedFile.txt") Then
        Set Readme = objFso.OpenTextFile("DecodedFile.txt",1)
        LireTout = Readme.ReadAll
        txtBody.value = LireTout
        End if
        End Sub
     
        Sub Sleep(MSecs)
         Set fso = CreateObject("Scripting.FileSystemObject")
          If Fso.FileExists("sleeper.vbs")=False Then
          Set objOutputFile = fso.CreateTextFile("sleeper.vbs", True)
          objOutputFile.Write "wscript.sleep WScript.Arguments(0)"
          objOutputFile.Close
          End If
         CreateObject("WScript.Shell").Run "sleeper.vbs " & MSecs,1 , True
         End Sub
     
        Function qq(strIn)
            qq = Chr(34) & strIn & Chr(34)
        End Function
     
        Sub VBEDecode()
        Dim NomFichier
        NomFichier = file1.value
        If NomFichier<>"" Then
                Dim fso
                Set fso=CreateObject("Scripting.FileSystemObject")
                If fso.FileExists(NomFichier) Then
                        Dim fic,contenu
                        Set fic = fso.OpenTextFile(NomFichier, 1)
                        Contenu=fic.readAll
                        fic.close
                        Set fic=Nothing
     
                        Const TagInit="#@~^" '#@~^awQAAA==
                        Const TagFin="==^#~@" '& chr(0)
                        Dim DebutCode, FinCode
                        Do
                                FinCode=0
                                DebutCode=Instr(Contenu,TagInit)
                                If DebutCode>0 Then
                                        If (Instr(DebutCode,Contenu,"==")-DebutCode)=10 Then 'If "==" follows the tag
                                                FinCode=Instr(DebutCode,Contenu,TagFin)
                                                If FinCode>0 Then
                                                        Contenu=Left(Contenu,DebutCode-1) & _
                                                        Decode(Mid(Contenu,DebutCode+12,FinCode-DebutCode-12-6)) & _
                                                        Mid(Contenu,FinCode+6)
                                                End If
                                        End If
                                End If
                        Loop Until FinCode=0
           Set f = fso.OpenTextFile(NomFichier &"_Decodee.txt",2,true)
           f.writeLine contenu
           If  fso.FileExists(NomFichier &"_Decodee.txt") Then
     
                        Set fic = fso.OpenTextFile(NomFichier &"_Decodee.txt", 1)
                        Contenu=fic.ReadAll
                        txtBody.value = Contenu
                        fic.Close
     
                        Set fic=Nothing
                End if 
                Else
                        MsgBox NomFichier & " not found"
                End If
                Set fso=Nothing
        Else
                MsgBox "Please give a filename"
                MsgBox "Usage : " & wscript.fullname  & " " & WScript.ScriptFullName & " <filename>"
        End If
        End Sub
        Function Decode(Chaine)
                Dim se,i,c,j,index,ChaineTemp
                Dim tDecode(127)
                Const Combinaison="1231232332321323132311233213233211323231311231321323112331123132"
     
                Set se=CreateObject("Scripting.Encoder")
                For i=9 to 127
                        tDecode(i)="JLA"
                Next
                For i=9 to 127
                        ChaineTemp=Mid(se.EncodeScriptFile(".vbs",string(3,i),0,""),13,3)
                        For j=1 to 3
                                c=Asc(Mid(ChaineTemp,j,1))
                                tDecode(c)=Left(tDecode(c),j-1) & chr(i) & Mid(tDecode(c),j+1)
                        Next
                Next
                'Next line we correct a bug, otherwise a ")" could be decoded to a ">"
                tDecode(42)=Left(tDecode(42),1) & ")" & Right(tDecode(42),1)
                Set se=Nothing
     
                Chaine=Replace(Replace(Chaine,"@&",chr(10)),"@#",chr(13))
                Chaine=Replace(Replace(Chaine,"@*",">"),"@!","<")
                Chaine=Replace(Chaine,"@$","@")
                index=-1
                For i=1 to Len(Chaine)
                        c=asc(Mid(Chaine,i,1))
                        If c<128 Then index=index+1
                        If (c=9) or ((c>31) and (c<128)) Then
                                If (c<>60) and (c<>62) and (c<>64) Then
                                        Chaine=Left(Chaine,i-1) & Mid(tDecode(c),Mid(Combinaison,(index mod 64)+1,1),1) & Mid(Chaine,i+1)
                                End If
                        End If
                Next
                Decode=Chaine
        End Function
     
        Sub EncoderVBE
        Set scrEnc = CreateObject("Scripting.Encoder")
        Set scrFSO = CreateObject("Scripting.FileSystemObject")
        MonFichier = file1.value
            myfile = scrFSO.OpenTextFile(MonFichier).ReadAll
            If scrFSO.FileExists(MonFichier&"_encode.vbe") Then scrFSO.DeleteFile MonFichier&"_encode.vbe", True
            myFileEncode=scrENC.EncodeScriptFile(".vbs", myfile, 0, "")
            Set ts = scrFSO.CreateTextFile(MonFichier&"_encode.vbe.txt", True, False)
            ts.Write myFileEncode
        ts.Close
        Set fic = scrFSO.OpenTextFile(MonFichier&"_encode.vbe.txt", 1)
                        Contenu=fic.ReadAll
                        txtBody.value = Contenu
                        fic.Close
        End Sub
     
        </script>
        <center>
        <label>Fichier : </label><input type="file" name="file1" id="file1" /><br>
        <label>----------------------Resultat de la Conversion----------------------</label><br/>
        <textarea id="txtBody" rows="26" cols="82"></textarea><br><br>
        <input type="button" style="width: 140px" name="OK" id="OK" value="Encoder le Fichier" onclick="EncoderVBE">
        <input type="button" style="width: 140px" name="OK" id="OK" value="Decoder le Fichier" onclick="VBEDecode">
        <input type="button" style="width: 100px" name="Cancel" id="Cancel" value="Sortir" onclick="OnClickButtonCancel">
        </td></tr>
        </table>
        </table>
        </body>
        </html>

  2. #2
    Modérateur
    Avatar de ProgElecT
    Homme Profil pro
    Retraité
    Inscrit en
    Décembre 2004
    Messages
    6 077
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 68
    Localisation : France, Haute Savoie (Rhône Alpes)

    Informations professionnelles :
    Activité : Retraité
    Secteur : Communication - Médias

    Informations forums :
    Inscription : Décembre 2004
    Messages : 6 077
    Points : 17 184
    Points
    17 184
    Par défaut
    Salut

    HTA ne peut être utilisé qu'au niveau local, pour des raisons de sécurité étant donné que dans un HTA des commandes potentiellement dangereuses peuvent être utilisées.
    Soyez sympa, pensez -y
    Balises[CODE]...[/CODE]
    Balises[CODE=NomDuLangage]...[/CODE] quand vous mettez du code d'un autre langage que celui du forum ou vous postez.
    Balises[C]...[/C] code intégré dans une phrase.
    Balises[C=NomDuLangage]...[/C] code intégré dans une phrase quand vous mettez du code d'un autre langage que celui du forum ou vous postez.
    Le bouton en fin de discussion, quand vous avez obtenu l'aide attendue.
    ......... et pourquoi pas, pour remercier, un pour celui/ceux qui vous ont dépannés.
    👉 → → Ma page perso sur DVP ← ← 👈

  3. #3
    Membre du Club
    Homme Profil pro
    Technicien maintenance
    Inscrit en
    Février 2014
    Messages
    37
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations professionnelles :
    Activité : Technicien maintenance
    Secteur : Industrie

    Informations forums :
    Inscription : Février 2014
    Messages : 37
    Points : 41
    Points
    41
    Par défaut [HTA-VBS-HTML] Utiliser hta à partir du web.
    Merci pour ta réponse ProgElecT,

    connais tu une page code html qui fait la même chose crypter et décrypter vbs Merci

Discussions similaires

  1. [HTA/VBS] Mettre un bouton par defaut
    Par bigfoot75 dans le forum VBScript
    Réponses: 6
    Dernier message: 04/01/2018, 15h20
  2. [Web Service] Utilisation d'un service web C# à partir de PHP
    Par koktel_dfr dans le forum Bibliothèques et frameworks
    Réponses: 5
    Dernier message: 17/04/2012, 14h10
  3. ajouter un element dans un html ou hta
    Par patricktoulon dans le forum VBScript
    Réponses: 3
    Dernier message: 06/04/2011, 18h05
  4. Réponses: 1
    Dernier message: 04/01/2010, 18h30
  5. [HTA/VBS] inputbox cryptée
    Par bigfoot75 dans le forum VBScript
    Réponses: 4
    Dernier message: 28/10/2009, 14h23

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo