Skip to content

Just trigger one command and get its result by HMACed UDP

License

Notifications You must be signed in to change notification settings

fumiama/command-trigger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

command-trigger

Just trigger one command and get its result by HMACed UDP

usage

  -D    debug-level log output
  -d int
        max valid time diff (default 5)
  -e string
        execute this command on triggered
  -g    generate a random key and exit
  -h    display this help
  -i int
        min execute interval (default 10)
  -k string
        64 bytes hmac key in base16384 format
  -m string
        send additional message
  -t string
        send/recv trigger to this addr:port
  -w uint
        max wait seconds for reply of executer (default 16)

example

Windows

  • trigger
go run main.go main_windows.go -t 127.0.0.1:8000 -k "抿淀檆健" -m "hello world"
[INFO] send trigger to 127.0.0.1:8000 : hello world
[INFO] 127.0.0.1:8000 reply: 123
  • executer
go run main.go main_windows.go -t 127.0.0.1:8000 -k "抿淀檆健" -e "cmd /c echo 123" 
[INFO] 127.0.0.1:56626 triggered with message: hello world
[INFO] get result: 123

unix

  • trigger
go run main.go -t 127.0.0.1:8000 -k "抿淀檆健" -m "hello world"
[INFO] send trigger to 127.0.0.1:8000 : hello world
[INFO] 127.0.0.1:8000 reply: 123
  • executer
go run main.go -t 127.0.0.1:8000 -k "抿淀檆健" -e "cmd /c echo 123" 
[INFO] 127.0.0.1:56626 triggered with message: hello world
[INFO] get result: 123

About

Just trigger one command and get its result by HMACed UDP

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages