加入手工gc回收,尝试节省无用内存。

-url 支持逗号隔开。
修复一个poc模块bug。
This commit is contained in:
影舞者 2022-07-06 21:42:00 +08:00
parent 6e5642c508
commit 30df6b651f
7 changed files with 26 additions and 16 deletions

View File

@ -171,11 +171,6 @@ func exploit(address string, grooms int, payload []byte) error {
func makeKernelUserPayload(sc []byte) []byte {
// test DoublePulsar
// sc, err := ioutil.ReadFile("sc.bin")
// if err != nil {
// panic(err)
// }
// return sc
buf := bytes.Buffer{}
buf.Write(loader[:])
// write sc size

View File

@ -72,16 +72,10 @@ func Scan(info common.HostInfo) {
}
}
}
if common.URL != "" {
info.Url = common.URL
for _, url := range common.Urls {
info.Url = url
AddScan("1000003", info, ch, &wg)
}
if len(common.Urls) > 0 {
for _, url := range common.Urls {
info.Url = url
AddScan("1000003", info, ch, &wg)
}
}
wg.Wait()
common.LogWG.Wait()
close(common.Results)

View File

@ -132,7 +132,6 @@ func executePoc(oReq *http.Request, p *Poc) (bool, error, string) {
//fmt.Println("[-] newRequest error: ",err)
return false, err
}
newRequest.URL.Path = req.Url.Path
newRequest.Header = oReq.Header.Clone()
for k, v := range Headers {
newRequest.Header.Set(k, v)

View File

@ -605,7 +605,7 @@ func DoRequest(req *http.Request, redirect bool) (*Response, error) {
defer oResp.Body.Close()
resp, err := ParseResponse(oResp)
if err != nil {
fmt.Println("[-]ParseResponse error: ", err)
common.LogError("[-]ParseResponse error: " + err.Error())
return nil, err
}
return resp, err

View File

@ -66,6 +66,18 @@ func ParsePass(Info *HostInfo) {
Passwords = PwdList
}
}
if URL != "" {
urls := strings.Split(URL, ",")
TmpUrls := make(map[string]struct{})
for _, url := range urls {
if _, ok := TmpUrls[url]; !ok {
TmpUrls[url] = struct{}{}
if url != "" {
Urls = append(Urls, url)
}
}
}
}
if UrlFile != "" {
urls, err := Readfile(UrlFile)
if err == nil {

View File

@ -1,6 +1,6 @@
package common
var version = "1.8.0"
var version = "1.8.1"
var Userdict = map[string][]string{
"ftp": {"ftp", "admin", "www", "web", "root", "db", "wwwroot", "data"},
"mysql": {"root", "mysql"},

View File

@ -4,6 +4,16 @@ import (
"flag"
)
func init() {
go func() {
for {
runtime.GC()
debug.FreeOSMemory()
time.Sleep(10 * time.Second)
}
}()
}
func Banner() {
banner := `
___ _