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

Scripts/Batch Discussion :

Sécurité du script [Batch]


Sujet :

Scripts/Batch

  1. #1
    Membre du Club
    Homme Profil pro
    DevOps
    Inscrit en
    Juillet 2014
    Messages
    37
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Bas Rhin (Alsace)

    Informations professionnelles :
    Activité : DevOps

    Informations forums :
    Inscription : Juillet 2014
    Messages : 37
    Points : 43
    Points
    43
    Par défaut Sécurité du script
    Bonsoir,

    Y a t il un moyen de protéger son code d'un .bat ? Par un mot de passe, ou un cryptage ?

    En effet je me connecte à un FTP, je mets donc mes identifiants dans ce .bat. Je ne voudrais pas qu'un utilisateur malvaillant les prennent...

    Merci !

    Cordialement, Guiguir68

  2. #2
    Membre expert
    Avatar de sachadee
    Homme Profil pro
    AMI DU BAT
    Inscrit en
    Janvier 2013
    Messages
    1 478
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Brésil

    Informations professionnelles :
    Activité : AMI DU BAT
    Secteur : Distribution

    Informations forums :
    Inscription : Janvier 2013
    Messages : 1 478
    Points : 3 768
    Points
    3 768
    Par défaut
    Il n'y a malheureusement aucun moyen vraiment sûr.

    Tu peux compiler ton code en exe ou essayer de cacher ton code dans un pseudo cryptage, mais ces 2 solutions sont facilement crackable.

    Je poste ici ,un code HTA fait par mon ami Delmar Grande, de cryptage de fichier bat.

    Ça peut faire l'affaire si on a à faire à des utilisateurs lambda.

    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
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    <html>
    <head>
    <title>DBatchcrypt</title>
    
    <HTA:APPLICATION
       ID="objDBatchcrypt"
        icon="Cmd.exe"
        APPLICATIONNAME="DBatchcrypt"
       SCROLL="no"
       navigable="no"
       selection="no"
       showintaskbar="yes"
       singleinstance="no"
       innerborder="no"
       maximizebutton="no"
       minimizebutton="yes"
       border="dialog"
       borderstyle="normal"
       caption="yes"
       contextMenu="no"
       sysmenu="yes"
    >
    <link rel="stylesheet" media="screen" type="text/css" title="design_encoder" href="http://hackoo.alwaysdata.net/design_encoder.css"/>
    <style>
    body,td,a {font-family:Tahoma, Veranda, Arial; font-size:12px; text-decoration:none; color:black;}
    a:link { color : blue; background : transparent ;  text-decoration: underline}
    a:visited { color : black; background : transparent ;  text-decoration: none}
    a:Hover { color : red; background : transparent ;  text-decoration: none}
    </style>
    
    </head>
    
    
    
    <SCRIPT LANGUAGE="VBScript">
    '--------------------------------------------------------------------------------
    
    Sub Window_Onload
     window.resizeto 750,400
           SplashOut.Style.Display = "none"
           iTimerID = window.setInterval("ShowSplash", 13000)
     txtNotes.value = "1. Cryptografier vos bats."&vbcrlf&"2. Visitez DBatchScript ."
    End Sub
    
    '--------------------------------------------------------------------------------
    
    Sub ShowSplash
           Splash.Style.Display = "None"
           Main.Style.Display = "Inline"
     SplashOut.Style.Display = "none"
    End Sub
    
    
    '--------------------------------------------------------------------------------
    
    Function cmdEncode
    
    Const ForReading = 1
    
    Dim fso
    Set fso = CreateObject("Scripting.FileSystemObject")
    vCancel = false
    
    if not fso.fileexists(txtFile.value) then
     vCancel = true
    else
    Set f = fso.getfile(txtFile.value)
    
      if f.size > 100*1024 then
         if msgbox("Votre fichier est grand le traitement peut prendre un peu de temps..." & vbCrLf & "continuar?",vbYesNo+vbDefaultButton2)=vbNo then vCancel = true
     end if
    end if
    if not vCancel = true then
     if txtFile.value = "" then
          msgbox("Vous devez choisir un fichier")
      else
          vFileOut = txtFile.value & ".bat"
      end if
    txtNotes.value = txtNotes.value & vbCrLf & txtFile.value & " -> " & vFileOut
       
    LineLength = 0
    
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    set esc = objFSO.createtextfile(vFileOut) 'cria o batch
    Set objTextFile = objFSO.OpenTextFile _
        (txtFile.value, ForReading)
    
    strText = objTextFile.ReadAll
    objTextFile.Close
    
    arrComputers = Split(strText, vbCrLf)
    esc.write("@set ÿ=abcdefghijklmnopqrstuvxywzABCDEFGHIJKLMNOPQRSTUVXYWZ @()!")
    esc.writeblanklines(1) 'proxima linha
    For Each strComputer in arrComputers
        'Wscript.Echo strComputer
    if inStr(strComputer, ":") or inStr(strComputer, "!") or inStr(strComputer, "%") then
        ' String contains text
        strComputer = Replace(strComputer,"(","%ÿ:~54,1%")
        strComputer = Replace(strComputer,")","%ÿ:~55,1%")
        strComputer = Replace(strComputer,"!","%ÿ:~56,1%")
        esc.write(strComputer)
        esc.writeblanklines(1) 'proxima linha
    else
        ' String doesn't contain text
        strComputer = Replace(strComputer,"a","%ÿ:~0,1%")
        strComputer = Replace(strComputer,"b","%ÿ:~1,1%")
        strComputer = Replace(strComputer,"c","%ÿ:~2,1%")
        strComputer = Replace(strComputer,"d","%ÿ:~3,1%")
        strComputer = Replace(strComputer,"e","%ÿ:~4,1%")
        strComputer = Replace(strComputer,"f","%ÿ:~5,1%")
        strComputer = Replace(strComputer,"g","%ÿ:~6,1%")
        strComputer = Replace(strComputer,"h","%ÿ:~7,1%")
        strComputer = Replace(strComputer,"i","%ÿ:~8,1%")
        strComputer = Replace(strComputer,"j","%ÿ:~9,1%")
        strComputer = Replace(strComputer,"k","%ÿ:~10,1%")
        strComputer = Replace(strComputer,"l","%ÿ:~11,1%")
        strComputer = Replace(strComputer,"m","%ÿ:~12,1%")
        strComputer = Replace(strComputer,"n","%ÿ:~13,1%")
        strComputer = Replace(strComputer,"o","%ÿ:~14,1%")
        strComputer = Replace(strComputer,"p","%ÿ:~15,1%")
        strComputer = Replace(strComputer,"q","%ÿ:~16,1%")
        strComputer = Replace(strComputer,"r","%ÿ:~17,1%")
        strComputer = Replace(strComputer,"s","%ÿ:~18,1%")
        strComputer = Replace(strComputer,"t","%ÿ:~19,1%")
        strComputer = Replace(strComputer,"u","%ÿ:~20,1%")
        strComputer = Replace(strComputer,"v","%ÿ:~21,1%")
        strComputer = Replace(strComputer,"x","%ÿ:~22,1%")
        strComputer = Replace(strComputer,"y","%ÿ:~23,1%")
        strComputer = Replace(strComputer,"w","%ÿ:~24,1%")
        strComputer = Replace(strComputer,"z","%ÿ:~25,1%")
        strComputer = Replace(strComputer,"A","%ÿ:~26,1%")
        strComputer = Replace(strComputer,"B","%ÿ:~27,1%")
        strComputer = Replace(strComputer,"C","%ÿ:~28,1%")
        strComputer = Replace(strComputer,"D","%ÿ:~29,1%")
        strComputer = Replace(strComputer,"E","%ÿ:~30,1%")
        strComputer = Replace(strComputer,"F","%ÿ:~31,1%")
        strComputer = Replace(strComputer,"G","%ÿ:~32,1%")
        strComputer = Replace(strComputer,"H","%ÿ:~33,1%")
        strComputer = Replace(strComputer,"I","%ÿ:~34,1%")
        strComputer = Replace(strComputer,"J","%ÿ:~35,1%")
        strComputer = Replace(strComputer,"K","%ÿ:~36,1%")
        strComputer = Replace(strComputer,"L","%ÿ:~37,1%")
        strComputer = Replace(strComputer,"M","%ÿ:~38,1%")
        strComputer = Replace(strComputer,"N","%ÿ:~39,1%")
        strComputer = Replace(strComputer,"O","%ÿ:~40,1%")
        strComputer = Replace(strComputer,"P","%ÿ:~41,1%")
        strComputer = Replace(strComputer,"Q","%ÿ:~42,1%")
        strComputer = Replace(strComputer,"R","%ÿ:~43,1%")
        strComputer = Replace(strComputer,"S","%ÿ:~44,1%")
        strComputer = Replace(strComputer,"T","%ÿ:~45,1%")
        strComputer = Replace(strComputer,"U","%ÿ:~46,1%")
        strComputer = Replace(strComputer,"V","%ÿ:~47,1%")
        strComputer = Replace(strComputer,"X","%ÿ:~48,1%")
        strComputer = Replace(strComputer,"Y","%ÿ:~49,1%")
        strComputer = Replace(strComputer,"W","%ÿ:~50,1%")
        strComputer = Replace(strComputer,"Z","%ÿ:~51,1%")
        strComputer = Replace(strComputer," ","%ÿ:~52,1%")
        strComputer = Replace(strComputer,"@","%ÿ:~53,1%")
        esc.write(strComputer)
        esc.writeblanklines(1) 'proxima linha
    End if
    Next
    esc.close 'fecha
    
      txtNotes.value = txtNotes.value & vbCrLf & "Cryptage termine avec succes "
      msgbox "Cryptage termine avec succes"
    end if
    
    end Function
    '--------------------------------------------------------------------------------
    sub Sobre
      msgbox "DBatchEncrypt Créé par Delmar Grande" & vbCrLf & "Visitez le Forum DBatchScript" & vbCrLf & "http://dbatchscript.lesite.com/" & vbCrLf & "Visitez le forum Bbat" & vbCrLf & "http://bbat.lesiteo.com/" & vbCrLf & "Interface Matrix By Hackoo"& vbCrLf & "Traduction FR par SachaDee"
    end sub
    
    '--------------------------------------------------------------------------------
    
    Sub Sleep(strSeconds)
     strCmd = "%COMSPEC% /c ping -n " & strSeconds & " 127.0.0.1>nul"
     Set objShell=CreateObject("Wscript.shell")
     objShell.Run strCmd,0,1
    End Sub
    
    '--------------------------------------------------------------------------------
    </SCRIPT>
    
    
    <body>
    
    <DIV id="Splash" STYLE="Background-color:white;Height:200;Width:400;Border:0.1mm solid black;position:relative;top:60;left:175;font:14pt arial;">
    <br>
    <center onselectstart="return false" ondragstart="return false" oncontextmenu="return false">
      <marquee DIRECTION="UP" HEIGHT="200" WIDTH="350" SCROLLAMOUNT="3" onselectstart="return false">
       <center><font face="Comic sans MS" color=blue size=10><b><i> DBatchEncrypt </i></b></font></center>
         <br><br>
       <center><font face="Comic sans MS" color=blue>Crypter vos batch</b></font></center>
        <br><center><font face="Comic sans MS" color=blue>DBatchEncrypt By Delmar Grande®<br><br></font></center>
         <center><img src="http://i35.servimg.com/u/f35/18/37/58/63/dbatch10.png"></center>
    <center><font face="Comic sans MS" color=blue> Interface By Hackoo </i></b></font></center>
    <center><font face="Comic sans MS" color=blue> Traduction FR SachaDee </i></b></font></center>
         <br><br>
         <br><br>
        </marquee>
     </center>
    </DIV>
    <DIV id="SplashOut" STYLE="Background-color:white;Height:200;Width:400;Border:0.1mm solid black;position:relative;top:60;left:175;font:14pt arial;">
    <br><br>  
    </DIV>
    
    <DIV id="Main" STYLE="display:none;position:absolute">
    <br><br><br>
    <table width="100%" >
      <tr>
        <td width="50%" valign="top">
       <font color=white>Choisir le fichier a crypter</font>
       <br>
       <input name="txtFile" size ="40" type="file" id="txtFile">
       <BR><BR><br>
        <input name="txtFileOut" type="file" id="txtFileOut" STYLE="display:none;position:none">
        </td>
        <td width="50%" valign="center">
       <font face="Comic sans MS" color=blue size=6><b> DBatchEncrypt </b></font><br>
        <input id=runbutton1 class="button" type="button" value="Crypter..." name="cmdEncode" onClick="cmdEncode">
        <input id=runbutton2 class="button" type="button" value="A propos" name="cmdEncode" onClick="Sobre">
         </td>
      </tr>
    </table>
    <br><BR>
    
    Mensagem:
    
    <br><br>
    
    <center><textarea name="txtNotes" cols="86" rows="4" ></textarea></center>
    </DIV>
    
    </body>
    ________________________________
    Un p'tit coup de pouce ça fait toujours plaisir, pensez-y !
    ________________________________

  3. #3
    Expert éminent
    Avatar de hackoofr
    Homme Profil pro
    Enseignant
    Inscrit en
    Juin 2009
    Messages
    3 836
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 48
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Enseignant

    Informations forums :
    Inscription : Juin 2009
    Messages : 3 836
    Points : 9 217
    Points
    9 217
    Par défaut
    Sacha
    Si tu as le temps de le traduire en français et de le poster le dans la section contributions, tu peux bien sûr mentionner le copyright de l'auteur et ainsi son traducteur
    Vraiment j'ai bien aimé ce HTA et pour le partage +1 de la part de ton ami Hackoo

  4. #4
    Membre du Club
    Homme Profil pro
    DevOps
    Inscrit en
    Juillet 2014
    Messages
    37
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Bas Rhin (Alsace)

    Informations professionnelles :
    Activité : DevOps

    Informations forums :
    Inscription : Juillet 2014
    Messages : 37
    Points : 43
    Points
    43
    Par défaut
    Ok, merci

  5. #5
    Membre expert
    Avatar de sachadee
    Homme Profil pro
    AMI DU BAT
    Inscrit en
    Janvier 2013
    Messages
    1 478
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Brésil

    Informations professionnelles :
    Activité : AMI DU BAT
    Secteur : Distribution

    Informations forums :
    Inscription : Janvier 2013
    Messages : 1 478
    Points : 3 768
    Points
    3 768
    Par défaut
    Voilà Hackoo,

    J'ai updaté le POST avec la version complètement traduite avec un Credit à Hackoo pour l'interface Matrix.
    ________________________________
    Un p'tit coup de pouce ça fait toujours plaisir, pensez-y !
    ________________________________

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Erreur de sécurité avec script PHP
    Par offspring dans le forum Silverlight
    Réponses: 1
    Dernier message: 23/10/2009, 15h51
  2. [phpBB] Question de sécurité du script de forum phpbb
    Par keokaz dans le forum EDI, CMS, Outils, Scripts et API
    Réponses: 3
    Dernier message: 11/03/2009, 20h52
  3. sécurité et scripts
    Par medora dans le forum Sécurité
    Réponses: 6
    Dernier message: 11/04/2007, 17h58
  4. [Sécurité] Arret d'un script au bout d'une heure
    Par NhyMbuS dans le forum PHP & Base de données
    Réponses: 13
    Dernier message: 15/11/2006, 19h11
  5. Réponses: 6
    Dernier message: 16/01/2006, 16h24

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