Skip to content

Commit

Permalink
加入jenkins未授权访问检测
Browse files Browse the repository at this point in the history
  • Loading branch information
veo committed Aug 8, 2021
1 parent f04105f commit 81c1a0d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/httpx/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,9 @@ retry:
technologies = append(technologies, fmt.Sprintf("fastjson|%s", fastjsonversion))
}
case "Jenkins":
if jenkins.Unauthorized(URL.String()) {
technologies = append(technologies, "exp-jenkins|Unauthorized script")
}
if jenkins.CVE_2018_1000110(URL.String()) {
technologies = append(technologies, "exp-jenkins|CVE_2018_1000110")
}
Expand Down
27 changes: 27 additions & 0 deletions poc/jenkins/Unauthorized.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package jenkins

import (
"fmt"
"github.com/veo/vscan/pkg"
"strings"
)

func Unauthorized(u string) bool {
if req, err := pkg.HttpRequset(u, "GET", "", false, nil); err == nil {
if req.Header.Get("X-Jenkins-Session") != "" {
if req2, err := pkg.HttpRequset(u+"/script", "GET", "", false, nil); err == nil {
if req2.StatusCode == 200 && strings.Contains(req2.Body, "Groovy script") {
fmt.Printf("jenkins-exp-sucess|Unauthorized script|%s\n", u+"/script")
return true
}
}
if req2, err := pkg.HttpRequset(u+"/computer/(master)/scripts", "GET", "", false, nil); err == nil {
if req2.StatusCode == 200 && strings.Contains(req2.Body, "Groovy script") {
fmt.Printf("jenkins-exp-sucess|Unauthorized script|%s\n", u+"/computer/(master)/scripts")
return true
}
}
}
}
return false
}

0 comments on commit 81c1a0d

Please sign in to comment.