Skip to content
Snippets Groups Projects
Commit 7c530755 authored by Proc3ssor1's avatar Proc3ssor1
Browse files

Update cuckoo

parent b32dc8dd
No related branches found
No related tags found
No related merge requests found
......@@ -10,21 +10,22 @@ import (
"mime/multipart"
"net/http"
"os"
"regexp"
)
var i int
func main() {
mux := http.NewServeMux()
os.Setenv("SHARE_TOKEN", "sharetoken")
// mux := http.NewServeMux()
// os.Setenv("SHARE_TOKEN", "sharetoken")
helloHandler := http.HandlerFunc(hello)
mux.Handle("/hello", validateShareToken(helloHandler))
// helloHandler := http.HandlerFunc(hello)
// mux.Handle("/hello", validateShareToken(helloHandler))
log.Println("Listening on :8091...")
err := http.ListenAndServe(":8091", mux)
log.Fatal(err)
// log.Println("Listening on :8091...")
// err := http.ListenAndServe(":8091", mux)
// log.Fatal(err)
//taskid := sendPostRequestMultipart("http://localhost:8090/tasks/create/file", "/home/jean/Wza.txt")
sendGetSummaryReport(5)
......@@ -135,8 +136,63 @@ func sendGetSummaryReport(taskid int) string {
log.Fatal(err)
}
type StringsResponse struct {
Strings []string `json:"strings"`
}
content, err := ioutil.ReadAll(resp.Body)
fmt.Printf(string(content))
var stringsResponse StringsResponse
err = json.Unmarshal(content, &stringsResponse)
if err != nil {
log.Fatal(err)
}
var expediteur string
var subject string
for _, s := range stringsResponse.Strings {
rExp := regexp.MustCompile(`From:.*<(.*)>`)
rSub := regexp.MustCompile(`Subject: (.*)`)
resExp := rExp.FindStringSubmatch(s)
if len(resExp) != 0 {
expediteur = resExp[1]
}
resSub := rSub.FindStringSubmatch(s)
if len(resSub) != 0 {
subject = resSub[1]
}
}
fmt.Println(expediteur)
fmt.Println(subject)
type TargetResponse struct {
Target struct {
File struct {
Sha1 string `json:"sha1"`
Sha256 string `json:"sha256"`
Urls []string `json:"urls"`
Sha512 string `json:"sha512"`
Md5 string `json:"md5"`
} `json:"file"`
} `json:"target"`
}
var targetResponse TargetResponse
err = json.Unmarshal(content, &targetResponse)
if err != nil {
log.Fatal(err)
}
fmt.Println(targetResponse.Target.File.Sha1)
for _, s := range targetResponse.Target.File.Urls {
fmt.Println(s)
}
// fmt.Printf(string(content))
return string(content)
}
......
report.json 0 → 100644
This diff is collapsed.
package main
type AutoGenerated struct {
Info struct {
Added float64 `json:"added"`
......@@ -227,4 +229,4 @@ type AutoGenerated struct {
} `json:"memdumps"`
} `json:"output"`
} `json:"metadata"`
}
\ No newline at end of file
}
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment