-
Notifications
You must be signed in to change notification settings - Fork 1
/
concEr.go
73 lines (50 loc) · 1.42 KB
/
concEr.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
package fuzz
import (
"io/ioutil"
"fmt"
"os"
"os/signal"
"strings"
"github.com/zenthangplus/goccm"
"github.com/neonify/lessgo/pkg/lessgo"
"github.com/neonify/lessgo/pkg/input"
)
func ConcManager(Obj input.Data) {
Output := make(map[int]int)
D := make(chan os.Signal, 1)
signal.Notify(D, os.Interrupt)
Heading()
list,err:= ioutil.ReadFile(Obj.File)
lessgo.Checkerr(err)
ArrList := strings.Split(string(list),"\n")
nbJobs := len(ArrList)
// Number of concurent go requests
c := goccm.New(Obj.ConcRequests)
for i := 0; i < nbJobs; i++ {
c.Wait()
go func(i int) {
Output = Handle(Obj,ArrList[i],Output)
c.Done()
go func(){
for _ = range D {
WindUp(Output)
os.Exit(2)
}
}()
}(i)
}
c.WaitAllDone()
WindUp(Output)
}
func WindUp(Output map[int]int){
lessgo.Color("blue","____________________________________________")
lessgo.Color("blue","\n\nPROGRESS\n")
lessgo.Color("cyan"," Status Requests")
for stat,nos := range(Output){
fmt.Printf("[*] ")
fmt.Printf("%03d",stat)
fmt.Printf(" : ")
fmt.Println(nos)
}
lessgo.Color("green","\n[+] All the successful urls are stored in the succ_urls.txt file.\n")
}