refabr1k's Pentest Notebook
  • refabr1k's Pentest Notebook
  • Steganography
  • Kali USB with persistence memory
  • useful tools
  • Understanding ICACLS permissions
  • INFO GATHERING
    • Port Knocking
    • 22 tcp - SSH
      • SSH Tunneling
    • 25 tcp - SMTP
    • 53 tcp/udp - DNS
    • 88 tcp - Kerberos
    • 161 udp - SNMP
    • 445 tcp - SMB
    • 1098,1099 tcp - Java RMI
    • 8009 tcp - AJP
    • 5901,5902 tcp - VNC
  • Web
    • XSS cookie stealing
    • PHP
    • Webdav
    • Wordpress
    • XML RPC
    • SQL Injection
    • SSRF
  • EXPLOITATION
    • File Transfers
    • Buffer Overflow
    • Bruteforce
      • Hashcat
      • Ophcrack (rainbow tables)
      • John The Ripper
    • PHP rce
    • Compiling
    • msfvenom
    • Reverse shell
    • Using ENV to escape Bad Characters
    • shellshock
    • Ncat Persistent Backdoor
  • PRIVESC - LINUX
    • Basic checks
    • Upgrading Shells
    • SUID
  • Privesc - Windows
    • Basic checks / powershell
    • Privesc Openings
    • LonelyPotato - SeImpersonatePrivilege
    • Enable RDP @ Firewall
    • NTLM (Pass The Hash)
  • Windows
    • NTDS.dit
    • Responder / SMB Relay
    • Attacking AD
      • AD Hacking Lab Setup
  • Metasploit
    • Basic Usage
    • Meterpreter
      • Pivoting
      • Windows Post Exploitation
  • Unsorted
    • other notes
  • eLearnSecurity eJPT
    • eJPT notes
  • OSWP
  • Getting started
  • WEP Attacks
    • WEP Attack (OPEN) - Clients connected
    • WEP Attack (OPEN) - Clientless
    • WEP Attack (SKA)
  • WPA/WPA2 Attacks
  • Scripts
    • get port from nmap
    • Curl response
    • ping sweep
    • iptables-counter.sh
    • (DNS) zonetransfer_check.sh
    • (DNS) dns-rev-brute.sh
    • (DNS) dns-fwd-brute.sh
    • (SMB) vuln-scan.sh
    • (SMB) samba-checker.sh
    • (SMTP) vrfy.py
    • (SNMP) mib-check.sh
  • Zeroday vulnerabilities explained
    • 2020-12 Solarwind supply chain
Powered by GitBook
On this page
  • Get http response codes using curl
  • read a list of domains and append http/https

Was this helpful?

  1. Scripts

Curl response

Bash scripts from elearn security course - ejpt

Get http response codes using curl

#curl script to get http response
curl -L --write-out "%{http_code}\n" --output /dev/null --silent --insecure http://hello.expiredssl.com

read a list of domains and append http/https

# cat domain.txt
# 127.0.0.1:1337
# www.google.com.sg

# myscript.sh
#!/bin/bash
while read line;
do
    echo $line
done < domains.txt

# ./myscript.sh
# 127.0.0.1:1337
# www.google.com.sg
# myscript.sh
#!/bin/bash
for protocol in 'http://' 'https://';do
    while read line;
    do
        echo $protocol$line
    done < domains.txt
done

#./myscript.sh
# http://127.0.0.1:1337
# http://www.google.com.sg
# https://127.0.0.1:1337
# https://www.google.com.sg
#!/bin/bash

for protocol in 'http://' 'https://'; do
    while read line;
    do
        code=$(curl -L --write-out "%{http_code}\n" --output /dev/null --silent --insecure $protocol$line)
        if [ $ code = "000" ]; then
            echo "$protocol$line: not responding"
        else
            echo "$protocol$line: HTTP $code"
            echo "$protocol$line: $code" >> alive.txt

        done < domains.txt
done

#./myscript.sh
# http://127.0.0.1:1337: not responding.
# http://www.google.com.sg: HTTP 200
# https://127.0.0.1:1337: not responding.
# https://www.google.com.sg. HTTP 200

# cat alive.txt
# http://www.google.com.sg: HTTP 200
# https://www.google.com.sg. HTTP 200
Previousget port from nmapNextping sweep

Last updated 4 years ago

Was this helpful?