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

Langage Delphi Discussion :

Mon soft est detecte comme un virus !


Sujet :

Langage Delphi

  1. #1
    Futur Membre du Club
    Profil pro
    Inscrit en
    Juillet 2009
    Messages
    7
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2009
    Messages : 7
    Points : 7
    Points
    7
    Par défaut Mon soft est detecte comme un virus !
    Bonjour tout le monde,

    J'ai enfin reussi a finir mon programme, permettant de creer un fichier exe qui lance une commande telle que 'dir' ou 'copy', et j'ai donc envoye mon projet a Softpedia, tout content. Seulement je viens de recevoir un mail me disant que mon programme contient un virus, un Trojan downloader (Delf) pour etre exact. Mon programme est compose de deux parties, une interface pour modifier deux strings dans le "Stub", et le stub en lui meme. Pour modifier des strings dans le fichier exe (le stub) compile en Delphi, j'utilise ExeMod. De cette facon, l'utilisateur n'a qu'a rentrer le nom de la commande dans une textbox, et l'interface se charge d'ecrire cette command dans le fichier exe. Seulement ce fichier est detecte comme un virus par A-Sqarred et Ikarus. Voici la source de ce fichier:

    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
    unit Unit1;
    //Fichier stub de Shell Command Extractor, la variable 'Command' est definie par l'utilisateur grace a l'interface fournie. Il en est de meme pour la variable 'Ghost'.
     
    interface
     
    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls, Exemod, ShellApi, strutils;
     
    type
      TSCEForm = class(TForm)
        CmdLabel: TLabel;
        Param1Label: TLabel;
        Param2Label: TLabel;
        Param3Label: TLabel;
        Param4Label: TLabel;
        procedure FormCreate(Sender: TObject);
        procedure FormClose(Sender: TObject; var Action: TCloseAction);
      private
        { Private declarations }
      public
        { Public declarations }
      end;
     
    var
      SCEForm: TSCEForm;
     
    implementation
     
    {$R *.dfm}
     
    procedure TSCEForm.FormCreate(Sender: TObject);
    var
      Command:String;
      Ghost:String;
    begin
      //Rendre le contenu de Ghost et Command modifiable de facon externe grace a ExeMod
      ExtractFromExe('nil', Command);
      ExtractFromExe('ghostnil', Ghost);
      //Afficher la commande
      CmdLabel.Caption := Command;
      //Verifier si les parametres contiennent des espaces
      Param1Label.Caption := ParamStr(1);
      Param2Label.Caption := ParamStr(2);
      Param3Label.Caption := ParamStr(3);
      Param4Label.Caption := ParamStr(4);
      If AnsiContainsStr(ParamStr(1), ' ') Then Param1Label.Caption := '"'+Param1Label.Caption+'"';
      If AnsiContainsStr(ParamStr(2), ' ') Then Param2Label.Caption := '"'+Param2Label.Caption+'"';
      If AnsiContainsStr(ParamStr(3), ' ') Then Param3Label.Caption := '"'+Param3Label.Caption+'"';
      If AnsiContainsStr(ParamStr(4), ' ') Then Param4Label.Caption := '"'+Param4Label.Caption+'"';
      //Si le mode Ghost est choisi, verifier le nombre de parametres et lancer la commande de facon silencieuse
      If Ghost = 'True' Then
      begin
        Application.ShowMainForm := False;
        If Param1Label.Caption = '' Then ShellExecute(Handle, 'open', 'cmd.exe', Pchar('/K '+Command), nil, SW_HIDE);
        If Param1Label.Caption <> '' Then If Param2Label.Caption = '' Then ShellExecute(Handle, 'open', 'cmd.exe', Pchar('/K '+Command+' '+Param1Label.Caption), nil, SW_HIDE);
        If Param1Label.Caption <> '' Then If Param2Label.Caption <> '' Then If Param3Label.Caption = '' Then ShellExecute(Handle, 'open', 'cmd.exe', Pchar('/K '+Command+' '+Param1Label.Caption+' '+Param2Label.Caption), nil, SW_HIDE);
        If Param1Label.Caption <> '' Then If Param2Label.Caption <> '' Then If Param3Label.Caption <> '' Then If Param4Label.Caption = '' Then ShellExecute(Handle, 'open', 'cmd.exe', Pchar('/K '+Command+' '+Param1Label.Caption+' '+Param2Label.Caption+' '+Param3Label.Caption), nil, SW_HIDE);
        If Param1Label.Caption <> '' Then If Param2Label.Caption <> '' Then If Param3Label.Caption <> '' Then If Param4Label.Caption <> '' Then ShellExecute(Handle, 'open', 'cmd.exe', Pchar('/K '+Command+' '+Param1Label.Caption+' '+Param2Label.Caption+' '+Param3Label.Caption+' '+Param4Label.Caption), nil, SW_HIDE);
        Application.Terminate;
      end
      //Si Ghost n'a pas ete active par l'utilisateur, lancer la commande de facon visible
      Else
      begin
        If Param1Label.Caption = '' Then ShellExecute(Handle, 'open', 'cmd.exe', Pchar('/K '+Command), nil, SW_SHOWNORMAL);
        If Param1Label.Caption <> '' Then If Param2Label.Caption = '' Then ShellExecute(Handle, 'open', 'cmd.exe', Pchar('/K '+Command+' '+Param1Label.Caption), nil, SW_SHOWNORMAL);
        If Param1Label.Caption <> '' Then If Param2Label.Caption <> '' Then If Param3Label.Caption = '' Then ShellExecute(Handle, 'open', 'cmd.exe', Pchar('/K '+Command+' '+Param1Label.Caption+' '+Param2Label.Caption), nil, SW_SHOWNORMAL);
        If Param1Label.Caption <> '' Then If Param2Label.Caption <> '' Then If Param3Label.Caption <> '' Then If Param4Label.Caption = '' Then ShellExecute(Handle, 'open', 'cmd.exe', Pchar('/K '+Command+' '+Param1Label.Caption+' '+Param2Label.Caption+' '+Param3Label.Caption), nil, SW_SHOWNORMAL);
        If Param1Label.Caption <> '' Then If Param2Label.Caption <> '' Then If Param3Label.Caption <> '' Then If Param4Label.Caption <> '' Then ShellExecute(Handle, 'open', 'cmd.exe', Pchar('/K '+Command+' '+Param1Label.Caption+' '+Param2Label.Caption+' '+Param3Label.Caption+' '+Param4Label.Caption), nil, SW_SHOWNORMAL);
      end;
    end;
     
    //Fermer la console qui s'ouvre avec le programme quand on quitte SCE
    procedure TSCEForm.FormClose(Sender: TObject; var Action: TCloseAction);
    var
      h: HWND;
    begin
      h := FindWindow(nil, 'C:\WINDOWS\system32\cmd.exe');
      if h <> 0 then PostMessage(h, WM_CLOSE, 0, 0);
    end;
     
    end.
    Oui, j'ai deja essaye de changer le nom de la variable Ghost, sans succes Une idee ?

  2. #2
    Membre chevronné

    Homme Profil pro
    Étudiant
    Inscrit en
    Juin 2009
    Messages
    935
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 33
    Localisation : France, Aveyron (Midi Pyrénées)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juin 2009
    Messages : 935
    Points : 1 765
    Points
    1 765
    Par défaut
    Salut

    Alors, par rapport a ton probleme de virus, je n'ai pas de solution (dsl) ...

    Par contre, tu pourrais optimiser un peu ton code :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
        If Param1Label.Caption = '' Then ShellExecute(Handle, 'open', 'cmd.exe', Pchar('/K '+Command), nil, SW_HIDE);
        If Param1Label.Caption <> '' Then If Param2Label.Caption = '' Then ShellExecute(Handle, 'open', 'cmd.exe', Pchar('/K '+Command+' '+Param1Label.Caption), nil, SW_HIDE);
        If Param1Label.Caption <> '' Then If Param2Label.Caption <> '' Then If Param3Label.Caption = '' Then ShellExecute(Handle, 'open', 'cmd.exe', Pchar('/K '+Command+' '+Param1Label.Caption+' '+Param2Label.Caption), nil, SW_HIDE);
        If Param1Label.Caption <> '' Then If Param2Label.Caption <> '' Then If Param3Label.Caption <> '' Then If Param4Label.Caption = '' Then ShellExecute(Handle, 'open', 'cmd.exe', Pchar('/K '+Command+' '+Param1Label.Caption+' '+Param2Label.Caption+' '+Param3Label.Caption), nil, SW_HIDE);
        If Param1Label.Caption <> '' Then If Param2Label.Caption <> '' Then If Param3Label.Caption <> '' Then If Param4Label.Caption <> '' Then ShellExecute(Handle, 'open', 'cmd.exe', Pchar('/K '+Command+' '+Param1Label.Caption+' '+Param2Label.Caption+' '+Param3Label.Caption+' '+Param4Label.Caption), nil, SW_HIDE);
    ... en ....

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    var Params : string;
     
    ...
     
    Params:=Param1Label.Caption+' '+Param2Label.Caption+' '+Param3Label.Caption+' '+Param4Label.Caption
    ShellExecute(Handle, 'open', 'cmd.exe', Pchar('/K '+Command+Params), nil, SW_HIDE);
    Est ce que ce code ne t'irais pas ??? (il ne fait pas exactement la meme chose que le tien ...)

    Sinon, autre chose :

    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
    var Params : String;
    ...
     
    Params:='';
    If Param1Label.Caption <> '' Then
    begin
      Params:=' '+Param1Label.Caption;
      If Param2Label.Caption <> '' Then
      begin
        Params:=Params+' '+Param2Label.Caption;
        If Param3Label.Caption <> '' Then
        begin
          Params:=Params+' '+Param3Label.Caption;
          If Param4Label.Caption <> '' Then
            Params:=Params+' '+Param4Label.Caption; 
        end;
      end;
    end;
    ShellExecute(Handle, 'open', 'cmd.exe', Pchar('/K '+Command+Params), nil, SW_HIDE);
    Celui la fait la meme chose que toi !

    Bonne chance et encore dsl pour ce probleme de virus !

    Edit : et tu peux remplacer AnsiContainsStr () par Pos, et tu n'auras pas besoin de l'unité StrUtils . Ils fonctionnent pareil !

    Edit n°2 :

    Crées une variable (de je sais plus quel type, appuie sur F1 !!) qui contient le type de fenetre que tu veux :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    var TypeFen : ????
     
    ...
     
      If Ghost then
        TypeFen := SW_HIDE
      else
        TypeFen := SW_SHOWNORMAL;
     
    ...
     
    ShellExecute(Handle, 'open', 'cmd.exe', Pchar('/K '+Command+Params), nil, TypeFen);

Discussions similaires

  1. Mon programme VB est reconnu comme un virus
    Par cebabonet dans le forum VB.NET
    Réponses: 1
    Dernier message: 09/09/2012, 00h03
  2. Le domaine de mon site est considéré comme un spam
    Par camcam8782 dans le forum Général Conception Web
    Réponses: 1
    Dernier message: 16/08/2010, 21h31
  3. mon pc est infecté par un virus
    Par wmarniro dans le forum Sécurité
    Réponses: 8
    Dernier message: 18/02/2008, 19h19
  4. Mon programme est considéré comme un trojan -_-'
    Par peijnoob dans le forum Windows
    Réponses: 3
    Dernier message: 21/03/2007, 14h26
  5. [Access] Mon application est détruite !!!
    Par mathias dans le forum Access
    Réponses: 4
    Dernier message: 26/06/2003, 14h14

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