package main import ( "syscall" ) func abort(funcname string, err string) { panic(funcname + " failed: "+err) } func print_version(v uint32) { major := byte(v) minor := uint8(v >> 8) build :=
package osapi import ( "syscall" "unsafe" "github.com/lxn/win" ) const ( DESKTOP_SWITCHDESKTOP = 0x0100 // The access to the desktop ) // get desktop locked status func ScreenIsLocked() bool { //
package osapi import ( "syscall" "unsafe" "github.com/lxn/win" ) const ( DESKTOP_SWITCHDESKTOP = 0x0100 // The access to the desktop ) // get desktop locked status func ScreenIsLocked() bool {
锁屏 func lockScreen() { var args []string args = append(args, "user32.dll", "LockWorkStation") _, err := common.StartProcess("rundll32.exe", args...) if err != nil { common.Log
Windows的锁屏图片都很好看,很适合做桌面壁纸。Win11实际上有将Windows聚焦图片作为桌面壁纸的选项,但是可能是由于网络原因经常不能自动更新,于是就写了一个将Windows聚焦图片设为壁纸的小程序。又因为官方的API返回的json数据内容太多了,就精简了一下,写了这个API。API的使用说明和示例如下。API文档此API接收GET请求,并返回以下格式的json数据
前言 在学Go相关的免杀,来提高木马的存活性,看到一些有意思的东西记下来 加载DLL syscall.NewLazyDLLsyscall.LoadLibrarysyscall.MustLoadDLL NewLazyDLL*LazyDLLLoadLibrary 创建函数 syscall.NewLazyDLL package mainimport ( "syscall" "unsafe")func
import{ "os/exec" "path/filepath" } //文件完整路径 filePath, _ := exec.LookPath(os.Args[0]) //文件相对路径 dirPath := filepath.Dir(osPath) //文件名 fileName := filepath.Base(osPath) 转载于:https://my
func getMacAddrs() (macAddrs []string) { netInterfaces, err := net.Interfaces() if err != nil { fmt.Printf("fail to get net interfaces: %v", err) return macAddrs } for _, netInterface :=
package main import ( "fmt" "net" "log" "flag" "math" "github.com/google/gopacket/pcap" "github.com/google/gopacket/layers" "github.com/google/gopacket" manuf "github.com/timest/gomanuf"
go获取机器的mac地址和ip - 云+社区 - 腾讯云 https://cloud.tencent.com/developer/article/1122940 开发中常需要获取机器的mac地址或者ip,本文通过go获取机器上所有mac地址和ip,详细代码如下: package main import ( "fmt" "net" ) func getMacAddrs() (macAddrs