uploader with the /go/uploader Command

Attackers often get into a website by uploading a file, such as a PHP shell, with a POST request. /go/uploader helps you find out who did it. It has two modes: In trace mode, it looks for requests from the last 7 days to the file's domain whose size is close to the file's size, and that happened within 30 seconds of the time the file was last changed. The request gives you the visitor's IP address, which you can then block. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.

Quick start

# POST requests of the last 24 hours
/go/uploader

# Who uploaded this file?
/go/uploader /home/example.com/www/uploads/suspicious.php

Arguments

You type Mode Time window
Nothing List Last 24 hours
hour List Last hour
A whole number, such as 3600 List Last that many seconds. 604800 is 7 days.
One argument that is an existing file Trace Last 7 days, matched to the file
Anything else List Last 24 hours

[!WARNING]
A misspelled file path is not reported as an error. It is not an existing file, so it is treated as "anything else" and lists all POST requests of the last 24 hours.

Trace mode works only when you give exactly one argument. It assumes the file is under /home/<domain>/, because it takes the domain from the path.

Examples

# All POST requests of the last 24 hours
/go/uploader

# The last hour
/go/uploader hour

# The last 7 days
/go/uploader 604800

# Trace a file (run it from the file's folder, not from /)
cd /home/example.com/www/uploads
/go/uploader suspicious.php

# Turn a timestamp into a date
date -d @1732190000

Output

Every request is one row:

Column Meaning
1 The size of the request in bytes
2 The value in field 7 of the access log line
3 The time, as a Unix timestamp (list mode only)
4 The visitor’s IP address. When the log has a forwarded address, that is used. Otherwise the connecting address.
5 The host name, joined directly to the request, with no space between them

1534 200 1732190000 203.0.113.7 example.comPOST /upload.php HTTP/1.1

The values above are only an illustration.

Rows are sorted by size, smallest first. To read a timestamp, run date -d @1732190000.

Trace mode

Trace mode first prints:

  • the full path of any file named 88888888888.jpg found below the current folder
  • a line of dashes, then File Size: <bytes> (Excluding Header Size), then another line of dashes

Then it prints the matching rows, with columns 1, 2, 4, and 5 only. Column 5 is cut at its first word, so it shows the host name and method but not the URL. The command always ends with exit status 1.

See the full reference at /go/uploader and the GoAdmio command index.

GoAdmio is free and open source, with no license fees and no account limits. Read the GoAdmio docs, or see why it is a free cPanel alternative at goadmio.com.

By:

Posted in:


Leave a Reply

Your email address will not be published. Required fields are marked *