-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(wpscan): support enterprise feature #1875
feat(wpscan): support enterprise feature #1875
Conversation
@MaineK00n @shino |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's necessary to export WpCveInfos
, WpCveInfo
, and References
, what do you think?
I think unnecessary exports create unnecessary guarantees for backward compatibility.
:100644 100644 09f7c7e 0000000 M detector/wordpress.go
diff --git a/detector/wordpress.go b/detector/wordpress.go
index 09f7c7e..4086b63 100644
--- a/detector/wordpress.go
+++ b/detector/wordpress.go
@@ -22,20 +22,20 @@ import (
"golang.org/x/xerrors"
)
-// WpCveInfos is for wpscan json
-type WpCveInfos struct {
+// wpCveInfos is for wpscan json
+type wpCveInfos struct {
ReleaseDate string `json:"release_date"`
ChangelogURL string `json:"changelog_url"`
// Status string `json:"status"`
LatestVersion string `json:"latest_version"`
LastUpdated string `json:"last_updated"`
// Popular bool `json:"popular"`
- Vulnerabilities []WpCveInfo `json:"vulnerabilities"`
+ Vulnerabilities []wpCveInfo `json:"vulnerabilities"`
Error string `json:"error"`
}
-// WpCveInfo is for wpscan json
-type WpCveInfo struct {
+// wpCveInfo is for wpscan json
+type wpCveInfo struct {
ID string `json:"id"`
Title string `json:"title"`
CreatedAt time.Time `json:"created_at"`
@@ -44,7 +44,7 @@ type WpCveInfo struct {
Description *string `json:"description"` // Enterprise only
Poc *string `json:"poc"` // Enterprise only
VulnType string `json:"vuln_type"`
- References References `json:"references"`
+ References references `json:"references"`
Cvss *Cvss `json:"cvss"` // Enterprise only
Verified bool `json:"verified"`
FixedIn *string `json:"fixed_in"`
@@ -52,8 +52,8 @@ type WpCveInfo struct {
Closed *Closed `json:"closed"`
}
-// References is for wpscan json
-type References struct {
+// references is for wpscan json
+type references struct {
URL []string `json:"url"`
Cve []string `json:"cve"`
YouTube []string `json:"youtube,omitempty"`
Co-authored-by: MaineK00n <mainek00n.1229@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MaineK00n @shino
Based on your comments, I have made two corrections. Please check them.
・Added exploitdb
・Changed some structures to unexported.
Co-authored-by: MaineK00n <mainek00n.1229@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great contribution! Thanks a lot!!
…)" This reverts commit 50580f6.
What did you implement:
There are two versions of wpscan:
・Free researcher version
・Paid enterprise version
This PR have accommodated the values obtained in the enterprise version.
And changed the structure that is only used for unmarshal of json in wpscan to unexported.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
I ran
make test
in the local environment.And I have also confirmed the passing of the following tests added this time.
$ go test -v -run Test_convertToVinfos === RUN Test_convertToVinfos === RUN Test_convertToVinfos/WordPress_vulnerabilities_Enterprise === RUN Test_convertToVinfos/WordPress_vulnerabilities_Researcher --- PASS: Test_convertToVinfos (0.00s) --- PASS: Test_convertToVinfos/WordPress_vulnerabilities_Enterprise (0.00s) --- PASS: Test_convertToVinfos/WordPress_vulnerabilities_Researcher (0.00s) PASS ok github.com/future-architect/vuls/detector 0.016s
Checklist:
You don't have to satisfy all of the following.
make fmt
make test
Is this ready for review?: Yes
Reference