Re:Finding an arbitrary file upload vulnerability in a files...
by netsec_burn on Saturday May 13, 2017 @08:48PM
(#14333700)
Nice find, I commented on your blog a method you can use to extend this vulnerability into RCE without admin interactivity.
[ Parent
| on HN ]
Re:Finding an arbitrary file upload vulnerability in a files...
by gruez on Saturday May 13, 2017 @08:56PM
(#14333724)
>Upload a .py file to the untrusted directory that has the same name of one of the imports used in the Python script. It will be executed the next time Python is called by the script, so you don't need to wait for interactivity on the admins part
I have a feeling that only works on python2 because of absolute imports on python3.
Re:Finding an arbitrary file upload vulnerability in a files...
by gcr on Sunday May 14, 2017 @11:07AM
(#14335897)
Upload a script that replaces the old file source and wait for gunicorn or whatever to reload the app server.
Re:Finding an arbitrary file upload vulnerability in a files...
by gehaxelt on Sunday May 14, 2017 @03:46PM
(#14337229)
The script seems to ship with a rundimentary webserver by default, so I don't see a reason to wrap gunicorn et al. around it?
However, you're right that overwriting the source is a possible attack vector.
Re:Finding an arbitrary file upload vulnerability in a files...
by internetwache on Saturday May 13, 2017 @08:57PM
(#14333725)
Hi,
thanks for commenting!
I had cronjobs in mind, but as you said, they are not writeable.
I also thought about uploading a .py file with an import's name, but wouldn't that require a __init__.py (in a subdirectory?) to be regarded as a valid module/import by python?