> For the complete documentation index, see [llms.txt](https://morell-tony.gitbook.io/home/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://morell-tony.gitbook.io/home/capture-the-flag/tryhackme/thm-overview/advent-of-cyber-2022/day-17-secure-coding.md).

# \[Day 17] Secure Coding

December 17, 2022

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`
