Latest Posts

2011-01-25

Create & Upload Shell via MyBB Admin CP [Video]

Create & Upload Shell via MyBB Admin CP






 Tested On: MyBB v1.6.1

Download Video
read more...

2010-12-30

Anti WM_QUIT Message di Delphi 7

1. Copy unit Forms.pas milik Delphi yang berada di dalam folder [DRIVE]:\Program Files\Borland\Delphi7\Source\ Vcl, kemudian Paste ke dalam folder Project anda.

2. Edit function TApplication.ProcessMessage(var Msg: TMsg): Boolean; yang ada di baris ke 6856.

function TApplication.ProcessMessage(var Msg: TMsg): Boolean;
var
  Handled: Boolean;
begin
  Result := False;
  if PeekMessage(Msg, 0, 0, 0, PM_REMOVE) then
  begin
    Result := True;
    if Msg.Message <> WM_QUIT then
    begin
      Handled := False;
      if Assigned(FOnMessage) then FOnMessage(Msg, Handled);
      if not IsHintMsg(Msg) and not Handled and not IsMDIMsg(Msg) and
        not IsKeyMsg(Msg) and not IsDlgMsg(Msg) then
      begin
        TranslateMessage(Msg);
        DispatchMessage(Msg);
      end;
    end
    else
      FTerminate := False; { dari True menjadi False }
  end;
end;

3. Masih bersama Forms.pas Buat atau Tambahkan Private Message baru sebagai pengganti WM_QUIT pada procedure TApplication.WndProc(var Message: TMessage);

Contoh nya seperti di bawah ini:

6532: with Message do
6533:  case Msg of
6534:    WM_SYSCOMMAND:
[.....]
6669:    WM_NULL:
6670:      CheckSynchronize;
6671:    WM_USER+666: { Ini Private Message Aplikasi Anda }
6672:      FTerminate := True;
6673:  else
6674:    Default;
6675:  end;


4. Dengan demikian perintah Application.Terminate sudah tidak bisa digunakan lagi, oleh karena itu anda perlu membuat procedure sendiri untuk menutup aplikasi anda.

Contoh:

procedure TForm1.CloseMe;
begin
  PostMessage(Application.Handle, WM_USER+666, 0, 0);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  CloseMe;
end;


Sekian.
read more...

Random ClassName Form (WindowClass) di Delphi 7

Random ClassName Form (WindowClass) di Delphi 7

Saat ini sudah banyak Virus atau Worm buatan lokal (anak indonesia) yang menggunakan tehnik pertahanan diri dengan cara membunuh aplikasi-aplikasi yang dianggap berpotensi untuk menghentikan proses penyebarannya, salah satunya yaitu dengan cara melakukan mass kill terhadap semua proses yang dibuat dengan Delphi.

Cara itu bisa dilakukan karena, secara default aplikasi VCL yang dibuat dengan Delphi akan diberikan classname atau nama WindowClass yang bersifat statik(?) dengan nama “TApplication” sebagai Application ClassName dan juga “TPUtilWindow” sebagai Util Window ClassName (penjelasan lebih lanjut silahkan googling xixixi).

Berikut ini Penulis akan memberikan beberapa tip dan trik untuk menghindari mass kill yang dilakukan oleh virus/worm pada kasus di atas.

Sebelum memulai, Tutup terlebih dahulu Delphi 7 nya kalau lagi aktif.

A.     Random ClassName Application (TApplication)

1.     Buka text editor kesayangan anda (cth: notepad) lalu copy dan paste kode berikut ini dan save ke folder project anda dengan nama RandomClass.pas

{ BEGIN }
unit RandomClass;

interface

uses
  Windows;

function RandomStr(Len:integer): String;

implementation

function RandomStr(Len:integer): String;
var
  chars: string;
begin
  Randomize;
  chars := '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
  Result := '';
  Len := Random(len);
  if Len < 5 then Len := Len + 5;
  repeat
    Result := Result + chars[Random(Length(chars)) + 1];
  until (Length(Result) = Len);
end;

end.
{ END }


2.     Copy unit Forms.pas milik Delphi yang berada di dalam folder [DRIVE]:\Program Files\Borland\Delphi7\Source\Vcl, kemudian Paste ke dalam folder Project anda.

3.     Buka Forms.pas tersebut dengan text editor lalu tambahkan unit RandomClass pada uses nya.

21: {$IFDEF MSWINDOWS}
22: uses Messages, Windows, SysUtils, Classes, Graphics, Menus, Controls, Imm,
23:  ActnList, MultiMon, HelpIntfs, RandomClass;
24: {$ENDIF}

4.     Masih pada Forms.pas Tambahkan kode berikut ini di bawah baris ke 6315 yang ada pada procedure TApplication.CreateHandle;

Kode: WindowClass.lpszClassName := PChar(RandomStr(10));

Sehingga menjadi seperti berikut ini:

6315: {$ENDIF}
6316:    WindowClass.lpszClassName := PChar(RandomStr(10));
6317:    WindowClass.lpfnWndProc := @DefWindowProc;


B.     Random ClassName Util Window (TPUtilWindow)

1.     Copy unit Classes.pas milik Delphi yang berada di dalam folder [DRIVE]:\Program Files\Borland\Delphi7\Source\ Rtl\Common, kemudian Paste ke dalam folder Project anda.

2.     Buka Classes.pas tersebut dengan text editor lalu tambahkan unit RandomClass pada uses nya.

27: {$IFDEF MSWINDOWS}
28: uses Windows, Messages, SysUtils, Variants, TypInfo, ActiveX, RandomClass;
29: {$ENDIF}

3.     Masih pada Classes.pas Tambahkan kode berikut ini di bawah baris ke 11042 yang ada pada function AllocateHWnd(Method: TWndMethod): HWND;

Kode: UtilWindowClass.lpszClassName := PChar(RandomStr(10));

Sehingga menjadi seperti berikut ini:

11042: {$ENDIF}
11043:  UtilWindowClass.lpszClassName := PChar(RandomStr(10));
11044:  ClassRegistered := GetClassInfo(HInstance, UtilWindowClass.lpszClassName,
11045:    TempClass);


C.     Random ClassName Form

1.     Copy unit Controls.pas milik Delphi yang berada di dalam folder [DRIVE]:\Program Files\Borland\Delphi7\Source\ Vcl, kemudian Paste ke dalam folder Project anda.

2.     Buka Controls.pas tersebut dengan text editor lalu tambahkan unit RandomClass pada uses nya.

26: {$IFDEF MSWINDOWS}
27: Messages, Windows, MultiMon, Classes, SysUtils, Graphics, Menus, CommCtrl,
28:   Imm, ImgList, ActnList, RandomClass;
29: {$ENDIF}

3.     Masih pada Controls.pas Edit kode StrPCopy(WinClassName, ClassName); yang ada pada baris ke 5973 di dalam procedure TWinControl.CreateParams(var Params: TCreateParams);

Kode: StrPCopy(WinClassName, RandomStr(10));

Sehingga menjadi seperti berikut ini:

5968: WindowClass.style := CS_VREDRAW + CS_HREDRAW + CS_DBLCLKS;
5969: WindowClass.lpfnWndProc := @DefWindowProc;
5970: WindowClass.hCursor := LoadCursor(0, IDC_ARROW);
5971: WindowClass.hbrBackground := 0;
5972: WindowClass.hInstance := HInstance;
5973: StrPCopy(WinClassName, RandomStr(10));


D.    Random Caption Window/Form

Tambahkan unit RandomClass pada uses Form1 (disesuaikan).

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, RandomClass;

Kemudian tambahkan kode berikut ini pada Event FormCreate.

procedure TForm1.FormCreate(Sender: TObject);
begin
  Application.Title := RandomStr(30);
  Caption := RandomStr(50);
end;

{ sekian }

Jalankan Delphi 7 kemudian buka Project anda.
Compile Project dengan menekan Tombol CTRL+F9 (2x) lalu F9 (Run).

Bagi yang hanya ingin mengganti TApplication atau TPUtilWindow tanpa menggunakan unit RandomClass, hanya perlu mengedit string pada baris-baris berikut ini:

TApplication -> Forms.pas -> Baris ke 6211: lpszClassName: 'TApplication');
TPUtilWindow -> Classes.pas -> Baris ke 11032: lpszClassName: 'TPUtilWindow');

Semoga Tip Trik ini bisa berguna bagi anda terutama bagi mereka yang suka membuat antivirus maupun cleaner dengan Delphi.

Selamat Mencoba :)
read more...

2010-12-14

PCMAV 4.5 Ragnarok3 Self Defense Test

Berbeda dengan versi² sebelum nya,
PCMAV 4.5 Ragnarok3 kali ini hadir dengan fitur "self defense",
seperti yang bisa dibaca di README nya:

*****

PC Media Antivirus (PCMAV) 4.5 - Ragnarok3
Copyright (c) 2006-2010 Majalah PC Media
Pinpoint Publications Group

-------------------------
APA YANG BARU?/CHANGE-LOG
-------------------------
....
e. ADDED! Fitur self protection agar proses PCMAV tidak mudah dimatikan
   terutama oleh virus lokal.
....

*****










Dengan ada nya fitur ini tentunya akan memberikan nilai tambah bagi PCMAV sebagai
antivirus lokal indonesia yang paling banyak digunakan. (menurut penulis)

Berikut ini adalah aplikasi sederhana yang sengaja penulis buat
menggunakan bahasa pemrogramman Delphi 7,
untuk mencoba "self defense" dari PCMAV 4.5 Ragnarok3.










Silahkan didownload dan dicoba sendiri:
DOWNLOAD

Note:
*) Matikan sementara Guard Avira sebelum mencoba nya.
read more...

2010-12-12

Stop dan Kill ANSAV 2 Guard dengan Delphi

Langsung saja ...

{ .....Begin }

uses WinSvc, TlHelp32;

function StopService(sMachine,sService:string):boolean;
var
  SCHMan, SCHSrv: SC_Handle;
  SrvStatus: TServiceStatus;
  dwCP: DWord;
begin
  SCHMan := OpenSCManager(PChar(sMachine),Nil,SC_MANAGER_CONNECT);
  if (SCHMan > 0) then
  begin
    SCHSrv := OpenService(SCHMan,PChar(sService),SERVICE_STOP or SERVICE_QUERY_STATUS);
    if (SCHSrv > 0) then
      begin
        if (ControlService(SCHSrv,SERVICE_CONTROL_STOP,SrvStatus)) then
          begin
            if (QueryServiceStatus(SCHSrv,SrvStatus)) then
              begin
                while(SERVICE_STOPPED <> SrvStatus.dwCurrentState) do
                  begin
                    Application.ProcessMessages;
                    StopService(sMachine,sService);
                    dwCP := SrvStatus.dwCheckPoint;
                    Sleep(SrvStatus.dwWaitHint);
                    if (not QueryServiceStatus(SCHSrv,SrvStatus)) then break;
                    if(SrvStatus.dwCheckPoint < dwCP)then break;
                  end;
              end;
          end;
        CloseServiceHandle(SCHSrv);
      end;
    CloseServiceHandle(SCHMan);
  end;
  Result := SERVICE_STOPPED = SrvStatus.dwCurrentState;
end;

function KillProcByFileName(FileName:string;ExitCode:integer):integer;
const
  PROCESS_TERMINATE = $0001;
var
  Loop: BOOL;
  FSHnd: THandle;
  FPE32: TProcessEntry32;
begin
  Result := 0;
  FSHnd := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
  FPE32.dwSize := SizeOf(FPE32);
  Loop := Process32First(FSHnd, FPE32);
  while Integer(Loop) <> 0 do
    begin
      if ((UpperCase(ExtractFileName(FPE32.szExeFile)) = UpperCase(FileName)) or
          (UpperCase(FPE32.szExeFile) = UpperCase(FileName))) then
        Result := Integer(TerminateProcess(OpenProcess(PROCESS_TERMINATE,BOOL(0),
                          FPE32.th32ProcessID),ExitCode));
      Loop := Process32Next(FSHnd, FPE32);
    end;
  CloseHandle(FSHnd);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  if StopService('','ANSAVDaemon') then
    if KillProcByFileName('ansavd.exe',1) <> 0 then
      ShowMessage('ANSAV Guard Killed!');
end;

{ .....End }

Atau bisa juga dengan hanya menggunakan fungsi KillProcByFileName(NameFile,ExitCode)
Dengan catatan ExitCode <> 0

{ .....End }

procedure TForm1.Button1Click(Sender: TObject);
begin
  if KillProcByFileName('ansavd.exe',2010) <> 0 then
    ShowMessage('ANSAV Guard Killed!');
end;

{ .....End }

Trik di atas berlaku juga untuk salah satu AntiVirus Turunan dari ANSAV 2,
yaitu: AVI 2 (AntiVirus Info Komputer)

Happy Coding ^^
read more...

2010-11-15

Menghapus Folder autorun.inf buatan SmadAV dengan Delphi

Berikut merupakan salah satu cara menghapus folder autorun.inf buatan SamadAV menggunakan Delphi.

Uses ShellApi;

function HapusFolder(NamaFolder:String):Boolean;
var
 T: TSHFileOpStruct;
begin
  Result := False;
  FillChar(T, SizeOf(T), #0);
  with T do
  begin
    Wnd := 0;
    wFunc := FO_DELETE;
    pFrom := PChar('\\?\' + NamaFolder + #0);
    fFlags := FOF_ALLOWUNDO or FOF_SILENT or FOF_NOCONFIRMATION;
  end;
  if (SHFileOperation(T) = 0) then
    Result := True;
end;

procedure TForm1.Button1Click(Sender: TObject);
var S: String;
begin
  MessageBeep(mb_iconExclamation);
  S := 'Z:\autorun.inf'; { path dari folder autorun.inf }
  if DirectoryExists(S) then
    begin
      if SetFileAttributes(PChar(S),FILE_ATTRIBUTE_NORMAL) then
        begin
        if HapusFolder(S) then
          MessageDlg('SUKSES menghapus folder '+S,mtInformation,[mbOK],0)
        else
          MessageDlg('GAGAL menghapus folder '+S,mtInformation,[mbOK],0);
        end;
    end
  else
    MessageDlg('Folder '+S+' tidak ditemukan!',mtError,[mbOK],0);
end;

Happy Coding ^^

Note:
Only for Educational Purpose!
read more...

2010-09-21

GET & POST with PERL

Introduction

LWP (short for "Library for WWW in Perl") is a popular group of Perl modules for accessing data on the Web. Like most Perl module-distributions, each of LWP's component modules comes with documentation that is a complete reference to its interface. However, there are so many modules in LWP that it's hard to know where to look for information on doing even the simplest things.

Document: http://www.perl.com/pub/2002/08/20/perlandlwp.html


#!/usr/bin/perl -w

# For supporting HTTPS Protocol:
# [root@centos ~]# yum install perl-Net-SSLeay perl-Crypt-SSLeay
# [root@ubuntu ~]# apt-get install libcrypt-ssleay-perl libnet-ssleay-perl

use HTTP::Request;
use HTTP::Cookies;
use LWP::UserAgent;

$get_content = get('http://facebook.com/');

$post_content = post('http://m.facebook.com/login.php',
"email=user@mail.com&pass=password&login=Login");

sub get {
my $url = $_[0];
my $cookie = HTTP::Cookies->new(file => "cookies.log", autosave=>1,);
my $ua = LWP::UserAgent->new(agent => "Mozilla/5.0");
$ua->cookie_jar($cookie);
$ua->timeout(15);
my $req = HTTP::Request->new(GET => $url);
my $res = $ua->request($req);
if ($res->is_error) { print $res->status_line."\n"; }
return $res->content;
}

sub post {
my $url = $_[0];
my $data = $_[1];
my $cookie = HTTP::Cookies->new(file => "cookies.log", autosave=>1,);
my $ua = LWP::UserAgent->new(agent => "Mozilla/5.0");
$ua->cookie_jar($cookie);
$ua->timeout(15);
push @{$ua->requests_redirectable}, 'POST';
my $req = HTTP::Request->new(POST => $url);
$req->content_type('application/x-www-form-urlencoded');
$req->content("$data");
my $res = $ua->request($req);
if ($res->is_error) { print $res->status_line."\n"; }
return $res->content;
}

Happy coding :)
read more...

GET & POST with PHP cURL

Introduction

PHP supports libcurl, a library created by Daniel Stenberg, that allows you to connect and communicate to many different types of servers with many different types of protocols. libcurl currently supports the http, https, ftp, gopher, telnet, dict, file, and ldap protocols. libcurl also supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading (this can also be done with PHP's ftp extension), HTTP form based upload, proxies, cookies, and user+password authentication.

cURL GET Content:

$content = curl_get_content('http://facebook.com/');
print $content;

function curl_get_content($url) {
$ch = curl_init();
$path = dirname(__FILE__).'/';
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_COOKIEJAR, $path."cookie.log");
curl_setopt($ch, CURLOPT_COOKIEFILE, $path."cookie.log");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0");
$html = curl_exec($ch);
curl_close($ch);
return $html;
}

cURL POST Data:

$content = curl_post_content('http://m.facebook.com/login.php',
"email=user@mail.com&pass=password&login=Login");
print $content;

function curl_post_content($url,$data) {
$ch = curl_init();
$path = dirname(__FILE__).'/';
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_COOKIEJAR, $path."cookie.log");
curl_setopt($ch, CURLOPT_COOKIEFILE, $path."cookie.log");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0");
$html = curl_exec($ch);
curl_close($ch);
return $html;
}

Want more?
Document: http://php.net/manual/en/book.curl.php

Have nice coding :)
read more...