Skip to content

Commit 4be6abc

Browse files
committed
remove dockerfile stuff from pwn command
1 parent 2d770b4 commit 4be6abc

File tree

1 file changed

+0
-44
lines changed

1 file changed

+0
-44
lines changed

commands/pwn.go

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -40,40 +40,6 @@ func makeScript(ip string, port int) {
4040
log.Fatalln("error chmoding file:", err)
4141
}
4242

43-
dockerfile := fmt.Sprintf(
44-
"#\n# Dockerfile template made with 🚩 https://github.com/rerrorctf/rctf 🚩\n#\n\n"+
45-
"FROM ubuntu:24.04\n\n"+
46-
"RUN apt update && apt install -y socat\n\n"+
47-
"RUN groupadd --gid 1001 pwn\n\n"+
48-
"RUN useradd --uid 1001 --gid 1001 --home-dir /home/pwn --create-home --shell /sbin/nologin pwn\n\n"+
49-
"WORKDIR /home/pwn\n\n"+
50-
"COPY %s .\n\n"+
51-
"RUN echo \"flag{example}\" > flag.txt\n\n"+
52-
"RUN chmod +x ./%s\n\n"+
53-
"EXPOSE %d\n\n"+
54-
"USER pwn\n\n"+
55-
"CMD [\"socat\", \"tcp-listen:%d,fork,reuseaddr\", \"exec:./%s\"]\n",
56-
binary, binary, port, port, binary)
57-
58-
err = os.WriteFile("Dockerfile", []byte(dockerfile), 0644)
59-
if err != nil {
60-
log.Fatalln("error writing to file:", err)
61-
}
62-
63-
compose := fmt.Sprintf(
64-
"#\n# compose.yml template made with 🚩 https://github.com/rerrorctf/rctf 🚩\n#\n\n"+
65-
"services:\n"+
66-
" task:\n"+
67-
" build: .\n"+
68-
" ports:\n"+
69-
" - %d:%d\n",
70-
port, port)
71-
72-
err = os.WriteFile("compose.yml", []byte(compose), 0644)
73-
if err != nil {
74-
log.Fatalln("error writing to file:", err)
75-
}
76-
7743
fmt.Printf("🐚 "+theme.ColorGray+"ready to pwn:"+theme.ColorReset+" $ ./%s\n", config.PwnScriptName)
7844
}
7945

@@ -92,16 +58,6 @@ func Pwn(args []string) {
9258
log.Fatalf("💥 "+theme.ColorRed+"error"+theme.ColorReset+": \"%s\" already exists!\n", config.PwnScriptName)
9359
}
9460

95-
_, err = os.Stat("./Dockerfile")
96-
if !os.IsNotExist(err) {
97-
log.Fatalf("💥 " + theme.ColorRed + "error" + theme.ColorReset + ": \"Dockerfile\" already exists!\n")
98-
}
99-
100-
_, err = os.Stat("./compose.yml")
101-
if !os.IsNotExist(err) {
102-
log.Fatalf("💥 " + theme.ColorRed + "error" + theme.ColorReset + ": \"Dockerfile\" already exists!\n")
103-
}
104-
10561
var ip string
10662
var port int
10763
util.GetRemoteParams(args, &ip, &port)

0 commit comments

Comments
 (0)