adduser --system coredns --home /var/lib/coredns
Create /etc/systemd/system/coredns.service
:
[Unit]
Description=CoreDNS DNS server
Documentation=https://coredns.io
After=network.target
[Service]
import httpx | |
from flask import Flask | |
app = Flask(__name__) | |
def ctfd_to_ctftime(data): | |
for row in data: | |
if row['account_type'] == 'team': | |
yield {'pos': row['pos'], 'team': row['name'], 'score': row['score']} |
import asyncio | |
TARGET_IP = '1.2.3.4' | |
async def print_lines(port, process): | |
while True: | |
line = await process.stdout.readline() | |
if not line: | |
print(f"[{port}]: Died?") | |
break |
adduser --system coredns --home /var/lib/coredns
Create /etc/systemd/system/coredns.service
:
[Unit]
Description=CoreDNS DNS server
Documentation=https://coredns.io
After=network.target
[Service]
import trio | |
DOMAIN = "example.com" | |
PATH = "/" | |
async def main(): | |
s0 = await trio.open_ssl_over_tcp_stream(DOMAIN, 443, https_compatible=True) | |
# Request a connection to the website | |
await s0.send_all(f"GET {PATH} HTTP/1.1\r\nHost: {DOMAIN}\r\n\r\n".encode()) |
TL;DR: Grab this value jq -r '.location' $(sudo -u caddy caddy environ | awk -F'=' '/^caddy.AppDataDir=/{print $2"/acme/acme-v02.api.letsencrypt.org-directory/users/*/caddy.json"}')
and jump to step 4.
In your Caddyfile
you should add an email to the Global Options Block:
{
email [email protected]
}
import httpx | |
from flask import Flask, request | |
URL = 'http://example.com/vuln' | |
client = httpx.Client(http2=True) | |
app = Flask(__name__) | |
@app.route("/vuln") | |
def hello_world(): | |
param = request.args['q'] |
version: '3.8' | |
services: | |
web: | |
build: ./ | |
ports: | |
- "5000:80" | |
depends_on: | |
- memcached |
import angr | |
proj = angr.Project("./chal", auto_load_libs=False) | |
state = proj.factory.entry_state() | |
simgr = proj.factory.simulation_manager(state) | |
simgr.explore(find=lambda s: b"Correct!" in s.posix.dumps(1)) | |
# Out[6]: <SimulationManager with 2 active, 34 deadended, 1 found> | |
print(simgr.found[0].posix.dumps(0)) |
import trio # python3 -m pip install --upgrade trio | |
HTML = "<html>Hello World!</html>" | |
HTTP_BANNER = f"HTTP/1.1 200 OK\nContent-Length: {len(HTML)+1}\n\n{HTML}\n".encode() | |
async def forward_from_a_to_b(a, b): | |
async for chunk in a: | |
print(f"=> {chunk}", flush=True) | |
await b.send_all(chunk) |
/* | |
Code to unlock all (176) levels: | |
* face3 (sad face) | |
* radioactive_ring | |
* triangle | |
* skull | |
* square | |
*/ | |
import java.util.Arrays; | |
import java.util.Random; |