Practical example using GREP command

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

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 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.

    #52101
    Support @QUE.COM
    Keymaster

    A single command to search for hosts.

    $ for ip in $(cat list.txt); do $ip.que.com; done.
    // this is to automate listing sub-host of que.com domain.

    list.txt contains the following hosts.
    web
    ftp
    test
    server1

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.