top of page
book of spells.webp

Start your journey towards mastering the CLI with our FREE Command Line Book of Spells.

By entering your email address you agree to receive emails from Command Line Wizardry. We'll respect your privacy and you can unsubscribe at any time.

Cybersecurity Ops with bash - Chapter 13 Solutions

  • Writer: Cybersecurity Ops with bash
    Cybersecurity Ops with bash
  • Apr 15, 2019
  • 1 min read

Below are selected solutions for the Chapter 13 workshop questions from Cybersecurity Ops with bash. Note - These are just examples, many possible solutions exist.


Question 1


Create a pipeline of commands that uses curl to retrieve a web page and then display any email addresses found on the page to the screen.


Answer


You can pipe the output from curl into grep to extract standard format email addresses.


The -s option for curl disables the status message.


The -P option for grep enables the Perl regular expression engine, and the -o option only outputs the part of the line that matches the given expression.


The regular expression is long, so lets break it down.


The first section of the expression matches the local-part of an email address. For example, if an email address is test@digadel.com, test is considered the local-part. This part of the email address can contain many, but not all of the printable characters.


The next part of the expression is the @ symbol, which separates the local-part and domain of an email address.


The last part of the expression is the domain portion of the email address. The domain portion can only contain letters, numbers, and the period and dash characters.


Note that this is not a perfect regular expression, and it may match on items that are similar to an email address. This method will not work if the email address is constructed on the client side using JavaScript or a similar technique since curl does not actually render the web page.

 
 
 

3 hozzászólás


Bagas31 pk
Bagas31 pk
máj. 31.

Visit Bagas31 today to start downloading powerful tools for free.

Kedvelés

Mawto Org
Mawto Org
máj. 24.

Sigma4PC is the best source to download paid software for free.

Kedvelés

Kms Pico
Kms Pico
máj. 22.

O kmspico Ativador é perfeito para quem quer se livrar da mensagem “Windows não ativado”. O kmspico Ativador é confiável e utilizado por milhões de usuários. A ativação com o kmspico Ativador é feita em questão de segundos. Ao usar o kmspico Ativador, seu sistema se torna original sem custo. O kmspico Ativador não prejudica a performance do computador. Nossa equipe testa todas as versões do kmspico Ativador para garantir segurança. Com o kmspico Ativador, é possível ativar também o Office com facilidade. O kmspico Ativador é livre de anúncios, vírus e spywares. Você encontra o kmspico Ativador atualizado em nosso site. O processo do kmspico Ativador é totalmente automático. Com o kmspico Ativador, seu sistema fica livre de limitações. Use agora o kmspico Ativador e aproveite o melhor…

Kedvelés
bottom of page