Skip to content

Instantly share code, notes, and snippets.

View dgavshin's full-sized avatar
🐈
"><script>alert(1)</script>

Daniil Gavshin dgavshin

🐈
"><script>alert(1)</script>
View GitHub Profile
@dgavshin
dgavshin / wg-openwrt.sh
Created February 19, 2024 22:27
A script that parses the Wireguard configuration input file and configures OpenWRT firewall rules
#!/bin/sh
# Parse wireguard config file and setup OpenWRT firewall rules
FILE=$1
if [ -z $FILE ]; then
echo "Usage: $0 <config-file>"
exit 1
fi
@dgavshin
dgavshin / node_option.patch
Created December 3, 2021 16:06
This patch repair Packmate application
index c34419c..e0a101a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
src/main/resources/static/*
*.pcap
docker/postgres_data
+/data/
HELP.md
@dgavshin
dgavshin / install-ad-suricata-binary.sh
Last active August 18, 2021 10:40
Install and configure suricata as IPS from binaries
#!/bin/bash
SURICATA_LOGS=/var/log/suricata
SURICATA_CONF=/etc/suricata/suricata.yaml
SURICATA_RULES=/etc/suricata/rules
apt-get update
apt-get install net-tools wget git
read_ports() {
@dgavshin
dgavshin / custom.rules
Last active June 19, 2021 22:32
Suricata IPS rules for attack&defence game
drop tcp $HOME_NET $SERVICE_PORTS -> $EXTERNAL_NET any (msg:"Multiple flags leak detected"; pcre:"/(?:[A-Z0-9]{31}=.*){5,}/s"; sid:101; rev:1;)
@dgavshin
dgavshin / install-ad-suricata-sources.sh
Last active June 19, 2021 22:35
Install suricata 6.0.2 and configure it as IPS NFQUEUE from sources, enable Attack&Defense rules
VERSION=6.0.2
apt-get update
# netstat, ifconfig
apt-get install net-tools
apt-get install wget git
# Recomended packages for suricata

sutdCTF writeups

Почти все задания были решены, поэтому здесь будет рассказано о том, как решить таски с помощью python3. Советую установить и посмотреть, как он устроен. Установить несложно, потом просто в поиске винды ищете IDLE и тыкаете команды (не забывайте про табуляцию, в питоне это важно), которые внизу увидете. В цтфах очень часто важна скорость, в этом питон помогает, он несложный и имеет много модулей.

Strange numbers

Таск ведет нас на сайт, там строка из чисел похожая на флаг, похоже что каждый символ переведен в число по таблице ASCII. Окей, пишем на питоне следующий скрипт

flag = "115 117 116 100 67 84 70 { 104 51 114 51 95 49 53 95 102 108 52 103 }"
splitted_flag = flag.split(" ") # делим строку на массив, делитель - пробел
# получается в splitted_flag теперь такое ['115', '117', '116', ..., '103']