Skip to content

Commit

Permalink
MS17010+
Browse files Browse the repository at this point in the history
  • Loading branch information
qi4L committed Aug 8, 2024
1 parent a1b1d7a commit 128c3eb
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
with:
distribution: goreleaser
version: latest
args: "release --clean --debug -f .github/conf/.goreleaser.yml"
args: "release --clean -f .github/conf/.goreleaser.yml"
workdir: .
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80 changes: 68 additions & 12 deletions core/pocScan/lib/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ import (
"Qscan-G/core/pocScan/info"
"Qscan-G/core/slog"
"Qscan-G/lib/color"
"Qscan-G/lib/misc"
"crypto/md5"
"fmt"
"github.com/google/cel-go/cel"
colorR "github.com/gookit/color"
"github.com/lcvvvv/stdio/chinese"
"math/rand"
"net/http"
"net/url"
"regexp"
"strconv"
"strings"
"sync"
"time"
Expand All @@ -36,10 +39,24 @@ func CheckMultiPoc(req *http.Request, pocs []*Poc, workers int) {
for task := range tasks {
isVul, _, name := executePoc(task.Req, task.Poc)
if isVul {
red := colorR.BgRed.Render
format := "%-30v %-35v %s"
printStr := fmt.Sprintf(format, task.Req.URL, red("PocSuccess"), color.StrRandomColor(task.Poc.Name+","+name))
printStr := fmt.Sprintf("%-30v %-35v %s", task.Req.URL, colorR.BgRed.Render("PocSuccess"), color.StrRandomColor(task.Poc.Name+","+name))
slog.Println(slog.DATA, printStr)
m := make(map[string]string)
sourceMap := misc.CloneMap(m)
if cw := app.Setting.OutputCSV; cw != nil {
sourceMap["URL"] = task.Req.URL.String()
sourceMap["Keyword"] = "PocSuccess"
sourceMap["POC"] = task.Poc.Name + "," + name
delete(sourceMap, "Header")
delete(sourceMap, "Cert")
delete(sourceMap, "Response")
delete(sourceMap, "Body")
sourceMap["Digest"] = strconv.Quote(sourceMap["Digest"])
for key, value := range sourceMap {
sourceMap[key] = chinese.ToUTF8(value)
}
cw.Push(sourceMap)
}
}
wg.Done()
}
Expand Down Expand Up @@ -365,17 +382,43 @@ func clusterpoc(oReq *http.Request, p *Poc, variableMap map[string]interface{},
format := "%-30v %-35v %s"
printStr := fmt.Sprintf(format, req.Url.Scheme, red("PocSuccess"), color.StrRandomColor(req.Url.Host+","+req.Url.Path+","+p.Name))
slog.Println(slog.DATA, printStr)
//ret := fmt.Sprintf("└ PocScan, %s://%s%s, %s", req.Url.Scheme, req.Url.Host, req.Url.Path, p.Name)
//ret1 := strings.Split(ret, ",")
//color.StrRandomColor(ret1)
m := make(map[string]string)
sourceMap := misc.CloneMap(m)
if cw := app.Setting.OutputCSV; cw != nil {
sourceMap["URL"] = req.Url.Scheme
sourceMap["Keyword"] = "PocSuccess"
sourceMap["POC"] = req.Url.Host + "," + req.Url.Path + "," + p.Name
delete(sourceMap, "Header")
delete(sourceMap, "Cert")
delete(sourceMap, "Response")
delete(sourceMap, "Body")
sourceMap["Digest"] = strconv.Quote(sourceMap["Digest"])
for key, value := range sourceMap {
sourceMap[key] = chinese.ToUTF8(value)
}
cw.Push(sourceMap)
}
} else {
red := colorR.BgRed.Render
format := "%-30v %-35v %s %v"
printStr := fmt.Sprintf(format, req.Url.Scheme, red("PocSuccess"), color.StrRandomColor(req.Url.Host+","+req.Url.Path+","+p.Name+","), tmpMap)
slog.Println(slog.DATA, printStr)
//ret := fmt.Sprintf("└ PocScan, %s://%s%s, %s, %v", req.Url.Scheme, req.Url.Host, req.Url.Path, p.Name, tmpMap)
//ret1 := strings.Split(ret, ",")
//color.StrRandomColor(ret1)
m := make(map[string]string)
sourceMap := misc.CloneMap(m)
if cw := app.Setting.OutputCSV; cw != nil {
sourceMap["URL"] = req.Url.Scheme
sourceMap["Keyword"] = "PocSuccess"
sourceMap["POC"] = req.Url.Host + "," + req.Url.Path + "," + p.Name
delete(sourceMap, "Header")
delete(sourceMap, "Cert")
delete(sourceMap, "Response")
delete(sourceMap, "Body")
sourceMap["Digest"] = strconv.Quote(sourceMap["Digest"])
for key, value := range sourceMap {
sourceMap[key] = chinese.ToUTF8(value)
}
cw.Push(sourceMap)
}
}
continue
}
Expand All @@ -385,9 +428,22 @@ func clusterpoc(oReq *http.Request, p *Poc, variableMap map[string]interface{},
format := "%-30v %-35v %s %v"
printStr := fmt.Sprintf(format, req.Url.Scheme, red("PocSuccess"), color.StrRandomColor(req.Url.Host+","+req.Url.Path+","+p.Name+","), tmpMap)
slog.Println(slog.DATA, printStr)
//ret := fmt.Sprintf("└ PocScan, %s://%s%s, %s, %v", req.Url.Scheme, req.Url.Host, req.Url.Path, p.Name, strMap)
//ret1 := strings.Split(ret, ",")
//color.StrRandomColor(ret1)
m := make(map[string]string)
sourceMap := misc.CloneMap(m)
if cw := app.Setting.OutputCSV; cw != nil {
sourceMap["URL"] = req.Url.Scheme
sourceMap["Keyword"] = "PocSuccess"
sourceMap["POC"] = req.Url.Host + "," + req.Url.Path + "," + p.Name
delete(sourceMap, "Header")
delete(sourceMap, "Cert")
delete(sourceMap, "Response")
delete(sourceMap, "Body")
sourceMap["Digest"] = strconv.Quote(sourceMap["Digest"])
for key, value := range sourceMap {
sourceMap[key] = chinese.ToUTF8(value)
}
cw.Push(sourceMap)
}
//防止后续继续打印poc成功信息
return false, nil
}
Expand Down
29 changes: 25 additions & 4 deletions core/pocScan/ms17010.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@ package pocScan
import (
"Qscan-G/app"
"Qscan-G/core/pocScan/lib"
"Qscan-G/core/slog"
"Qscan-G/lib/color"
"Qscan-G/lib/misc"
"crypto/aes"
"crypto/cipher"
"encoding/base64"
"encoding/binary"
"encoding/hex"
"errors"
"fmt"
colorR "github.com/gookit/color"
"github.com/lcvvvv/stdio/chinese"
"strconv"
"strings"
"time"
)
Expand All @@ -32,8 +38,8 @@ var key = "0123456789abcdef"
func MS17010(info *app.HostInfo) error {
err := MS17010Scan(info)
if err != nil {
errlog := fmt.Sprintf("[-] Ms17010 %v %v", info.Host, err)
fmt.Println(errlog)
//errlog := fmt.Sprintf("[-] Ms17010 %v %v", info.Host, err)
//fmt.Println(errlog)
}
return err
}
Expand Down Expand Up @@ -133,8 +139,23 @@ func MS17010Scan(info *app.HostInfo) error {
//fmt.Printf("%s\tMS17-010\t(%s)\n", ip, os)
//if runtime.GOOS=="windows" {fmt.Printf("%s\tMS17-010\t(%s)\n", ip, os)
//} else{fmt.Printf("\033[33m%s\tMS17-010\t(%s)\033[0m\n", ip, os)}
result := fmt.Sprintf("[+] MS17-010 %s\t(%s)", ip, os)
fmt.Println(result)
printStr := fmt.Sprintf("%-30v %-35v %s", ip+":445", colorR.BgRed.Render("MS17010Success"), color.StrRandomColor(os))
slog.Println(slog.DATA, printStr)
m := make(map[string]string)
sourceMap := misc.CloneMap(m)
if cw := app.Setting.OutputCSV; cw != nil {
sourceMap["URL"] = ip + ":445"
sourceMap["Keyword"] = "存在"
delete(sourceMap, "Header")
delete(sourceMap, "Cert")
delete(sourceMap, "Response")
delete(sourceMap, "Body")
sourceMap["Digest"] = strconv.Quote(sourceMap["Digest"])
for key, value := range sourceMap {
sourceMap[key] = chinese.ToUTF8(value)
}
cw.Push(sourceMap)
}
defer func() {
//if common.SC != "" {
// MS17010EXP(info)
Expand Down

0 comments on commit 128c3eb

Please sign in to comment.