πŸ‘¨β€πŸ’»
Jawad's Notes
  • πŸ‘¨β€πŸ«INFOSEC
    • πŸ•ΈοΈWeb
      • Burp Suite: Setting Foxyproxy
      • XSS
      • Wappalyzer
      • Directory Traversal
      • LFI
        • PHP Wrappers
        • RFI
      • Reverse Shell
        • Command Injection Quick Tips
      • File Upload
      • WPScan
      • SQL Injection
        • Schemas
        • SQLmap
        • MSSQL
        • MySQL
        • PostgreSQL
    • πŸ”§Tools
      • Whois
      • DNSRecon
      • DNSenum
      • nslookup
      • Netcat
        • Powercat
      • Nmap
        • Nmap Scripting Engine
        • Test-NetConnection
        • Grep
      • Server Message Block (SMB)
      • SNMP
      • SMTP
      • ExifTool
      • Search Engine Hacking
      • Source Control Hacking
      • Nessus
      • Canarytokens
      • Qualys SSL Server Test
      • Security Headers
      • theHarvester
      • Shodan
      • Gobuster
        • Dirb
      • Searchsploit
      • Password Cracking
        • Hashcat
        • John The Ripper
        • Hydra
        • hashID
        • CPU vs GPU
    • 🐧Linux
      • Symbols
      • cat
      • curl
      • openvpn
      • tcpdump
      • Remote Desktop
      • SmbShare
      • Tmux
      • Convert Windows-style line endings (CRLF) to Unix-style (LF)
      • SSH
    • πŸ–₯️Macros in Office
    • 🍎Enhancing Your MacOS Terminal Experience
    • 🚩CTF
      • SQL Injection
        • WHERE clause allowing retrieval of hidden data
        • Allowing login bypass
        • UNION attack, determining the number of columns returned by the query
        • UNION attack, finding a column containing text
        • UNION attack, retrieving data from other tables
        • UNION attack, retrieving multiple values in a single column
        • Querying the database type and version on Oracle
Powered by GitBook
On this page
  1. INFOSEC
  2. Linux

curl

curl is a versatile command-line tool used for making HTTP requests to transfer data between a client and a server. It supports various protocols, including HTTP, HTTPS, FTP, FTPS, SCP, SFTP, LDAP, and more. With a simple syntax, it enables users to retrieve, upload, and interact with data on the web, making it a powerful utility for web developers, system administrators, and security professionals. curl supports a wide range of options, allowing customization of requests and handling various authentication methods, making it a go-to tool for tasks like downloading files, testing APIs, and debugging network-related issues.

curl -i https://example.com

the -i will display both the headers and the body of the HTTP response.

Here's an example of a curl command for making a POST request with an Authorization header:

curl -X POST \
     -H "Authorization: Bearer YourAccessToken" \
     -H "Content-Type: application/json" \
     -d '{"key1": "value1", "key2": "value2"}' \
     https://api.example.com/endpoint

Explanation of the options used:

  • -X POST: Specifies the HTTP method as POST.

  • -H "Authorization: Bearer YourAccessToken": Adds an Authorization header with a Bearer token. Replace YourAccessToken with the actual access token.

  • -H "Content-Type: application/json": Sets the Content-Type header to indicate that the data being sent is in JSON format.

  • -d '{"key1": "value1", "key2": "value2"}': Provides the data payload for the POST request in JSON format.

  • https://api.example.com/endpoint: Specifies the URL endpoint where the POST request should be sent.

We can retrieve the robots.txt file from www.example.com with curl; robots.txt is a file used by websites to communicate with web crawlers or spiders, providing directives on which parts of the site should not be crawled or indexed; we can explore these paths to identify potentially hidden or forgotten content

kali@kali:~$ curl https://www.example.com/robots.txt
PreviouscatNextopenvpn

Last updated 1 year ago

πŸ‘¨β€πŸ«
🐧