Skip to content

Commit 0a1ec0a

Browse files
committed
fix logs 2022-10-15
1 parent e826d1c commit 0a1ec0a

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

brute/filefuzz.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,10 +432,15 @@ BreakAll:
432432
// 默认情况等待所有结束
433433
wg.Wait()
434434
if 0 < len(path) {
435+
util.SendLog(u, "brute", strings.Join(path, "\n"), "")
436+
435437
log.Printf("fuzz is over: %s found:\n%s\n", u, strings.Join(path, "\n"))
436438
path = util.SliceRemoveDuplicates(path)
437439
}
438440
technologies = util.SliceRemoveDuplicates(technologies)
441+
if 0 < len(technologies) {
442+
util.SendLog(u, "brute", strings.Join(technologies, "\n"), "")
443+
}
439444

440445
stop() //发停止指令
441446
<-time.After(time.Second * 2)

lib/util/log.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,5 @@ func writeoutput(v interface{}) {
8787
}
8888
defer f.Close() //nolint
8989
f.WriteString(szLog)
90+
9091
}

pkg/httpx/runner/runner.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -537,14 +537,14 @@ func (r *Runner) RunEnumeration() {
537537
// output routine
538538
wgoutput := sizedwaitgroup.New(1)
539539
wgoutput.Add()
540-
output := make(chan Result)
540+
output := make(chan Result, 200)
541541
go func(output chan Result) {
542542
defer wgoutput.Done()
543543

544544
var f *os.File
545545
if r.options.Output != "" {
546546
var err error
547-
f, err = os.Create(r.options.Output)
547+
f, err := os.OpenFile(r.options.Output, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
548548
if err != nil {
549549
gologger.Fatal().Msgf("Could not create output file '%s': %s\n", r.options.Output, err)
550550
}
@@ -554,7 +554,6 @@ func (r *Runner) RunEnumeration() {
554554
header := Result{}.CSVHeader()
555555
//gologger.Silent().Msgf("%s\n", header)
556556
if f != nil {
557-
f.WriteString("\xEF\xBB\xBF")
558557
//nolint:errcheck // this method needs a small refactor to reduce complexity
559558
f.WriteString(header + "\n")
560559
}

pkg/hydra/doNmapResult.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@ func DoParseXml(s string, bf *bytes.Buffer) {
129129
}
130130
}
131131

132-
log.Printf("%s\t%d\t%s\n", ip, port, service)
132+
s1 := fmt.Sprintf("%s\t%d\t%s\n", ip, port, service)
133+
util.SendLog(ip, "nmap", s1, "")
134+
log.Printf("%s", s1)
133135
}
134136
}
135137
}

0 commit comments

Comments
 (0)