Concepts / Web access and file flaws

Web access and file flaws

Unrestricted file upload

Also called web shell upload, arbitrary file upload

Letting a user upload any file with no check on its type, so attacker code can be stored on the server.

Upload a script, then open it
Upload a script, then open it

The server saves the file without checking its type. When the attacker requests the stored file, the server runs it as code.

Unrestricted file upload is an upload form that saves any file without checking its type. An attacker uploads a web shell, a script that runs commands for whoever opens it. If the server executes that file type (.php, .jsp, .aspx), opening the stored file runs the attacker's code. The fix: an allow-list of file types, uploads stored outside any folder the server executes, and names the server chooses.

See it on real machines

Read next

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Sign in with Google or email to start.

Start this lab