嘿,我正在尝试自动化一个工具来执行我的侦察我正在使用 url 来存储 urlhttps://但是有一个工具whois and sublist3r需要地址而不是https://所以我将字符串切片但是当我运行该工具时它崩溃并使我的终端空白我可以输入但看不到输出。import ( "fmt" "log" "os/exec" "sync")var url stringvar wg sync.WaitGroupvar ip stringvar nsurl stringfunc nikto(outChan chan<- []byte) { cmd := exec.Command("nikto", "-h", url) bs, err := cmd.Output() if err != nil { log.Fatal(err) } outChan <- bs wg.Done()}func whois(outChan chan<- []byte) { cmd := exec.Command("whois",nsurl) bs, err := cmd.Output() if err != nil { log.Fatal(err) } outChan <- bs wg.Done()}func nmap (outChan chan<-[]byte) { cmd := exec.Command("nmap","-sC","-sV","-oA","nmap",ip)// cmd := exec.Command("nmap","-h") bs,err := cmd.Output() if err != nil { log.Fatal(err) } outChan <- bs wg.Done() }func sniper(outChan chan<-[]byte){ cmd:=exec.Command("sniper","-t",url) bs,err := cmd.Output() if err!=nil{ log.Fatal(err) } outChan <- bs wg.Done() }func sublist3r(outChan chan<-[]byte) { cmd := exec.Command("sublist3r","-d",nsurl) bs,err := cmd.Output() if err!=nil { log.Fatal(err) } outChan <- bs wg.Done() }func inspy (outChan chan<-[]byte){ cmd := exec.Command("inspy","--empspy","/opt/wordlists/wordlists/title-list-large.txt",url) bs,err := cmd.Output() if err!=nil { log.Fatal(err) } outChan <- bs wg.Done() }func wig (outChan chan<-[]byte){ //nsurl = url[8:] cmd := exec.Command("wig",url) bs,err := cmd.Output() if err!=nil{ log.Fatal(err) } outChan <- bs wg.Done() }
1 回答
qq_遁去的一_1
TA贡献1725条经验 获得超7个赞
如果“它崩溃并使我的终端空白”那么程序的输出可能包含您的终端反应不佳的字符
将“unicode/utf8”添加到导入中并尝试替换
fmt.Println(string(bs))
和
if utf8.ValidString(bs) {
fmt.Printf("%v\n",bs)
} else {
fmt.Printf("warning, loosing output")
}
- 1 回答
- 0 关注
- 106 浏览
添加回答
举报
0/150
提交
取消