Skip to content

Commit

Permalink
Change target parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
zer-far committed Jan 25, 2024
1 parent 67d13e7 commit 15a6990
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ make
## Usage

```bash
./spurt --hostname https://example.com
./spurt --url https://example.com
```
Press Ctrl+C to stop Spurt.

Expand Down
20 changes: 10 additions & 10 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
)

var (
version = "v1.5.0"
version = "v1.6.1"

banner = fmt.Sprintf(`
__
Expand All @@ -44,7 +44,7 @@ var (
"https://vk.com/profile.php?auto=",
"https://www.usatoday.com/search/results?q=",
}
hostname string
target string
paramJoiner string
reqCount uint64
threads int
Expand Down Expand Up @@ -114,13 +114,13 @@ func fetchIP() {
}

func get() {
if strings.ContainsRune(hostname, '?') {
if strings.ContainsRune(target, '?') {
paramJoiner = "&"
} else {
paramJoiner = "?"
}

req, err := http.NewRequest("GET", hostname+paramJoiner+buildblock(rand.Intn(7)+3)+"="+buildblock(rand.Intn(7)+3), nil)
req, err := http.NewRequest("GET", target+paramJoiner+buildblock(rand.Intn(7)+3)+"="+buildblock(rand.Intn(7)+3), nil)
if err != nil {
fmt.Println(err)
}
Expand Down Expand Up @@ -160,18 +160,18 @@ func main() {
color.Cyan.Println(banner)
color.Cyan.Println("\n\t\tgithub.com/zer-far\n")

flag.StringVar(&hostname, "hostname", "", "example: --hostname https://example.com")
flag.IntVar(&timeout, "timeout", 3000, "Timeout in milliseconds")
flag.IntVar(&sleep, "sleep", 1, "Sleep time in milliseconds")
flag.IntVar(&threads, "threads", 1, "Number of threads")
flag.BoolVar(&check, "check", false, "Enable IP address check")
flag.StringVar(&target, "url", "", "URL to target.")
flag.IntVar(&timeout, "timeout", 3000, "Timeout in milliseconds.")
flag.IntVar(&sleep, "sleep", 1, "Sleep time in milliseconds.")
flag.IntVar(&threads, "threads", 1, "Number of threads.")
flag.BoolVar(&check, "check", false, "Enable IP address check.")
flag.Parse()

if check {
fetchIP()
}

if !isValidURL(hostname) {
if !isValidURL(target) {
os.Exit(1)
}
if timeout == 0 {
Expand Down

0 comments on commit 15a6990

Please sign in to comment.