Created
March 20, 2018 09:32
-
-
Save JanDeDobbeleer/bd0d7ea6d08b8a90422c5ff8bd8794bc to your computer and use it in GitHub Desktop.
Break the egg
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" | |
"io/ioutil" | |
"net/http" | |
"net/url" | |
"strings" | |
) | |
func main() { | |
for { | |
run() | |
} | |
} | |
func run() { | |
v := url.Values{} | |
v.Set("clicks", "50") | |
s := v.Encode() | |
req, err := http.NewRequest("POST", "http://playground.mnm.be/peterpaaseiei/ajax/breaktheegg.php", strings.NewReader(s)) | |
if err != nil { | |
fmt.Printf("Error: %v\n", err) | |
return | |
} | |
req.Header.Add("Content-Type", "application/x-www-form-urlencoded") | |
c := &http.Client{} | |
resp, err := c.Do(req) | |
if err != nil { | |
fmt.Printf("Error: %v\n", err) | |
return | |
} | |
defer resp.Body.Close() | |
data, err := ioutil.ReadAll(resp.Body) | |
if err != nil { | |
fmt.Printf("Error: %v\n", err) | |
return | |
} | |
fmt.Println(string(data)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment