-F
(or --form
) flag and you then continue and add one -F for every input field in the form that you want to send.d74496d66958873e
but you will, of course, get something different when you run curl (or when you submit such a form with a browser).--
appended to signal the end.multipart/form-data
and then specifies the MIME boundary string. That content-type is the default for multipart formposts but you can, of course, still modify that for your own commands and if you do, curl is clever enough to still append the boundary magic to the replaced header. You cannot really alter the boundary string, since curl needs that for producing the POST stream.-H
like this:nc
locally to listen on a chosen port number, change the action
URL to submit the POST to your local nc
instance. Submit the form and watch how nc
shows it. Then translate into a curl command line.<form>
to -F<form>
that uses enctype="multipart/form-data"
, the first step is to find the action=
property as that tells the target for the POST. You need to convert that into a full URL for your curl command line.https://example.com/user/login
the action=submit.cgi
is a relative path within the same "directory" as the form itself. The full URL to submit this form thus becomes https://example.com/user/submit.cgi
. That is the URL to use in the curl command line.<input>
tag used within the form, including the ones that are marked as "hidden". Hidden just means that they are not shown in the web page, but they should still be sent in the POST.<input>
in the form there should be a corresponding -F
in the command line.@
and the path to the file to include:<input>
tags as type="hidden"
. This is basically the same thing as an already filled in form field, so you convert this to a command line by using the name and value. For example:<input>
tags showed in the examples above were used in the same <form>
, then a complete curl command line to send, including the correct URL as extracted above, would look like: