Skip to content

Commit 08a8c0f

Browse files
committed
fixed port shenanigans, LimePORT is canon
1 parent 8ee2608 commit 08a8c0f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

agent/main.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ func getIP() string {
4646
return localAddr.IP.String()
4747
}
4848

49-
func sendRam(RHOST string, LPORT string) {
49+
func sendRam(RHOST string, LimePORT string) {
5050
fmt.Println("[+] Sending RAM dump.")
5151

5252
// Prepare command
5353

5454
//cmd := exec.Command("/bin/bash", "-c", fmt.Sprintf("memdump -s 409600 > /dev/tcp/%s/%s", RHOST, RPORT)) // Used for tests
5555
//cmd := exec.Command("/bin/bash", "-c", fmt.Sprintf("insmod -s 409600 > /dev/tcp/%s/%s", RHOST, RPORT)) // Used for lime tests
56-
cmd := exec.Command("/bin/bash", "-c", fmt.Sprintf("insmod /var/lib/dkms/lime-forensics/1.9.1-3/6.0.6-76060006-generic/x86_64/module/lime.ko \"path=tcp:%s format=lime\"", LPORT)) // Used for lime tests
56+
cmd := exec.Command("/bin/bash", "-c", fmt.Sprintf("insmod /var/lib/dkms/lime-forensics/1.9.1-3/6.0.6-76060006-generic/x86_64/module/lime.ko \"path=tcp:%s format=lime\"", LimePORT)) // Used for lime tests
5757
// cmd := exec.Command("/bin/bash", "-c", fmt.Sprintf("memdump > /dev/tcp/%s/%s", RHOST, RPORT)) // Used in production
5858

5959
// Execute command
@@ -66,7 +66,7 @@ func sendRam(RHOST string, LPORT string) {
6666
exec.Command("/bin/bash", "-c", "rmmod lime").Run()
6767
}
6868

69-
func handleRequest(conn net.Conn, RHOST string, LPORT string) {
69+
func handleRequest(conn net.Conn, RHOST string, LimePORT string) {
7070
// incoming request
7171
buffer := make([]byte, 1024)
7272
read_len, err := conn.Read(buffer)
@@ -89,7 +89,7 @@ func handleRequest(conn net.Conn, RHOST string, LPORT string) {
8989
} else {
9090
conn.Write([]byte("OK"))
9191
fmt.Println("[+] RAM dump requested")
92-
sendRam(RHOST, LPORT)
92+
sendRam(RHOST, LimePORT)
9393
}
9494

9595
// close conn
@@ -163,7 +163,7 @@ func startServer(LPORT string, RHOST string, RPORT string, LimePORT string) {
163163
log.Fatal(err)
164164
os.Exit(1)
165165
}
166-
go handleRequest(conn, RHOST, LPORT)
166+
go handleRequest(conn, RHOST, LimePORT)
167167
}
168168
}
169169

0 commit comments

Comments
 (0)