-
Notifications
You must be signed in to change notification settings - Fork 0
/
attackFiesta.go
60 lines (49 loc) · 1.01 KB
/
attackFiesta.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
package core
import (
"encoding/json"
"errors"
)
func (c *Core) fiestaOptions() []optionType {
return c.norelayOptions()
}
func (c *Core) fiestaJsContent() string {
return c.defaultJS()
}
func (c *Core) fiestaGetInfo() ([]string, error) {
return c.getProxyInfo(), nil
}
type fiestaTLS struct {
Client string
IsRequest bool
Type string
Length int
}
func (c *Core) fiestaGetOracle(s string) (int, error) {
b := []byte(s)
var m fiestaTLS
e := json.Unmarshal(b, &m)
if e != nil {
return 0, e
}
e = nil
if !m.IsRequest {
e = errors.New("packet is a response")
}
return 1, e
}
func (c *Core) fiestaGuess(g string) (int, error) {
return 0, nil
}
func (c *Core) fiestaMakeDecision(right, wrong int, results map[string]int) ([]string, error) {
var ok []string
for key, value := range results {
//if value < wrong-1 || value > wrong+1 {
if value != wrong {
ok = append(ok, key)
}
}
return ok, nil
}
func (c *Core) fiestaOracleToInt(oracles []int) (int, error) {
return len(oracles), nil
}