Advent of Cyber 2022

Advent of Cyber 2022 is forth yearly advent calendar full of beginner level Cybersecurity challenges.

Day 1 - Someone’s coming to town!

Security frameworks are documented processes that define policies and procedures.

Kill Chain

In

Trough

Out

Daily Answers

The Bandit Yeti
THM{IT'S A Y3T1 CHR1$TMA$}

Day 2 - Santa’s Naughty & Nice Log

Logs

Daily Answers

2
webserver.log
Friday
10.10.249.191
santaslist.txt
THM{STOLENSANTASLIST}

Day 3 - Nothing escapes detective McRed

OSINT

Techniques

Google Dorks

WHOIS Lookup

domain information can be found at who.is.

Robots.txt

Mainly disallowed directories

Data Breaches

HaveIBeenPwned

GitHub Repos

GitHub repositories can have sensitive information

Daily Answers

NAMECHEAP INC
{THM_OSINT_WORKS}
config.php
qa.santagift.shop
S@nta2022

Day 4 - Scanning through the snow

Scanning

Typically automated set of procedures for identifying live hosts, ports and services. Discover OS’s of target and find vulnerabilities that could be exploited.

Types of scanning

Passive Scanning

Active Scanning

Techniques

Network Scanning

Complete network scan include:

Port Scanning

Detect open ports

Vulnerability scanning

Proactive automated scanning helps determine if system may be threatened or exploited. Nessus and Acunetix are common tools.

Tools

Network Mapper (NMAP)

Nikto - open source website vulnerability scanner

Daily Answers

Apache
ssh
{THM_SANTA_SMB_SERVER}
santa25

Day 5 - He knows when you’re awake

Common Remote Access Tools

Hydra

hydra -l username -P wordlist.txt server service

Daily Answers

1q2w3e4r
THM{I_SEE_YOUR_SCREEN}

Day 6 - It’s beginning to look a lot like phishing

Email Headers

Quick Email Analysis

Red Flags

emlAnalyzer -i /path-to-file/filename --header -u --text --extract-all - extract email attachments. sha256sum file - get sum

Tools

Daily Answers

[email protected]
[email protected]
Chief Elf
3
AoC2022_Email_Analysis
RISKY
Division_of_labour-Load_share_plan.doc
0827bb9a2e7c0628b82256759f0f888ca1abd6a2d903acdb8e44aca6a1a03467
Defense Evasion
macro_hunter

Day 7 - Maldocs roasting on an open fire

https://gchq.github.io/CyberChef

Regex

regex101.com Everything goes inside [] To escape characters use \ backshash.

Daily Answers

9.49.0
10
mysterygift.exe
hxxps[://]cdn[.]bandityeti[.]THM/files/index/
THM_MYSTERY_FLAG

Day 8 - Last Christmas I gave you my ETH

Remix IDE is safe and controlled enviroment for testing smart contracts

Daily Answers

flag{411_ur_37h_15_m1n3}

Day 9 - Dock the halls

Pivoting

Once an attacker gains initial entry into a system, the compromised machine can be used to send additional web traffic through - allowing previously inaccessible machines to be reached.

Metasploit

Start metasploit with msfconsole command.

Meterpreter

Docker

Credential are stored usually in following places:

Container don’t have ip -a or ifconfig commands. Typically, container host is located in 172.17.0.1.

Daily Answers

80
Laravel
CVE-2021-3129
sessions -u -1
/.dockerenv
.env
users
p4$$w0rd
22,80
THM{47C61A0FA8738BA77308A8A600F88E8B}

Extra


Day 10 - You’re a mean one, Mr. Yeti

Memory Exploitation

Cetus is a browser plugin that allows to explore and modify memory space of Web Assembly games.

To find the memory address of the number Guard is thinking first guess wrong and find that string. You can modify or read that address in bookmarks.

To find Health of the Elf scan memory for LT - Lower Than values and after that take hit and repeat until only few results are left.

Daily Answers

THM{5_star_Fl4gzzz}
THM{yetiyetiyetiflagflagflag}

Day 11 - Not all gifts are nice

Memory Forensics

Memory forensics is the analysis of the volatile memory that is in use when a computer is powered on

Volatility

Official Documentation

Commands:

Scan Types:

Flags:

Daily Answers

10
mysterygift.ex
2040
16

Day 12 - Forensic McBlue to the REVscue!

Malware

Malware is software created to harm a computer or an entire network.

Usual behaviour:

Handling a malware sample is dangerous.

Static Analysis:

Dynamic Analysis:

Basic Static Analysis

Detect It Easy

Daily answers


Day 13 - Simply having a wonderful pcap time

Daily Answers


Day 14 - I’m dreaming of secure web apps

Daily Answers


Day 15 - Santa is looking for a Sidekick

Unrestricted File Upload

Possible exploits:

How to fix?

Daily Answers


Day 16 - SQLi’s the king, the carolers sing

Preventing SQLi’s:

Injections:

Daily Answers


Day 17 - Filtering for Order Amidst Chaos

Input Validation

Using pattern:

<input type="email" id="email" name="email" pattern=".+@tryhackme\.com">

Regex

square brackets match one character:

Any vowel: [aeiou] Any letter: [a-zA-Z] Any lower case letter or number: [a-z0-9]

Operations

Examples

Unique Case of Free-Form Text

OWASP cheat sheet

  1. Ensure no invalid characters are present through proper encoding
  2. Whitelist expected characters and character sets

Daily Answers


Day 18 - Lumberjack Lenny Learns New Rules

Sigma

Sigma makes it easy to perform content matching based on collected logs to raise threat alerts

YAML

title: Suspicious Local Account Creation
id: 0f06a3a5-6a09-413f-8743-e6cf35561297
status: experimental
description: Detects the creation of a local user account on a computer.
logsource:
  product: windows
  service: security
detection:
  selection:
    EventID: # This shows the search identifier value
      - 4720 # This shows the search's list value
  condition: selection
falsepositives:
  - unknown
level: low
tags:
  - attack.persistence # Points to the MITRE Tactic
  - attack.T1136.001 # Points to the MITRE Technique

Daily Answers


Day 19 - Wiggles go brrr

Communication Protocols

USART

Universal Syncronous/Asyncronous Receiver Transmitter (USART) communication aka serial connection is protocol that uses two wires. One transmit data TX, other receives RX. It is the most common data transmission protocol in hardware level.

SPI

Serial Peripheral Interface is mainly used for communications between microprocessors and peripherals like sensor or SD card.

I2C

Inter-Integrated Circuit

Daily Answers


Day 20 - Binwalkin’ around the Christmas tree

Firmware

Set of instructions running on the hardware’s processor. Enables hardware to communicate with other software running on the device

Firmware reversing

Steps:

  1. Get firmware from vendors website or extract it from device
  2. Analyse firmware (binary) type 2.1. Metal or OS based?
  3. Is firmware encrypted or packet? 3.1 Side channel attacks
  4. Once encrypted reverse engineering can be done ls -alh *

Analysis

Static Analysis

Examination of the binary file contents, performing its reverse engineering, and reading the assembly instructions to understand the functionality.

Tools:

Dynamic Analysis

Running the firmware code on actual hardware, observing its behaviour through emulation and hardware/ software based debugging

Tools:

Daily Answers


Day 21 - Have yourself a merry little webcam

MQTT

{".html":"10","url":"rtsp://10.10.97.82:8554/randompath"}

Daily Answers


Day 22 - Threats are failing all around me

Some attack vectors:

Attack surface:

Daily Answers


Day 23 - Mission ELFPossible: Abominable for a Day

Daily Answers


Day 24 - Ho, ho, ho, the survey’s short

GG’s, 24 days of challenges are finally over, and it is Christmas. Had lots of fun and learned some new things.

Daily Answers