Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cyber-signal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Rémi PAILHAREY
cyber-signal
Commits
7c530755
Commit
7c530755
authored
4 years ago
by
Proc3ssor1
Browse files
Options
Downloads
Patches
Plain Diff
Update cuckoo
parent
b32dc8dd
No related branches found
No related tags found
No related merge requests found
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
main.go
+64
-8
64 additions, 8 deletions
main.go
report.json
+5735
-0
5735 additions, 0 deletions
report.json
struct.go
+3
-1
3 additions, 1 deletion
struct.go
task.json
+41230
-1
41230 additions, 1 deletion
task.json
with
47032 additions
and
10 deletions
main.go
+
64
−
8
View file @
7c530755
...
...
@@ -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
)
}
...
...
This diff is collapsed.
Click to expand it.
report.json
0 → 100644
+
5735
−
0
View file @
7c530755
This diff is collapsed.
Click to expand it.
struct.go
+
3
−
1
View file @
7c530755
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.
Click to expand it.
task.json
+
41230
−
1
View file @
7c530755
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment