Practical example using GREP command

QUE.com Forums 30 – Cyber Security Practical example using GREP command

Tagged: 

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #50832
    Support @QUE.COM
    Keymaster

    Listing all sub-domains.

    $ grep “href=” index.html | grep “\.yehey” | grep -v “www\.yehey\.com | awk -F “http://” ‘{print $2}’ | cut -d “/” -f 1
    This will list the following results.
    mail.yehey.com
    ssh.yehey.com
    beta.yehey.com
    .
    .

    Another options.
    $ grep -o ‘[^/]*\.yehey\.com’ index.html | sort -u > list.txt
    $ cat list.txt
    mail.yehey.com
    ssh.yehey.com
    beta.yehey.com
    .
    .

    Different command parameters, same results.

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.