Skip to content

Instantly share code, notes, and snippets.

@boopathi
Last active Dec 19, 2015
Embed
What would you like to do?
A webpage was trying to get users login details of gmail. So I thought I would just play around. Find the url from the code
package main
import (
"fmt"
"net/http"
"net/url"
"time"
)
type A struct {
i int
s string
}
func main() {
u := "http://artmmv.com/google/gmail.php"
n:=100
c:= make(chan A)
count:=0
timeout:=time.After(60 * time.Second)
for i:=0;i<n;i++ {
go func(x int) {
s := " : "
_, err := http.PostForm(u, url.Values{
"gmailuser": {"FuckYou"},
"gmailpassword": {"Bastard"},
"continue": {"continue"},
})
if err != nil {
s = s + " ::ERROR:: " + string(err.Error())
c <- A{x,s}
return
}
s = s + " Done"
c <- A{x, s}
}(i)
}
fmt.Println("Request started sending... Waiting for output")
for {
select {
case s := <-c:
fmt.Println(s.i, s.s)
count++
if count == n {
fmt.Println("All requests done")
return
}
case <-timeout:
fmt.Println("Timeout")
return
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment