1
0
mirror of https://github.com/sairson/Yasso.git synced 2026-02-11 14:25:00 +08:00

优化代码结构

This commit is contained in:
sairson
2022-01-11 09:06:42 +08:00
parent 29ac430785
commit 97045ecf4e
4 changed files with 87 additions and 25 deletions

View File

@@ -10,7 +10,7 @@ import (
var allCmd = &cobra.Command{
Use: "all",
Short: "Use all scanner module (.attention)\nSome service not support proxy,You might lose it [*]",
Short: "Use all scanner module (.attention) Some service not support proxy,You might lose it [*]",
Run: func(cmd *cobra.Command, args []string) {
if Hosts == "" {
_ = cmd.Help()

View File

@@ -52,13 +52,13 @@ func resolveIP(ip string) ([]string, error) {
var err error
switch footmark {
case "24":
var ip3 = strings.Join(strings.Split(ip[:len(ip)], ".")[0:3], ".")
var ip3 = strings.Join(strings.Split(ip[:], ".")[0:3], ".")
for i := 0; i <= 255; i++ {
temp = append(temp, ip3+"."+strconv.Itoa(i))
}
err = nil
case "16":
var ip2 = strings.Join(strings.Split(ip[:len(ip)], ".")[0:2], ".")
var ip2 = strings.Join(strings.Split(ip[:], ".")[0:2], ".")
for i := 0; i <= 255; i++ {
for j := 0; j <= 255; j++ {
temp = append(temp, ip2+"."+strconv.Itoa(i)+"."+strconv.Itoa(j))