Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function exec_curl($ch, $url, $post = null) {
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
- return curl_exec($ch);
- }
- function ping($ip) {
- exec("ping $ip -l 0 -n 1", $outcome, $status);
- return $status == 0;
- }
- if (!ping("www.google.com")) {
- $ch = curl_init();
- $url = "http://192.168.1.1";
- $post = "username=admin&password=admin";
- exec_curl($ch, $url, $post);
- $url = "http://192.168.1.1/form2Reboot.cgi";
- $post = "rebootMode=0&reboot=Reiniciar&submit.htm%3Freboot.htm=Send";
- exec_curl($ch, $url, $post);
- exit(1);
- }
- exit(0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement