Last active
December 19, 2015 23:09
-
-
Save boopathi/6033072 to your computer and use it in GitHub Desktop.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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