-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstop.go
38 lines (32 loc) · 847 Bytes
/
stop.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package cmd
import (
"fmt"
zap "github.com/krishpranav/gozap/pkg/zap"
"github.com/spf13/cobra"
)
// stopCmd represents the stop command
var stopCmd = &cobra.Command{
Use: "stop (spider/ascan/ajaxspider/all)",
Short: "Stop Scanning",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("stop called")
if len(args) >= 1 {
if args[0] == "spider" {
zap.StopSpider(apiHosts, options)
} else if args[0] == "ascan" {
zap.StopActiveScan(apiHosts, options)
} else if args[0] == "ajaxspider" {
zap.StopAjaxSpider(apiHosts, options)
} else if args[0] == "all" {
zap.StopSpider(apiHosts, options)
zap.StopAjaxSpider(apiHosts, options)
zap.StopActiveScan(apiHosts, options)
}
} else {
fmt.Println("Please input scanning mode for stop")
}
},
}
func init() {
rootCmd.AddCommand(stopCmd)
}