Skip to content

Commit 7c060a6

Browse files
committed
don't bother prompting for ip/port on rctf pwn
1 parent 7b496fa commit 7c060a6

File tree

1 file changed

+2
-23
lines changed

1 file changed

+2
-23
lines changed

util/remote.go

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,18 @@
11
package util
22

33
import (
4-
"bufio"
54
"fmt"
65
"log"
7-
"os"
86
"rctf/theme"
97
"strconv"
108
)
119

1210
func GetRemoteParams(args []string, ip *string, port *int) {
13-
scanner := bufio.NewScanner(os.Stdin)
14-
1511
if len(args) > 0 {
1612
fmt.Printf(theme.ColorGray+"ip: "+theme.ColorYellow+"%s"+theme.ColorReset+"\n", args[0])
1713
*ip = args[0]
1814
} else {
19-
fmt.Print(theme.ColorGray + "enter remote ip (no port): " + theme.ColorReset)
20-
scanner.Scan()
21-
*ip = scanner.Text()
22-
fmt.Printf(theme.ColorReset)
15+
*ip = "127.0.0.1"
2316
}
2417

2518
if len(args) > 1 {
@@ -37,20 +30,6 @@ func GetRemoteParams(args []string, ip *string, port *int) {
3730

3831
*port = p
3932
} else {
40-
fmt.Print(theme.ColorGray + "enter remote port: " + theme.ColorReset)
41-
scanner.Scan()
42-
fmt.Printf(theme.ColorReset)
43-
44-
p, err := strconv.Atoi(scanner.Text())
45-
46-
if err != nil {
47-
log.Fatalln("💥 "+theme.ColorRed+"error"+theme.ColorReset+": reading port", err)
48-
}
49-
50-
if p < 1 || p > 65535 {
51-
log.Fatalf("💥 "+theme.ColorRed+"error"+theme.ColorReset+": invalid port %v\n", port)
52-
}
53-
54-
*port = p
33+
*port = 9001
5534
}
5635
}

0 commit comments

Comments
 (0)