-
Notifications
You must be signed in to change notification settings - Fork 0
/
wrapperJS.go
83 lines (75 loc) · 1.36 KB
/
wrapperJS.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
74
75
76
77
78
79
80
81
82
83
package core
import "errors"
// htmlContent function...
func (c *Core) htmlContent() string {
return defaultHTML
}
// jsContent function...
func (c *Core) jsContent() string {
switch c.attack {
case CRIME:
return c.crimeJsContent()
case BREACH:
return c.breachJsContent()
case TIME:
return c.timeJsContent()
case XSSEARCH:
return c.xssearchJsContent()
case XSTIME:
return c.xstimeJsContent()
case FIESTA:
return c.fiestaJsContent()
case DUMMY:
return c.dummyJsContent()
default:
return ""
}
}
func (c *Core) defaultJS() string {
x, ok := c.option["LOAD"]
if !ok {
return ""
}
l, e := StringToLoad(x)
if e != nil {
return ""
}
var s string
switch l {
case IMG:
s += loadImg
case IFRAME:
s += loadIFrame
case OPEN:
s += loadOpen
case TAB:
s += loadTab
}
s += loadFromWS
return s
}
func (c *Core) timingJS() string {
s := c.defaultJS() + measureTiming
return s
}
// getInfo function...
func (c *Core) getInfo() ([]string, error) {
switch c.attack {
case CRIME:
return c.crimeGetInfo()
case BREACH:
return c.breachGetInfo()
case TIME:
return c.timeGetInfo()
case XSSEARCH:
return c.xssearchGetInfo()
case XSTIME:
return c.xstimeGetInfo()
case FIESTA:
return c.fiestaGetInfo()
case DUMMY:
return c.dummyGetInfo()
default:
return []string{}, errors.New("getInfo not implemented for the given attack")
}
}