added official hacktheboo2024 writeups
This commit is contained in:
parent
1f7a9b0566
commit
e3c46450f7
327 changed files with 14303 additions and 0 deletions
|
@ -0,0 +1,7 @@
|
|||
FROM registry.htbsvc.net/hackthebox/htb:coding_template
|
||||
|
||||
COPY --chown=root challenge/challenge.py /root/checker
|
||||
COPY --chown=root challenge/flag.txt /root/checker
|
||||
COPY --chown=www-data challenge/index.html /app/templates
|
||||
|
||||
EXPOSE 1337
|
34
htb/hacktheboo2024/coding/[Very Easy] oddly_even/README.md
Normal file
34
htb/hacktheboo2024/coding/[Very Easy] oddly_even/README.md
Normal file
|
@ -0,0 +1,34 @@
|
|||

|
||||
|
||||
|
||||
<img src='../../../../../assets/logo.png' style='zoom: 80%;' align=left /> <font size='10'>Oddly Even</font>
|
||||
|
||||
1<sup>st</sup> October 2024
|
||||
|
||||
Prepared By: ir0nstone
|
||||
|
||||
Challenge Author(s): ir0nstone
|
||||
|
||||
Difficulty: <font color='green'>Very Easy</font>
|
||||
|
||||
# Synopsis
|
||||
Given a number, print "even" if it is even and "odd" if it is odd.
|
||||
|
||||
## Skills Required
|
||||
* Basic Python
|
||||
|
||||
# Solution
|
||||
First, we take in the number:
|
||||
|
||||
```py
|
||||
a = int(input())
|
||||
```
|
||||
|
||||
We can then check if the number is divisible by `2`. If it is, we print "even", otherwise we print "odd".
|
||||
|
||||
```py
|
||||
if a % 2 == 0:
|
||||
print('even')
|
||||
else:
|
||||
print('odd')
|
||||
```
|
3
htb/hacktheboo2024/coding/[Very Easy] oddly_even/build_docker.sh
Executable file
3
htb/hacktheboo2024/coding/[Very Easy] oddly_even/build_docker.sh
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/bash
|
||||
docker build --tag=coding_oddly_even .
|
||||
docker run -p 1337:1337 --rm --name=coding_oddly_even -it coding_oddly_even
|
|
@ -0,0 +1,11 @@
|
|||
import random
|
||||
|
||||
def even_or_odd(n):
|
||||
if n % 2 == 0:
|
||||
return 'even'
|
||||
return 'odd'
|
||||
|
||||
def gen_question():
|
||||
n = random.randint(1, 100_000)
|
||||
|
||||
return f'{n}', f'{even_or_odd(n)}'
|
|
@ -0,0 +1 @@
|
|||
HTB{15_iT_0dD_oR_Is_iT_n0t?}
|
|
@ -0,0 +1,23 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}
|
||||
Oddly Even
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<p>
|
||||
Take in a number, print "odd" if odd and "even" if even.
|
||||
</p>
|
||||
{% endblock %}
|
||||
|
||||
{% block example_input %}
|
||||
<p>
|
||||
3
|
||||
</p>
|
||||
{% endblock %}
|
||||
|
||||
{% block example_output %}
|
||||
<p>
|
||||
odd
|
||||
</p>
|
||||
{% endblock %}
|
|
@ -0,0 +1,6 @@
|
|||
a = int(input())
|
||||
|
||||
if a % 2 == 0:
|
||||
print('even')
|
||||
else:
|
||||
print('odd')
|
Loading…
Add table
Add a link
Reference in a new issue