1
0

Move gdb listen address to params

This commit is contained in:
dump_stack() 2018-11-25 14:53:56 +00:00
parent b6dc7e892f
commit 804e0b4879
2 changed files with 6 additions and 4 deletions

View File

@ -81,7 +81,7 @@ func interactive(q *qemu.QemuSystem) (err error) {
} }
} }
func debugHandler(kcfg config.KernelConfig, workPath string, kernRegex string, func debugHandler(kcfg config.KernelConfig, workPath, kernRegex, gdb string,
dockerTimeout time.Duration) (err error) { dockerTimeout time.Duration) (err error) {
ka, err := config.ReadArtifactConfig(workPath + "/.out-of-tree.toml") ka, err := config.ReadArtifactConfig(workPath + "/.out-of-tree.toml")
@ -103,8 +103,7 @@ func debugHandler(kcfg config.KernelConfig, workPath string, kernRegex string,
if err != nil { if err != nil {
return return
} }
gdb := "tcp::1234" // TODO param q.Debug(gdb)
q.Debug(gdb) // TODO param
coloredGdbAddress := aurora.BgGreen(aurora.Black(gdb)) coloredGdbAddress := aurora.BgGreen(aurora.Black(gdb))
fmt.Printf("[*] gdb runned on %s\n", coloredGdbAddress) fmt.Printf("[*] gdb runned on %s\n", coloredGdbAddress)

View File

@ -67,6 +67,8 @@ func main() {
debugCommand := app.Command("debug", "Kernel debug environment") debugCommand := app.Command("debug", "Kernel debug environment")
debugCommandFlag := debugCommand.Flag("kernel", "Regex (first match)") debugCommandFlag := debugCommand.Flag("kernel", "Regex (first match)")
debugKernel := debugCommandFlag.Required().String() debugKernel := debugCommandFlag.Required().String()
debugFlagGDB := debugCommand.Flag("gdb", "Set gdb listen address")
debugGDB := debugFlagGDB.Default("tcp::1234").String()
// Check for required commands // Check for required commands
for _, cmd := range []string{"timeout", "docker", "qemu"} { for _, cmd := range []string{"timeout", "docker", "qemu"} {
@ -94,7 +96,8 @@ func main() {
case genExploitCommand.FullCommand(): case genExploitCommand.FullCommand():
err = genConfig(config.KernelExploit) err = genConfig(config.KernelExploit)
case debugCommand.FullCommand(): case debugCommand.FullCommand():
err = debugHandler(kcfg, *path, *debugKernel, *dockerTimeout) err = debugHandler(kcfg, *path, *debugKernel, *debugGDB,
*dockerTimeout)
} }
if err != nil { if err != nil {