0% found this document useful (0 votes)
8 views2 pages

Curl - Cheatsheet Data Base

This document is a cheat sheet for using curl in API testing and OSINT. It provides various curl commands for making GET, POST, PUT, and DELETE requests, as well as checking subdomains and headers. Additionally, it includes examples of using curl with jq for parsing and retrieving specific data from web pages.

Uploaded by

anonimwalker1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

Curl - Cheatsheet Data Base

This document is a cheat sheet for using curl in API testing and OSINT. It provides various curl commands for making GET, POST, PUT, and DELETE requests, as well as checking subdomains and headers. Additionally, it includes examples of using curl with jq for parsing and retrieving specific data from web pages.

Uploaded by

anonimwalker1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Cheat Sheet: curl untuk API Testing & OSINT (by Ayangmu)

Bagian 1: curl untuk API Testing

----------------------------------

1. GET request

curl -X GET https://example.com/api/data

2. POST request dengan JSON body

curl -X POST -H "Content-Type: application/json" -d '{"name":"Vania"}' https://example.com/api/data

3. PUT request untuk update data

curl -X PUT -H "Content-Type: application/json" -d '{"name":"Ayang"}'

https://example.com/api/data/1

4. DELETE request

curl -X DELETE https://example.com/api/data/1

5. Lihat header respon

curl -I https://example.com

6. Gabung dengan jq untuk parsing

curl -s https://jsonplaceholder.typicode.com/posts/1 | jq '.title'


Bagian 2: curl untuk OSINT & Subdomain Recon

----------------------------------------------

1. Cek apakah subdomain hidup

curl -s -o /dev/null -w "%{http_code}" https://sub.example.com

2. Cek redirect

curl -I -L https://target.com

3. Enumerasi subdomain dari list.txt

for sub in $(cat list.txt); do

curl -s -o /dev/null -w "$sub -> %{http_code}\n" https://$sub.example.com

done

4. Cek header lengkap dari domain

curl -s -D - https://example.com

5. Ambil konten halaman (HTML/JS)

curl https://target.com/page.js

6. Cek title halaman

curl -s https://example.com | grep -i "<title>"

You might also like