File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ //! Load and execute payload from file
2+ //! Author: BlackTechX
3+
4+ use process_ghosting:: { GhostingBuilder , init} ;
5+ use std:: env;
6+
7+ fn main ( ) {
8+ init ( ) ;
9+
10+ println ! ( "[*] From File Example\n " ) ;
11+
12+ // Get file path from command line or use default
13+ let args: Vec < String > = env:: args ( ) . collect ( ) ;
14+ let file_path = if args. len ( ) > 1 {
15+ & args[ 1 ]
16+ } else {
17+ "payload.exe"
18+ } ;
19+
20+ println ! ( "[*] Loading payload from: {}" , file_path) ;
21+
22+ // Use from_file builder method
23+ match GhostingBuilder :: from_file ( file_path) {
24+ Ok ( builder) => {
25+ let result = builder
26+ . x64 ( )
27+ . with_logging ( )
28+ . execute ( ) ;
29+
30+ match result {
31+ Ok ( _) => println ! ( "\n [+] Success!" ) ,
32+ Err ( e) => eprintln ! ( "\n [-] Failed: {}" , e) ,
33+ }
34+ }
35+ Err ( e) => {
36+ eprintln ! ( "[-] Failed to load file: {}" , e) ;
37+ }
38+ }
39+ }
You can’t perform that action at this time.
0 commit comments