Skip to content

Commit

Permalink
fix logs 2022-10-15
Browse files Browse the repository at this point in the history
  • Loading branch information
hktalent committed Oct 15, 2022
1 parent e826d1c commit 0a1ec0a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
5 changes: 5 additions & 0 deletions brute/filefuzz.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,10 +432,15 @@ BreakAll:
// 默认情况等待所有结束
wg.Wait()
if 0 < len(path) {
util.SendLog(u, "brute", strings.Join(path, "\n"), "")

log.Printf("fuzz is over: %s found:\n%s\n", u, strings.Join(path, "\n"))
path = util.SliceRemoveDuplicates(path)
}
technologies = util.SliceRemoveDuplicates(technologies)
if 0 < len(technologies) {
util.SendLog(u, "brute", strings.Join(technologies, "\n"), "")
}

stop() //发停止指令
<-time.After(time.Second * 2)
Expand Down
1 change: 1 addition & 0 deletions lib/util/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,5 @@ func writeoutput(v interface{}) {
}
defer f.Close() //nolint
f.WriteString(szLog)

}
5 changes: 2 additions & 3 deletions pkg/httpx/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -537,14 +537,14 @@ func (r *Runner) RunEnumeration() {
// output routine
wgoutput := sizedwaitgroup.New(1)
wgoutput.Add()
output := make(chan Result)
output := make(chan Result, 200)
go func(output chan Result) {
defer wgoutput.Done()

var f *os.File
if r.options.Output != "" {
var err error
f, err = os.Create(r.options.Output)
f, err := os.OpenFile(r.options.Output, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
if err != nil {
gologger.Fatal().Msgf("Could not create output file '%s': %s\n", r.options.Output, err)
}
Expand All @@ -554,7 +554,6 @@ func (r *Runner) RunEnumeration() {
header := Result{}.CSVHeader()
//gologger.Silent().Msgf("%s\n", header)
if f != nil {
f.WriteString("\xEF\xBB\xBF")
//nolint:errcheck // this method needs a small refactor to reduce complexity
f.WriteString(header + "\n")
}
Expand Down
4 changes: 3 additions & 1 deletion pkg/hydra/doNmapResult.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ func DoParseXml(s string, bf *bytes.Buffer) {
}
}

log.Printf("%s\t%d\t%s\n", ip, port, service)
s1 := fmt.Sprintf("%s\t%d\t%s\n", ip, port, service)
util.SendLog(ip, "nmap", s1, "")
log.Printf("%s", s1)
}
}
}
Expand Down

0 comments on commit 0a1ec0a

Please sign in to comment.