Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alpkeskin
GitHub Repository: alpkeskin/mosint
Path: blob/master/v3/internal/runner/runner.go
689 views
1
/*
2
Copyright © 2023 github.com/alpkeskin
3
*/
4
package runner
5
6
import (
7
"github.com/alpkeskin/mosint/v3/pkg/dns"
8
"github.com/alpkeskin/mosint/v3/pkg/scrape/googlesearch"
9
"github.com/alpkeskin/mosint/v3/pkg/services/breachdirectory"
10
"github.com/alpkeskin/mosint/v3/pkg/services/emailrep"
11
"github.com/alpkeskin/mosint/v3/pkg/services/haveibeenpwned"
12
"github.com/alpkeskin/mosint/v3/pkg/services/hunter"
13
"github.com/alpkeskin/mosint/v3/pkg/services/intelx"
14
"github.com/alpkeskin/mosint/v3/pkg/services/ipapi"
15
"github.com/alpkeskin/mosint/v3/pkg/services/psbdmp"
16
"github.com/alpkeskin/mosint/v3/pkg/social/instagram"
17
"github.com/alpkeskin/mosint/v3/pkg/social/spotify"
18
"github.com/alpkeskin/mosint/v3/pkg/social/twitter"
19
"github.com/gammazero/workerpool"
20
)
21
22
type Runner struct {
23
Email string
24
DnsC *dns.Dns
25
GoogleSearchC *googlesearch.GoogleSearch
26
BreachDirectoryC *breachdirectory.BreachDirectory
27
HaveibeenpwnedC *haveibeenpwned.HaveIBeenPwned
28
EmailRepC *emailrep.Emailrep
29
HunterC *hunter.Hunter
30
IntelxC *intelx.Intelx
31
IpApiC *ipapi.Ipapi
32
PsbdmpC *psbdmp.Psbdmp
33
InstagramC *instagram.Instagram
34
SpotifyC *spotify.Spotify
35
TwitterC *twitter.Twitter
36
}
37
38
func New(email string) *Runner {
39
return &Runner{
40
Email: email,
41
DnsC: dns.New(),
42
GoogleSearchC: googlesearch.New(),
43
BreachDirectoryC: breachdirectory.New(),
44
HaveibeenpwnedC: haveibeenpwned.New(),
45
EmailRepC: emailrep.New(),
46
HunterC: hunter.New(),
47
IntelxC: intelx.New(),
48
IpApiC: ipapi.New(),
49
PsbdmpC: psbdmp.New(),
50
InstagramC: instagram.New(),
51
SpotifyC: spotify.New(),
52
TwitterC: twitter.New(),
53
}
54
}
55
56
func (c *Runner) Start() {
57
email := c.Email
58
runners := []func(string){
59
c.DnsC.Resolver,
60
c.GoogleSearchC.Search,
61
c.BreachDirectoryC.Lookup,
62
c.HaveibeenpwnedC.Lookup,
63
c.EmailRepC.Lookup,
64
c.HunterC.Lookup,
65
c.IntelxC.Search,
66
c.IpApiC.GetInfo,
67
c.PsbdmpC.Search,
68
c.InstagramC.Check,
69
c.SpotifyC.Check,
70
c.TwitterC.Check,
71
}
72
73
wp := workerpool.New(12)
74
for _, runner := range runners {
75
runner := runner
76
wp.Submit(func() {
77
runner(email)
78
})
79
}
80
wp.StopWait()
81
}
82
83
func (c *Runner) Print() {
84
println()
85
c.EmailRepC.Print()
86
87
println()
88
c.HunterC.Print()
89
90
println()
91
c.GoogleSearchC.Print()
92
93
println()
94
c.InstagramC.Print()
95
c.SpotifyC.Print()
96
c.TwitterC.Print()
97
98
println()
99
c.PsbdmpC.Print()
100
101
println()
102
c.IntelxC.Print()
103
104
println()
105
c.BreachDirectoryC.Print()
106
107
println()
108
c.HaveibeenpwnedC.Print()
109
110
println()
111
c.IpApiC.Print()
112
113
println()
114
c.DnsC.Print()
115
}
116
117