githubEdit

curl

Command-line tool for transferring data with URLs. Essential for web pentesting.


Basic Usage

# Simple GET request
curl http://TARGET

# Download file
curl -O http://TARGET/file.txt

# Download with custom name
curl -o output.txt http://TARGET/file.txt

# Silent mode (no progress)
curl -s http://TARGET

# Follow redirects
curl -L http://TARGET

Viewing Headers & Verbose


Request Methods


POST Data

Form Data (application/x-www-form-urlencoded)

JSON Data

File Upload


Headers


Authentication

Basic Auth

Bearer Token


SSL/TLS


Proxy


Output Control


Useful Options

Flag
Description

-s

Silent (no progress)

-S

Show errors (use with -s)

-L

Follow redirects

-I

HEAD request (headers only)

-i

Include response headers

-v

Verbose

-k

Ignore SSL errors

-X

Request method

-d

POST data

-F

Form data (multipart)

-H

Add header

-A

User-Agent

-e

Referer

-b

Send cookies

-c

Save cookies

-u

Basic auth

-x

Proxy

-o

Output file

-O

Save with remote name

--connect-timeout

Connection timeout

--max-time

Max operation time


HTTP Methods Reference

Method
Description

GET

Retrieve resource

POST

Submit data (create)

PUT

Update/replace resource

PATCH

Partial update

DELETE

Remove resource

HEAD

Headers only (no body)

OPTIONS

Get allowed methods


Status Codes Quick Reference

Code
Meaning

200

OK

201

Created

301

Moved Permanently

302

Found (redirect)

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

405

Method Not Allowed

500

Internal Server Error

502

Bad Gateway

503

Service Unavailable


Common Pentest Commands


CRUD API Example


URL Structure Reference

Component
Example
Notes

Scheme

http://, https://

Protocol

User Info

admin:password@

Basic auth in URL

Host

example.com

Domain or IP

Port

:8080

Default: 80 (http), 443 (https)

Path

/path/file.php

Resource location

Query String

?param=value

GET parameters

Fragment

#section

Client-side only

Last updated