mirror of
https://github.com/sairson/Yasso.git
synced 2026-02-07 04:24:34 +08:00
修复一些简单的输出问题,并加入ip文本导入
This commit is contained in:
@@ -34,7 +34,7 @@ var allCmd = &cobra.Command{
|
||||
}
|
||||
|
||||
func init(){
|
||||
allCmd.Flags().StringVarP(&Hosts,"host","H","","Set `hosts`(The format is similar to Nmap)")
|
||||
allCmd.Flags().StringVarP(&Hosts,"host","H","","Set `hosts`(The format is similar to Nmap) or ips.txt file path")
|
||||
allCmd.Flags().StringVarP(&Ports,"ports","P","","Set `ports`(The format is similar to Nmap)")
|
||||
allCmd.Flags().BoolVar(&PingBool,"noping",true,"No use ping to scanner alive host")
|
||||
allCmd.Flags().IntVar(&Runtime,"runtime",100,"Set scanner ants pool thread")
|
||||
@@ -76,7 +76,9 @@ func allRun(hostString string,portString string,log bool,runtime int,noping bool
|
||||
if len(alive) > 0 {
|
||||
fmt.Println("----- [Yasso] Start do vuln scan -----")
|
||||
VulScan(alive,false,true,false) // 做全扫描
|
||||
fmt.Println("----- [Yasso] Start do port scan -----")
|
||||
if len(alive) != 0 {
|
||||
fmt.Println("----- [Yasso] Start do port scan -----")
|
||||
}
|
||||
PortResults := PortScan(alive,ports)
|
||||
// 获取我们的端口扫描结果,去遍历
|
||||
if len(PortResults) != 0 {
|
||||
|
||||
@@ -33,7 +33,7 @@ var BruteCmd = &cobra.Command{
|
||||
|
||||
func init(){
|
||||
// 添加全局变量
|
||||
BruteCmd.PersistentFlags().StringVarP(&Hosts,"hosts","H","","to crack hosts address (crack Must)")
|
||||
BruteCmd.PersistentFlags().StringVarP(&Hosts,"hosts","H","","to crack hosts address or ips.txt path (crack Must)")
|
||||
BruteCmd.PersistentFlags().IntVar(&BrutePort,"port",0,"to crack hosts port (if not set use default)")
|
||||
BruteCmd.PersistentFlags().IntVar(&Runtime,"runtime",100,"set crack thread number")
|
||||
BruteCmd.PersistentFlags().BoolVarP(&BruteFlag,"crack","",false,"make sure to use crack")
|
||||
|
||||
@@ -15,7 +15,7 @@ import (
|
||||
func init(){
|
||||
rootCmd.AddCommand(DisMapCmd)
|
||||
DisMapCmd.Flags().DurationVarP(&TimeDuration,"time","t",1 * time.Second,"Set timeout (eg.) -t 50ms(ns,ms,s,m,h)")
|
||||
DisMapCmd.Flags().StringVarP(&Hosts,"hosts","H","","Set `hosts`(The format is similar to Nmap)")
|
||||
DisMapCmd.Flags().StringVarP(&Hosts,"hosts","H","","Set `hosts`(The format is similar to Nmap) or ips.txt file path")
|
||||
DisMapCmd.Flags().StringVarP(&Ports,"ports","p","","Set `ports`(The format is similar to Nmap)(eg.) 1-2000,3389")
|
||||
DisMapCmd.Flags().IntVarP(&Runtime,"runtime","r",508,"Set scanner ants pool thread")
|
||||
DisMapCmd.Flags().BoolVar(&PingBool,"ping",false,"Use ping to scan alive host")
|
||||
|
||||
@@ -81,7 +81,7 @@ func BruteMysqlByUser(){
|
||||
}
|
||||
|
||||
func init(){
|
||||
MysqlCmd.Flags().StringVarP(&SQLCommand,"cmd","C","","mysql sql command")
|
||||
MysqlCmd.Flags().StringVarP(&SQLCommand,"cmd","c","","mysql sql command")
|
||||
MysqlCmd.Flags().StringVar(&ConnHost,"hostname","","Remote Connect a Mysql (brute param need false)")
|
||||
MysqlCmd.Flags().StringVar(&LoginUser,"user","","Login ssh username")
|
||||
MysqlCmd.Flags().StringVar(&LoginPass,"pass","","Login ssh password")
|
||||
|
||||
@@ -49,7 +49,7 @@ var PortCmd = &cobra.Command{
|
||||
|
||||
func init(){
|
||||
PortCmd.Flags().DurationVarP(&TimeDuration,"time","t",500 * time.Millisecond,"Set timeout (eg.) -t 50ms(ns,ms,s,m,h)")
|
||||
PortCmd.Flags().StringVarP(&Hosts,"hosts","H","","Set `hosts`(The format is similar to Nmap)")
|
||||
PortCmd.Flags().StringVarP(&Hosts,"hosts","H","","Set `Set `hosts`(The format is similar to Nmap) or ips.txt file path")
|
||||
PortCmd.Flags().StringVarP(&Ports,"ports","p","","Set `ports`(The format is similar to Nmap)(eg.) 1-2000,3389")
|
||||
PortCmd.Flags().IntVarP(&Runtime,"runtime","r",100,"Set scanner ants pool thread")
|
||||
rootCmd.AddCommand(PortCmd)
|
||||
|
||||
@@ -3,12 +3,22 @@ package cmd
|
||||
import (
|
||||
"errors"
|
||||
"net"
|
||||
"os"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func ResolveIPS(ip string)([]string,error){
|
||||
if strings.Contains(ip,".") && strings.Contains(ip,".txt") {
|
||||
// 此时传入的是文件txt
|
||||
file, err := os.Open(ip)
|
||||
if err != nil {
|
||||
return []string{},err
|
||||
}
|
||||
ips := Readiness(file)
|
||||
return ips,err
|
||||
}
|
||||
reg := regexp.MustCompile(`[a-zA-Z]+`)
|
||||
switch {
|
||||
case strings.Contains(ip,"/"):
|
||||
|
||||
@@ -8,7 +8,7 @@ var versionCmd = &cobra.Command{
|
||||
Use: "version",
|
||||
Short: "Print Yasso's version in screen",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
Println(Clearln + "Yasso Version is 0.1.1")
|
||||
Println(Clearln + "Yasso Version is 0.1.2")
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ var VulCmd = &cobra.Command{
|
||||
}
|
||||
|
||||
func init(){
|
||||
VulCmd.Flags().StringVarP(&Hosts,"hosts","H","","Set `hosts`(The format is similar to Nmap)")
|
||||
VulCmd.Flags().StringVarP(&Hosts,"hosts","H","","Set `hosts`(The format is similar to Nmap) or ips.txt file path")
|
||||
VulCmd.Flags().StringVar(&ProxyHost,"proxy","","Set socks5 proxy")
|
||||
VulCmd.Flags().BoolVar(&smbGohstbool,"gs",false,"scan smbghost")
|
||||
VulCmd.Flags().BoolVar(&ms17010bool,"ms",false,"scan ms17010")
|
||||
|
||||
@@ -42,7 +42,7 @@ func init(){
|
||||
WinCmd.Flags().BoolVar(&netbiosflag,"netbios",false,"Set netbios flag and use netbios scan")
|
||||
WinCmd.Flags().BoolVar(&oxidflag,"oxid",false,"Set oxid flag and use oxid scan")
|
||||
WinCmd.Flags().BoolVar(&allflag,"all",true,"Set all flag and use oxid,netbios,smb scan")
|
||||
WinCmd.Flags().StringVarP(&Hosts,"hosts","H","","Set `hosts`(The format is similar to Nmap)")
|
||||
WinCmd.Flags().StringVarP(&Hosts,"hosts","H","","Set `hosts`(The format is similar to Nmap) or ips.txt file path")
|
||||
WinCmd.Flags().DurationVar(&TimeDuration,"time",1 * time.Second,"Set net conn timeout")
|
||||
WinCmd.Flags().StringVar(&ProxyHost,"proxy","","Set socks5 proxy and use it")
|
||||
}
|
||||
@@ -526,7 +526,7 @@ func runall(host []string){
|
||||
return
|
||||
}
|
||||
for _,s := range r {
|
||||
Println(fmt.Sprintf("[+] %v",v))
|
||||
Println(fmt.Sprintf("[NBTBIOS] %v",v))
|
||||
Println(fmt.Sprintf("\t%v",s))
|
||||
}
|
||||
}(v)
|
||||
|
||||
Reference in New Issue
Block a user