mirror of
https://github.com/BishopFox/sliver.git
synced 2026-11-10 01:41:29 -10:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
853a7abf10 |
No files matched your search
@@ -50,9 +50,16 @@ func (n *node) insert(proc *commonpb.Process) {
|
||||
}
|
||||
|
||||
func (n *node) findParent(proc *commonpb.Process) *node {
|
||||
// Empty node
|
||||
if n.Value == nil {
|
||||
return nil
|
||||
}
|
||||
// Skip self when called from reorder
|
||||
// otherwise things might explode, see #1340
|
||||
if n.Value.Pid == proc.Pid {
|
||||
return nil
|
||||
}
|
||||
// Found parent
|
||||
if n.Value.Pid == proc.Ppid {
|
||||
return n
|
||||
}
|
||||
|
||||
@@ -43,17 +43,10 @@ func UUIDFromMAC() string {
|
||||
// {{if .Config.Debug}}
|
||||
log.Printf("Generating host UUID from hardware addresses ...")
|
||||
// {{end}}
|
||||
return zeroGUID.String()
|
||||
interfaces, err := net.Interfaces()
|
||||
if err != nil {
|
||||
// {{if .Config.Debug}}
|
||||
log.Printf("Couldn't list net interfaces, returning zeroGUID: %v\n", err)
|
||||
// {{end}}
|
||||
return zeroGUID.String()
|
||||
}
|
||||
// {{if .Config.Debug}}
|
||||
log.Printf("Got interfaces: %+v\n", interfaces)
|
||||
// {{end}}
|
||||
hardwareAddrs := []string{}
|
||||
for _, iface := range interfaces {
|
||||
if iface.HardwareAddr != nil {
|
||||
@@ -61,31 +54,16 @@ func UUIDFromMAC() string {
|
||||
}
|
||||
}
|
||||
if len(hardwareAddrs) == 0 {
|
||||
// {{if .Config.Debug}}
|
||||
log.Printf("No hardware addresses found (hardwareAddrs empty), returning zeroGUID\n")
|
||||
// {{end}}
|
||||
return zeroGUID.String()
|
||||
}
|
||||
// {{if .Config.Debug}}
|
||||
log.Printf("Hardware addrs: %+v\n", hardwareAddrs)
|
||||
// {{end}}
|
||||
sort.Strings(hardwareAddrs) // Ensure deterministic order
|
||||
digest := sha256.New()
|
||||
for _, addr := range hardwareAddrs {
|
||||
digest.Write([]byte(addr))
|
||||
}
|
||||
// {{if .Config.Debug}}
|
||||
log.Printf("Digest: %+v\n", digest.Sum(nil)[:16])
|
||||
// {{end}}
|
||||
value, err := uuid.FromBytes(digest.Sum(nil)[:16]) // Must be 128-bits
|
||||
if err != nil {
|
||||
// {{if .Config.Debug}}
|
||||
log.Printf("Couldn't generate UUID from hardware addresses, returning zeroGUID: %v\n", err)
|
||||
// {{end}}
|
||||
return zeroGUID.String()
|
||||
}
|
||||
// {{if .Config.Debug}}
|
||||
log.Printf("UUID: %s\n", value.String())
|
||||
// {{end}}
|
||||
return value.String()
|
||||
}
|
||||
@@ -729,9 +729,6 @@ func registerSliver() *sliverpb.Register {
|
||||
}
|
||||
}
|
||||
|
||||
// {{if .Config.Debug}}
|
||||
log.Printf("Generating UUID ...\n")
|
||||
// {{end}}
|
||||
// Retrieve UUID
|
||||
uuid := hostuuid.GetUUID()
|
||||
// {{if .Config.Debug}}
|
||||
|
||||
Reference in new issue
Block a user