Skip to content

mals执行报错 #68

@h3zh1

Description

@h3zh1
  1. mal refresh后插件执行报错
    插件代码位于mal-community
local function run_demo()
    local session = active()
    local arch = session.Os.Arch
    print("test demo")

end

local cmd_demo = command("democmd", run_demo, "demo cmd", "T1136.001")
opsec("democmd", 8.0)

tui 对应输入输出:

IOM> use 08d6c05a21512a79a1dfeb9d2a8f262f
🔥[*] os: windows, arch: x64, process: 49132 malefic.exe, pipeline: https
🔥[*] 76 modules, 131 available cmds, 0 addons
♨️[i] Active session malefic (08d6c05a21512a79a1dfeb9d2a8f262f), group: default
default [08d6c05a]> democmd
default [08d6c05a]> 
test demo
default [08d6c05a]> mal refresh
♨️[i] Removed external plugin: community-elevate
♨️[i] Loaded lua plugin: community-elevate, register 1 commands
🔥[*] load mal: community-elevate successfully
🔥[*] Successfully refreshed all mal plugins
default [08d6c05a]> democmd
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x58 pc=0xf77f28]

goroutine 158 [running]:
github.com/yuin/gopher-lua.(*LState).PCall(0xc000ec0f00, 0x0, 0xc001ae7000?, 0x0)
        C:/Users/xxx/go/pkg/mod/github.com/yuin/[email protected]/state.go:2031 +0x68
github.com/chainreactors/malice-network/client/plugin.(*LuaPlugin).RegisterLuaFunction.func10.1.1()
        D:/path/to/malice-network/client/plugin/lua.go:363 +0x849
created by github.com/chainreactors/malice-network/client/plugin.(*LuaPlugin).RegisterLuaFunction.func10.1
        D:/path/to/malice-network/client/plugin/lua.go:302 +0x12c
exit status 2

截图如下:
Image

  1. 注册命令失败,启动后命令注册失败,表现为无补全、不可执行、无help信息
    复现执行go run ./client xxxx.auth即可
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions