1
0

Do not produce errors for kernel exploit default test

This commit is contained in:
dump_stack() 2018-11-23 09:32:40 +00:00
parent a0c9a8f8e6
commit 44aa01856f

7
pew.go
View File

@ -209,15 +209,16 @@ func whatever(swg *sizedwaitgroup.SizedWaitGroup, ka config.Artifact,
remoteTest := fmt.Sprintf("/tmp/test_%d", rand.Int()) remoteTest := fmt.Sprintf("/tmp/test_%d", rand.Int())
err = q.CopyFile("user", testPath, remoteTest) err = q.CopyFile("user", testPath, remoteTest)
if err != nil { if err != nil {
log.Println("copy file err", err)
// we should not exit because of testing 'insmod' part
// for kernel module
if ka.Type == config.KernelExploit { if ka.Type == config.KernelExploit {
log.Println("Use `echo touch FILE | exploit` for test") log.Println("Use `echo touch FILE | exploit` for test")
q.Command("user", q.Command("user",
"echo -e '#!/bin/sh\necho touch $2 | $1' "+ "echo -e '#!/bin/sh\necho touch $2 | $1' "+
"> "+remoteTest+ "> "+remoteTest+
" && chmod +x "+remoteTest) " && chmod +x "+remoteTest)
} else {
log.Println("copy file err", err)
// we should not exit because of testing 'insmod' part
// for kernel module
} }
} }