-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.go
44 lines (34 loc) · 1.07 KB
/
main.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
package main
import (
"flag"
"fmt"
"uam/server"
"github.com/gofiber/fiber/v2"
)
var (
serverPort string
)
func main() {
flag.IntVar(&server.Difficulty, "difficulty", 5000000, "Pow bruteforce range")
flag.IntVar(&server.TimeValid, "timeValid", 240, "Amount of seconds a challenge is valid for")
flag.IntVar(&server.RetriesAllowed, "retries", 10, "How many times a challenge can be requested")
flag.IntVar(&server.DynamicSaltLength, "saltLength", 30, "The length of the dynamic salt")
flag.StringVar(&serverPort, "port", ":80", "Public seed to bruteforce with")
flag.Parse()
fmt.Printf("[+] Difficulty: %d\n", server.Difficulty)
fmt.Printf("[+] TimeValid: %d\n", server.TimeValid)
fmt.Printf("[+] Retries: %d\n", server.RetriesAllowed)
fmt.Printf("[+] SaltLength: %d\n", server.DynamicSaltLength)
config := fiber.Config{
DisableDefaultContentType: true,
}
httpServer := fiber.New(config)
httpServer.Use(func(c *fiber.Ctx) error {
server.Middleware(c)
return nil
})
go server.ClearCache()
if err := httpServer.Listen(serverPort); err != nil {
panic(err)
}
}