Find file running on python port hosting

Solution 1:

lsof should have told you the PID of the process. Let's call it $pid. Investigate what is inside /proc/$pid/. Some of the following commands may require root access (i.e. you may want to sudo su - beforehand).

cd /proc/$pid
readlink exe      # the executable
readlink cwd      # current working directory
xxd cmdline       # command line (xxd useful because items are null-separated)

cd /proc/$pid/fd
ls -l             # file descriptors in use

Additionally interact with the server (e.g. download the file) while using strace to see what it does. See this answer: how to investigate what a process is doing?

Or you can download the file and try to find a duplicate by comparing the content. Preliminary comparison by size may speed things up greatly.

file="/path/to/the/downloaded/file"
size=`<"$file" wc -c`

# now you will probably want to use sudo
find / -type f ! -path "/proc/*" ! -path "/sys/*" ! -path "/dev/*" -size ${size}c -exec cmp -s "$file" {} \; -print

unset -v file size    # just to clean

Note I excluded /proc/, /sys/ and /dev/. You may also get familiar with -xdev (see man 1 find) and use it maybe.