# \[Day 17] Secure Coding

For this challenge, The focus remains on secure coding practices as I look at methods to help file validation with user input. THM believes that regex is a tool to be used in helping secure some applications, of couse THM also believes there are other techniques and no one silver bullet.

## Flags

### Filtering for Usernames: How many usernames fit the syntax above?

8

`egrep '^[a-zA-Z0-9]{6,12}$' strings`

### Filtering for Usernames: One username consists of a readable word concatenated with a number. What is it?

user35

### Filtering for Emails: How many emails fit the syntax above?

11

`egrep '^.+@.+.com$' strings`

### Filtering for Emails: How many unique domains are there?

8

### Filtering for Emails: What is the domain of the email with the local-part "lewisham44"?

amg.com

### Filtering for Emails: What is the domain of the email with the local-part "maxximax"?

fedfull.com

### Filtering for Emails: What is the local-part of the email with the domain name "hotmail.com"?

hussain.volt

### Filtering for URLs: How many URLs fit the syntax provided?

16

`egrep '^http(s)?.{3}.+..+$' strings`

### Filtering for URLs: How many of these URLs start with "https"?

7

`egrep '^https.{3}.+..+$' strings`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://morell-tony.gitbook.io/home/capture-the-flag/tryhackme/thm-overview/advent-of-cyber-2022/day-17-secure-coding.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
