Skip to content

Commit

Permalink
Add the ability to pre bake a token
Browse files Browse the repository at this point in the history
  • Loading branch information
elcuervo committed May 30, 2020
1 parent 9a1a4f8 commit 2c4aa74
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 10 deletions.
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ WINDOWS=$(EXECUTABLE)_windows_amd64.exe
LINUX=$(EXECUTABLE)_linux_amd64
DARWIN=$(EXECUTABLE)_darwin_amd64
VERSION=$(shell git describe --tags --always --long --dirty)
LDFLAGS=-s -w -X main.version=$(VERSION) -X main.baked=$(TOKEN)

.PHONY: all clean proto

Expand All @@ -15,19 +16,22 @@ linux: $(LINUX)

darwin: $(DARWIN)

no:
unset -v TOKEN

proto:
protoc --go_out=proto meeting.proto

build: windows linux darwin
@echo version: $(VERSION)

$(WINDOWS):
env GOOS=windows GOARCH=amd64 go build -o $(BUILD_PATH)/$(WINDOWS) -ldflags="-s -w -X main.version=$(VERSION)" .
env GOOS=windows GOARCH=amd64 go build -o $(BUILD_PATH)/$(WINDOWS) -ldflags="$(LDFLAGS)" .
@chmod +x $(BUILD_PATH)/$(WINDOWS)
zip -r $(BUILD_PATH)/$(WINDOWS).zip $(BUILD_PATH)/$(WINDOWS)

$(LINUX):
env GOOS=linux GOARCH=amd64 go build -o $(BUILD_PATH)/$(LINUX) -ldflags="-s -w -X main.version=$(VERSION)" ./
env GOOS=linux GOARCH=amd64 go build -o $(BUILD_PATH)/$(LINUX) -ldflags="$(LDFLAGS)" ./
@chmod +x $(BUILD_PATH)/$(LINUX)
tar cfz $(BUILD_PATH)/$(LINUX).tgz $(BUILD_PATH)/$(LINUX)

Expand Down
34 changes: 26 additions & 8 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,17 @@ const logo = `

const zoomUrl = "https://www3.zoom.us/conf/j"

// added at compile time
var version string
var baked string

var token = flag.String("token", os.Getenv("TOKEN"), "zpk token to use")
var color aurora.Aurora
var tangalanga *Tangalanga
var wg sync.WaitGroup
var ids chan int
var start time.Time

var token = flag.String("token", availableToken(), "zpk token to use")
var colorFlag = flag.Bool("colors", true, "enable or disable colors")
var censorFlag = flag.Bool("censor", false, "enable or disable stdout censorship")
var outputFile = flag.String("output", "", "output file for successful finds")
Expand All @@ -46,12 +54,6 @@ var proxyAddr = flag.String("proxy", "socks5://127.0.0.1:9150", "socks url to us
var hiddenFlag = flag.Bool("hidden", false, "connect via embedded tor")
var rateCount = flag.Int("rate", runtime.NumCPU(), "worker count. defaults to CPU count")

var color aurora.Aurora
var tangalanga *Tangalanga
var wg sync.WaitGroup
var ids chan int
var start time.Time

func init() {
var t *http.Transport

Expand All @@ -69,6 +71,9 @@ func init() {
fmt.Printf("%s is required.\n", color.Red("-token="))
fmt.Println()

fmt.Printf("%s can also be defined in the ENV.\n", color.Red("TOKEN"))
fmt.Println()

info := "token can be found by sniffing the traffic trying to join any meeting\n" +
"currently i can't find how the token is generated but any lives for ~24 hours.\n" +
"the token can be found as part of the Cookie header.\n" +
Expand Down Expand Up @@ -116,6 +121,17 @@ func init() {

}

func availableToken() string {
switch {
case os.Getenv("TOKEN") != "":
return os.Getenv("TOKEN")
case baked != "":
return baked
default:
return ""
}
}

func randId() int {
min := 50000000000 // Just to avoid a sea of non existent ids
max := 99999999999
Expand Down Expand Up @@ -232,7 +248,9 @@ func main() {
if tangalanga.ExpiredToken {
m := "the %s expired, you need to sniff join traffic for a new one\n"
fmt.Printf(m, color.Red("token"))
fmt.Println()

m = "you need to pass %s with the new token\n"
fmt.Printf(m, color.Red("-token="))
c <- syscall.SIGINT
}

Expand Down

0 comments on commit 2c4aa74

Please sign in to comment.