>_ IzzyLab

Hands-on task

This task is step 8 of the course “Investigating a server”

A web shell under a false name

hard~12 min

A web shell was uploaded to the site through the avatar upload form, and the attacker put a copy of it somewhere among the static files under a harmless name. In the /opt/webapp tree (including nested and hidden files) there are exactly two files with identical contents — the shell and its copy. Find them and write their full paths, one per line, to /root/webshell.txt.

What you'll practise:
  • checksums
  • md5sum
  • finding duplicates
  • find -exec
  • investigation

Topic breakdown

An attacker can rename a file however they like, but the contents give it away: files with identical bytes have identical checksums. Comparing all files pairwise is expensive, so you compute a hash of each (md5sum is fine for finding matches, though not for protection against forgery), sort them and pick out the repeated values. The files must be listed with find: shell globs don't see hidden files and don't descend into subdirectories. A matching size isn't evidence: two 64-byte files can be completely different.

What's checked

  1. both files with identical contents found

What it looks like