MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / cmdRules

Function cmdRules

cmd/inject-cli/main.go:620–646  ·  view source on GitHub ↗
(c *apiClient)

Source from the content-addressed store, hash-verified

618}
619
620func cmdRules(c *apiClient) {
621 rules, err := c.getRules()
622 if err != nil {
623 fmt.Printf(" error: %v\n", err)
624 return
625 }
626 if len(rules) == 0 {
627 fmt.Println(" No injection rules configured.")
628 return
629 }
630
631 fmt.Println()
632 fmt.Printf(" %-4s %-18s %-18s %-8s %-10s %-8s\n", "#", "Name", "ToolName", "Enabled", "Timing", "MaxInj")
633 printSep(70)
634 for i, r := range rules {
635 enabled := "yes"
636 if !r.Enabled {
637 enabled = "no"
638 }
639 maxInj := "1"
640 if r.MaxInjections > 0 {
641 maxInj = strconv.Itoa(r.MaxInjections)
642 }
643 fmt.Printf(" %-4d %-18s %-18s %-8s %-10s %-8s\n", i+1, r.Name, r.ToolName, enabled, r.Timing, maxInj)
644 }
645 fmt.Println()
646}
647
648func cmdRulesAdd(c *apiClient) {
649 fmt.Println()

Callers 1

mainFunction · 0.85

Calls 2

printSepFunction · 0.85
getRulesMethod · 0.80

Tested by

no test coverage detected