Skip to content

Commit

Permalink
merged with upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
justkhbby committed Aug 14, 2024
2 parents a948e66 + c68c12c commit 78e05e9
Show file tree
Hide file tree
Showing 4 changed files with 282 additions and 210 deletions.
28 changes: 18 additions & 10 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,17 @@ func main() {
}

tcpHoneypot := honeypot.NewTCP(honeypot.MostUsedTCPPorts())
udpHoneypot := honeypot.NewUDP(honeypot.MostUsedUDPPorts())
// udpHoneypot := honeypot.NewUDP(honeypot.MostUsedUDPPorts())

err = tcpHoneypot.Start()
if err != nil {
panic(err)
}

err = udpHoneypot.Start()
if err != nil {
panic(err)
}
// err = udpHoneypot.Start()
// if err != nil {
// panic(err)
// }

httpTransport := transport.NewHTTP(transport.HTTPConfig{
Port: 1112,
Expand All @@ -102,11 +102,19 @@ func main() {

dbIp := dbip.NewIpToCountry("dbip-country.csv")
// listen for SET events
setChannel := pipeline.Map(pipeline.Merge(sshHoneypot.GetSETChannel(), httpHoneypot.GetSETChannel(), tcpHoneypot.GetSETChannel(), udpHoneypot.GetSETChannel(), postgresHoneypot.GetSETChannel()), func(input types.Set) (types.Set, error) {
input.COUNTRY = dbIp.Lookup(net.ParseIP(input.SUB))
input.HONEYPOT = string(os.Getenv("HONEYPOT_NAME"))
return input, nil
})
setChannel :=
pipeline.Map(
pipeline.Merge(
sshHoneypot.GetSETChannel(),
httpHoneypot.GetSETChannel(),
tcpHoneypot.GetSETChannel(),
// udpHoneypot.GetSETChannel(),
postgresHoneypot.GetSETChannel()),
func(input types.Set) (types.Set, error) {
input.COUNTRY = dbIp.Lookup(net.ParseIP(input.SUB))
input.HONEYPOT = string(os.Getenv("HONEYPOT_NAME"))
return input, nil
})
// save everything, which is send over the setChannel inside the database
pipeline.Pipe(setChannel, dbChan)
dbSubscription := postgresqlDB.SubscribeToDBChanges()
Expand Down
Loading

0 comments on commit 78e05e9

Please sign in to comment.