Skip to content

Commit

Permalink
(#261) Add CWE ID
Browse files Browse the repository at this point in the history
  • Loading branch information
hahwul committed Nov 18, 2021
1 parent d418cf2 commit 52b9a31
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/model/result.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ type PoC struct {
Param string `json:"param"`
Payload string `json:"payload"`
Evidence string `json:"evidence"`
CWE string `json:"cwe"`
}

// Result is struct for library and cli application
Expand Down
8 changes: 8 additions & 0 deletions pkg/scanning/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,7 @@ func Scan(target string, options model.Options, sid string) (model.Result, error
Param: "",
Payload: "",
Evidence: "",
CWE: "CWE-79",
}
if showV {
if options.Format == "json" {
Expand Down Expand Up @@ -708,6 +709,7 @@ func Scan(target string, options model.Options, sid string) (model.Result, error
Param: v["param"],
Payload: "",
Evidence: "",
CWE: "CWE-79",
}
body, err := k.GetBody()
if err == nil {
Expand Down Expand Up @@ -747,6 +749,7 @@ func Scan(target string, options model.Options, sid string) (model.Result, error
Param: v["param"],
Payload: "",
Evidence: "",
CWE: "CWE-79",
}
body, err := k.GetBody()
if err == nil {
Expand Down Expand Up @@ -774,6 +777,7 @@ func Scan(target string, options model.Options, sid string) (model.Result, error
Param: v["param"],
Payload: v["payload"],
Evidence: code,
CWE: "CWE-79",
}
body, err := k.GetBody()
if err == nil {
Expand Down Expand Up @@ -818,6 +822,7 @@ func Scan(target string, options model.Options, sid string) (model.Result, error
Param: v["param"],
Payload: v["payload"],
Evidence: code,
CWE: "CWE-83",
}
body, err := k.GetBody()
if err == nil {
Expand Down Expand Up @@ -859,6 +864,7 @@ func Scan(target string, options model.Options, sid string) (model.Result, error
Param: v["param"],
Payload: v["payload"],
Evidence: code,
CWE: "CWE-83",
}
body, err := k.GetBody()
if err == nil {
Expand Down Expand Up @@ -901,6 +907,7 @@ func Scan(target string, options model.Options, sid string) (model.Result, error
Param: v["param"],
Payload: v["payload"],
Evidence: code,
CWE: "CWE-79",
}
body, err := k.GetBody()
if err == nil {
Expand Down Expand Up @@ -942,6 +949,7 @@ func Scan(target string, options model.Options, sid string) (model.Result, error
Param: v["param"],
Payload: v["payload"],
Evidence: code,
CWE: "CWE-79",
}
body, err := k.GetBody()
if err == nil {
Expand Down
5 changes: 5 additions & 0 deletions pkg/scanning/sendReq.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func SendReq(req *http.Request, payload string, options model.Options) (string,
Param: "",
Payload: payload,
Evidence: "",
CWE: "CWE-601",
}
if showG {
if options.Format == "json" {
Expand Down Expand Up @@ -86,6 +87,7 @@ func SendReq(req *http.Request, payload string, options model.Options) (string,
Param: "",
Payload: payload,
Evidence: "",
CWE: "CWE-93",
}
body, err := req.GetBody()
if err == nil {
Expand Down Expand Up @@ -140,6 +142,7 @@ func SendReq(req *http.Request, payload string, options model.Options) (string,
Param: "",
Payload: payload,
Evidence: "",
CWE: "CWE-94",
}
body, err := req.GetBody()
if err == nil {
Expand Down Expand Up @@ -186,6 +189,7 @@ func SendReq(req *http.Request, payload string, options model.Options) (string,
Param: "",
Payload: payload,
Evidence: "",
CWE: "",
}
body, err := req.GetBody()
if err == nil {
Expand Down Expand Up @@ -241,6 +245,7 @@ func SendReq(req *http.Request, payload string, options model.Options) (string,
Param: "",
Payload: payload,
Evidence: "",
CWE: "",
}
body, err := req.GetBody()
if err == nil {
Expand Down

0 comments on commit 52b9a31

Please sign in to comment.