Skip to content

Commit

Permalink
New feature - delay in ms
Browse files Browse the repository at this point in the history
  • Loading branch information
devploit committed Jun 29, 2022
1 parent 2d6adcb commit 4b67adf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Usage:

Flags:
-b, --bypassIp string Try bypass tests with a specific IP address (or hostname). i.e.: 'X-Forwarded-For: 192.168.0.1' instead of 'X-Forwarded-For: 127.0.0.1'
-d, --delay Set a delay (in ms) between each request
-H, --header strings Add a custom header to the requests (can be specified multiple times)
-h, --help help for dontgo403
-p, --proxy string Proxy URL. For example: http://127.0.0.1:8080
Expand Down
7 changes: 7 additions & 0 deletions cmd/requester.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"strconv"
"strings"
"sync"
"time"

"github.com/cheynewallace/tabby"
"github.com/fatih/color"
Expand Down Expand Up @@ -53,6 +54,7 @@ func requestMethods(uri string, headers []header, proxy *url.URL) {
results := []Result{}

for _, line := range lines {
time.Sleep(time.Duration(delay) * time.Millisecond)
go func(line string) {
defer wg.Done()

Expand Down Expand Up @@ -96,6 +98,7 @@ func requestHeaders(uri string, headers []header, proxy *url.URL, bypassIp strin

for _, ip := range ips {
for _, line := range lines {
time.Sleep(time.Duration(delay) * time.Millisecond)
go func(line, ip string) {
defer wg.Done()

Expand All @@ -113,6 +116,7 @@ func requestHeaders(uri string, headers []header, proxy *url.URL, bypassIp strin
}

for _, simpleheader := range simpleheaders {
time.Sleep(time.Duration(delay) * time.Millisecond)
go func(line string) {
defer wg.Done()

Expand Down Expand Up @@ -146,6 +150,7 @@ func requestEndPaths(uri string, headers []header, proxy *url.URL) {
results := []Result{}

for _, line := range lines {
time.Sleep(time.Duration(delay) * time.Millisecond)
go func(line string) {
defer wg.Done()
statusCode, response, err := request("GET", uri+line, headers, proxy)
Expand Down Expand Up @@ -185,6 +190,7 @@ func requestMidPaths(uri string, headers []header, proxy *url.URL) {
results := []Result{}

for _, line := range lines {
time.Sleep(time.Duration(delay) * time.Millisecond)
go func(line string) {
defer wg.Done()

Expand Down Expand Up @@ -227,6 +233,7 @@ func requestCapital(uri string, headers []header, proxy *url.URL) {
results := []Result{}

for _, z := range uripath {
time.Sleep(time.Duration(delay) * time.Millisecond)
go func(z string) {
defer wg.Done()

Expand Down
2 changes: 2 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ var (
uri string
proxy string
useragent string
delay int
req_headers []string
bypassIp string
)
Expand Down Expand Up @@ -46,6 +47,7 @@ func init() {
rootCmd.PersistentFlags().StringVarP(&uri, "uri", "u", "", "Target URL")
rootCmd.PersistentFlags().StringVarP(&proxy, "proxy", "p", "", "Proxy URL. For example: http://127.0.0.1:8080")
rootCmd.PersistentFlags().StringVarP(&useragent, "useragent", "a", "", "Set the User-Agent string (default 'dontgo403/0.3')")
rootCmd.PersistentFlags().IntVarP(&delay, "delay", "d", 0, "Set a delay (in ms) between each request")
rootCmd.PersistentFlags().StringSliceVarP(&req_headers, "header", "H", []string{""}, "Add a custom header to the requests (can be specified multiple times)")
rootCmd.PersistentFlags().StringVarP(&bypassIp, "bypassIp", "b", "", "Try bypass tests with a specific IP address (or hostname). i.e.: 'X-Forwarded-For: 192.168.0.1' instead of 'X-Forwarded-For: 127.0.0.1'")
}
Expand Down

0 comments on commit 4b67adf

Please sign in to comment.