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()) |
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 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 |
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']} |