Skip to content

Commit

Permalink
Added more randomization to client to prevent flagging
Browse files Browse the repository at this point in the history
  • Loading branch information
V4NSH4J committed Jul 27, 2022
1 parent 2e5f98e commit d28b090
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 10 deletions.
62 changes: 54 additions & 8 deletions instance/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
package instance

import (
"crypto/tls"
"math/rand"
"net/http"
"net/url"
"strings"
"time"

"crypto/tls"
)

func InitClient(proxy string, cfg Config) (*http.Client, error) {
Expand All @@ -20,13 +22,13 @@ func InitClient(proxy string, cfg Config) (*http.Client, error) {
Timeout: time.Second * time.Duration(cfg.ProxySettings.Timeout),
Transport: &http.Transport{
TLSClientConfig: &tls.Config{
MinVersion: tls.VersionTLS13,
CipherSuites: []uint16{0x1301, 0x1302, 0x1303, 0xc02b, 0xc02f, 0xc02c, 0xc030, 0xcca9, 0xcca8, 0xc013, 0xc014, 0x009c, 0x009d, 0x002f, 0x0035},
MaxVersion: tls.VersionTLS13,
CipherSuites: cipherSuites(),
InsecureSkipVerify: true,
CurvePreferences: []tls.CurveID{0x001d, 0x0017, 0x0018},
CurvePreferences: curves(),
},
DisableKeepAlives: cfg.OtherSettings.DisableKL,
ForceAttemptHTTP2: true,
DisableKeepAlives: cfg.OtherSettings.DisableKL,
},
}
if proxy == "" {
Expand Down Expand Up @@ -58,15 +60,59 @@ func InitClient(proxy string, cfg Config) (*http.Client, error) {
Transport: &http.Transport{
TLSClientConfig: &tls.Config{
MinVersion: tls.VersionTLS13,
CipherSuites: []uint16{0x1301, 0x1302, 0x1303, 0xc02b, 0xc02f, 0xc02c, 0xc030, 0xcca9, 0xcca8, 0xc013, 0xc014, 0x009c, 0x009d, 0x002f, 0x0035},
CipherSuites: cipherSuites(),
InsecureSkipVerify: true,
CurvePreferences: []tls.CurveID{0x001d, 0x0017, 0x0018},
CurvePreferences: curves(),
},
DisableKeepAlives: cfg.OtherSettings.DisableKL,
ForceAttemptHTTP2: true,
DisableKeepAlives: cfg.OtherSettings.DisableKL,
Proxy: http.ProxyURL(proxyURL),
},
}
return Client, nil
}

func cipherSuites() []uint16 {
var cipherSuites []uint16
cipherSuites = append(cipherSuites, pickRandom([]uint16{0x1301, 0x1302, 0x1303}, 1)...)
cipherSuites = append(cipherSuites, pickRandom([]uint16{0x0005, 0x000a, 0x002f, 0x0035, 0x003c, 0x009c, 0x009d, 0xc007, 0xc009, 0xc00a, 0xc011, 0xc012, 0xc013, 0xc014, 0xc023, 0xc027, 0xc02f, 0xc02b, 0xc030, 0xc02c, 0xcca8, 0xcca9}, 3)...)
return cipherSuites
}

func curves() []tls.CurveID {
x := pickRandom([]uint16{0x001d, 0x0017, 0x0018, 0x0019}, 1)
var p []tls.CurveID
for i := 0; i < len(x); i++ {
p = append(p, tls.CurveID(x[i]))
}
return p
}

func pickRandom(array []uint16, minimum int) []uint16 {
var results []uint16
s := shuffle(array)
var newArray []uint16
for i := 0; i < len(array); i++ {
if i < minimum {
results = append(results, s[i])
} else {
newArray = append(newArray, s[i])
}
}
if minimum == len(array) {
return results
}
r := rand.Intn(len(newArray))
for i := 0; i < r; i++ {
results = append(results, newArray[i])
}
return results
}

func shuffle(array []uint16) []uint16 {
for i := len(array) - 1; i > 0; i-- {
j := rand.Intn(i + 1)
array[i], array[j] = array[j], array[i]
}
return array
}
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
)

func main() {
version := "1.10.15"
version := "1.10.16"
rand.Seed(time.Now().UTC().UnixNano())
color.Blue.Printf(logo + " v" + version + "\n")
color.Green.Printf("Made by https://github.com/V4NSH4J\nStar repository on github for updates!\n")
Expand All @@ -27,7 +27,7 @@ func main() {

// Options menu
func Options() {
utilities.PrintMenu([]string{"Invite Joiner", "Mass DM", "Single DM", "Reaction Adder", "Email:Password:Token to Token", "Token Checker", "Guild Leaver", "Token Onliner", "Scraping Menu", "Name Changer", "Avatar Changer", "Token Server Checker", "Bio Changer", "DM on Reaction", "Hypesquad Changer", "Token Password Changer", "Embed Maker", "Login into Token", "Token Nuker", "Button Presser", "Server Nickname Changer", "Friend Request Spammer", "Friends Mass DM [BETA]","Credits & Help", "Exit"})
utilities.PrintMenu([]string{"Invite Joiner", "Mass DM", "Single DM", "Reaction Adder", "Email:Password:Token to Token", "Token Checker", "Guild Leaver", "Token Onliner", "Scraping Menu", "Name Changer", "Avatar Changer", "Token Server Checker", "Bio Changer", "DM on Reaction", "Hypesquad Changer", "Token Password Changer", "Embed Maker", "Login into Token", "Token Nuker", "Button Presser", "Server Nickname Changer", "Friend Request Spammer", "Friends Mass DM [BETA]", "Credits & Help", "Exit"})
choice := utilities.UserInputInteger("Enter your choice!")
switch choice {
default:
Expand Down

2 comments on commit d28b090

@ratelimit-thief
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sending to anti-abuse staff rn

@cateee69
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/fban

Please sign in to comment.