Commit db2ea90 1 parent 3e11adf commit db2ea90 Copy full SHA for db2ea90
File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ var RootCmd = &cobra.Command{
20
20
" \\ ___ \\ / _ \\ '__\\ \\ / / _ \\ '__| |/ _ \\ / __/ __| | |_) / _ \\ | '__| __\\ ___ \\ / __/ _` | '_ \\ \n " +
21
21
" ___) | __/ | \\ V / __/ | | | __/\\ __ \\ __ \\ | __/ (_) | | | |_ ___) | (_| (_| | | | | \n " +
22
22
" |____/ \\ ___|_| \\ _/ \\ ___|_| |_|\\ ___||___/___/___|_| \\ ___/|_| \\ __|____/ \\ ___\\ __,_|_| |_| " +
23
- " |_____| \n " +
23
+ "\n " +
24
24
`
25
25
github.com/shadowabi/Serverless_PortScan
26
26
@@ -39,6 +39,8 @@ Serverless_PortScan is used to scan ports using cloud functions.
39
39
}
40
40
},
41
41
Run : func (cmd * cobra.Command , args []string ) {
42
+ cmd .Println (cmd .Long ) // print title
43
+
42
44
if define .Port == "" {
43
45
define .Port = config .C .PortList
44
46
}
@@ -55,6 +57,7 @@ Serverless_PortScan is used to scan ports using cloud functions.
55
57
reqList := pkg .ConvertToReqList (define .Port , hostList ... )
56
58
resp := pkg .FetchPortData (client , reqList ... )
57
59
60
+ cmd .Println ("scan result:" )
58
61
writeList := pkg .GetResult (resp ... )
59
62
pkg .WriteToFile (writeList , define .OutPUT )
60
63
},
Original file line number Diff line number Diff line change @@ -3,16 +3,20 @@ package pkg
3
3
import (
4
4
"bufio"
5
5
"fmt"
6
- "github.com/shadowabi/Serverless_PortScan_rebuild/utils/Error"
7
6
"os"
8
7
"sort"
9
8
"strings"
9
+
10
+ "github.com/shadowabi/Serverless_PortScan_rebuild/utils/Error"
10
11
)
11
12
12
13
func GetResult (respData ... ResponseData ) (writeResultList []string ) {
13
14
if len (respData ) != 0 {
14
15
for _ , data := range respData {
15
16
dataBody := strings .Trim (data .body , "\" " )
17
+ if dataBody == "" {
18
+ continue
19
+ }
16
20
ports := strings .Split (dataBody , "," )
17
21
for _ , port := range ports {
18
22
fmt .Println (fmt .Sprintf ("[+] %s:%s TCP OPEN." , data .host , port ))
You can’t perform that action at this time.
0 commit comments