TIPS - Curl

De PedroWiki
Révision datée du 25 septembre 2023 à 14:24 par Jules (discussion | contributions)

Introduction

This article lists a few ways to call curl, depending on your need.

Curl calls

Fake the DNS resolution

Use case:

  • your website is behind a WAF and the FQDN resolves to it instead of the web server directly (the origin).
  • your website is behind a reverse proxy, but you want to access the underlying web service with appropriate host header in your request.
curl --resolv <my.domain>:443:<IP> https://<my.domain>[/<my_uri>]

Add a request header

Curl option: -H

Sample call:

curl -IL -H '<header name>:<header value>' https://<URL to curl>