You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+68-3Lines changed: 68 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,10 @@ Typical CSS injection requires an attacker to load the context a number of times
4
4
5
5
Sequential import chaining is a technique that enable a quicker, easier, token exfiltration even in the cases where framing isn't possible or the dynamic context is only occasionally realized.
6
6
7
-
## Prerequisites
7
+
### Blog Post
8
+
I wrote a blog post on this. Read about it [here!](https://medium.com/@d0nut/better-exfiltration-via-html-injection-31c72a2dae8b)
9
+
10
+
## Prerequisites for Attack
8
11
9
12
This attack only works if the attacker at least one of these:
10
13
@@ -13,7 +16,69 @@ This attack only works if the attacker at least one of these:
13
16
14
17
The first case is probably more likely and will work even if filtered through vanilla DOM Purify.
You will find the built binary at `./target/release/sic`
27
+
28
+
## Usage
29
+
`sic` has documentation on the available flags when calling `sic -h` but the following is information for general usage.
30
+
31
+
*`-p` will set the lower port that `sic` will operate on. By default this is 3000. `sic` will also listen on port `port + 1` (by default 3001) to circumvent a technical limitation in most browsers regarding open connection limits.
32
+
*`--ph` sets the hostname that the "polling host" will operate on. This can either be the lower or higher operating port, though it's traditionally the lower port. Defaults to `http://localhost:3000`. This _must_ be different than `--ch`
33
+
*`--ch` similar to `--ph` but this sets the "callback host" where tokens are sent. Defaults to `http://localhost:3001`. This _must_ be different than `--ph`.
34
+
*`-t` specifies the template file used to generate the token exfiltration payloads.
35
+
*`--charset` specifies the set of characters that may exist in the target token. Defaults to alphanumerics (`abc...890`).
36
+
37
+
A standard usage of this tool may look like the following:
The `len` parameter specifies how long the token is. This is necessary for `sic` to generate the appropriate number of `/polling` responses. If unknown, it's safe to use a value higher than the total number of chars in the token.
48
+
49
+
### Advanced Logs
50
+
`sic` will print minimal logs whenever it receives any token information; however, if you want more detailed information advanced logging is supported through an environment variable `RUST_LOG`.
51
+
52
+
```
53
+
RUST_LOG=info ./sic -t my_template_file
54
+
```
55
+
56
+
### Templates
57
+
The templating system is very straightforward for `sic`. There are two actual templates (probably better understood as 'placeholders'):
58
+
*`{{:token:}}` - This is the current token that we're attempting to test for. This would be the `xyz` in `input[name=csrf][value^=xyz]{...}`
59
+
*`{{:callback:}}` - This is the address that you want the browser to reach out to when a token is determined. This will be the callback host (`--ch`). All the information `sic` needs to understand what happened client-side will be in this url.
`sic` will automatically generate all of the payloads required for your attack and make sure it's pointing to the right callback urls.
67
+
68
+
### HTTPS
69
+
I didn't bake official HTTPS support into the tool but made it possible to potentially use nginx as a reverse proxy. I haven't validated that this will work or not, but I don't really see a reason why it wouldn't.
70
+
71
+
Assuming you have configured nginx to forward port 3000 -> 4000 and 3001 -> 4001 then you might launch the tool as follows:
Note that the ports on `--ph` and `--ch` match up with the ports nginx is serving and not `sic`.
78
+
79
+
## Technique Description
80
+
81
+
For a better story and additional information, please see my blog post on [Sequential Import Chaining here](https://medium.com/@d0nut/better-exfiltration-via-html-injection-31c72a2dae8b).
17
82
18
83
The idea behind CSS injection token exfiltration is simple: You need the browser to evaluate your malicious css once, send an outbound request with the next learned token, and repeat.
19
84
@@ -32,7 +97,7 @@ Sequential Import Chaining uses 3 easy steps to trick some browser into performi
0 commit comments