Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
d0g3-lab committed Nov 28, 2018
1 parent c43aef1 commit 82ac75b
Show file tree
Hide file tree
Showing 248 changed files with 30,723 additions and 0 deletions.
Binary file added AXB-Writeup.pdf
Binary file not shown.
Binary file added Misc/RFID/download/data.zip
Binary file not shown.
Binary file added Misc/RFID/download/待修改.dump
Binary file not shown.
23 changes: 23 additions & 0 deletions Misc/RFID/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<p>
这里有几张ic卡的部分扇区的数据,你能根据这些数据,将待修改的卡片卡号改为2333333333,金额修改为233吗
</p>
<a href="download/data.zip">点击下载文件分析</a>
<br>
<a href="download/待修改.dump">点击下载待修改文件</a>
<p>
将待修改文件修改后上传获得flag哦
</p>
<form action="upload.php" method="post" enctype="multipart/form-data">
<label for="file">文件名:</label>
<input type="file" name="file" id="file"><br>
<input type="submit" name="submit" value="提交">
</form>

</body>
</html>
35 changes: 35 additions & 0 deletions Misc/RFID/upload.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php
echo "<meta charset='utf-8' >";
// 允许上传的后缀
$allowedExts = array("dump");
$temp = explode(".", $_FILES["file"]["name"]);
$extension = end($temp); // 获取文件后缀名
if (($_FILES["file"]["size"] < 2048)&& in_array($extension, $allowedExts)&&$_FILES["file"]['type']=="application/octet-stream")// 小于 2kb
{
if ($_FILES["file"]["error"] > 0)
{
echo "错误:: " . $_FILES["file"]["error"] . "<br>";
exit();
}
else
{
$file = $_FILES["file"]["tmp_name"];
$file_md5 = hash_file("md5", $file);
if($file_md5=="965133d930a741226555f9add418b071")
{
echo "给你flag:6f4798563957774c272ab852aea0f18e";
exit();
}
else
{
echo "文件不对,不能给你flag哦";
exit();
}

}
}
else
{
echo "非法的文件格式";
}
?>
Binary file added Misc/boooooom/boooooom.doc
Binary file not shown.
Binary file added Misc/boooooom/happy.zip
Binary file not shown.
2 changes: 2 additions & 0 deletions Misc/boooooom/题目链接.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
链接:https://pan.baidu.com/s/1op2O-9UhlTz_jkwO9xks0w
提取码:l98j
21 changes: 21 additions & 0 deletions Misc/寻找入侵者/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Misc 寻找入侵者
描述:蠢得发慌的运维一觉睡起来发现网站没了,你能帮他恢复网站并且找到入侵者嘛,他会给你一个flag作为报酬。

## 题目文件

## WriteUp
D0g3{182.61.19.74__is_hacker}

docker run -it -p222:22 xxxxx /bin/bash
/root/run.sh

检查web目录/var/www

1. 发现站点被删,留下被加密的备份文件
2. 使用scp或者docker cp命令将备份文件拉到本地
3. 根据提示把仅存的几个文件压缩,然后用已知明文爆破备份文件,密码为:fdragon
4. 解压后看到flag和flag1,flag文件说明了flag是由flag1和flag2拼接而成,同时得到flag1的内容:"D0g3{攻击者的ip"
5. 使用rkhunter等入侵检测工具或者根据经验查看crontab -e,查看到计划任务被篡改,找到/etc/.backdoor文件,得到提示:查看攻击者的网页。
6. 然后发现入侵者是182.61.19.74,网站是安洵注册页,查看源码,第二行有注释:“为什么不去找找另外一个后门的所在位置呢”
7. 遂根据crontab -e的内容,发现是ssh软连接,或者通过查看tcp端口,找到占用23333端口的进程,根据进程位置找到/tmp目录下的f1ag2
8. 拼接字符串得到flag:` D0g3{182.61.19.74__is_hacker} `
Binary file added Pwn/Meow.tar.gz
Binary file not shown.
Binary file added Pwn/Meow_source.tar
Binary file not shown.
Binary file added Pwn/hiahiahia.zip
Binary file not shown.
107 changes: 107 additions & 0 deletions Pwn/neko.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <asm/unistd.h>
#include <asm/stat.h>

int main()
{
char c;

setvbuf(stdout, 0, 2, 0);
setvbuf(stderr, 0, 2, 0);

printf("*************************************************\n");
printf(" /\\____/\\ __\n");
printf(" .' \"\"\"\" `,-' `--.__\n");
printf(" __,- : - - ; \" :: `-. -.__\n");
printf(" ,-sssss `._ `' _,'\" ,'~~~::`.sssss-.\n");
printf(" |ssssss ,' ,_`--'_ __,' :: ` `.ssssss|\n");
printf("|sssssss `-._____~ `,,'_______,---_;; ssssss|\n");
printf(" |ssssssssss `--'~{__ ____ ,'ssssss|\n");
printf(" `-ssssssssssssssssss ~~~~~~~~~~~~ ssss.-'\n");
printf(" `---.sssssssssssssssssssss.---' \n");
printf("************************************************\n");

printf("Hey!Do you like cats?\n");
scanf("%c", &c);
if(c == 'y' || c == 'Y')
play();
else if(c == 'n' || c == 'N')
{
printf("No...there is no flag for the guy who don't like cats..\n");
}
else
printf("answer my question OK?\n");
return 0;

}

void anchovies()
{
system("/bin/cat");
}

int play()
{
char buf[200];
memset(buf, 0, 200);

printf("Huh...maby you have a change to get my flag.\n");
printf("If you can solve my puzzle :p\n");
printf(" ,\n");
printf(" ,-. _,---._ __ / \\ \n");
printf(" / ) .-' `./ / \\ \n");
printf(" ( ( ,' `/ /| \n");
printf(" \\ `-\" \\'\\ / | \n");
printf(" `. , \\ \\ / | \n");
printf(" /`. ,'-`----Y | \n");
printf(" ( ; | ' \n");
printf(" | ,-. ,-' | / \n");
printf(" | | ( | | / \n");
printf(" ) | \\ `.___________|/ \n");
printf(" `--' `--'\") \n");

printf("Help this cat found his anchovies:\n");

read(0, buf, 400);


printf("Where are the anchovies?\n");


return 0;
}


__asm__(
".align\n"
".globl Meow\n"
"Meow:\n"

"pop %edi\n\t"
"xor %edx, %edx\n\t"
"pop %esi\n\t"
"mov $0xcafebabe, %ebp\n\t"
"ret\n\t"
/*******************************************/
"pop %esi\n\t"
"xor %ebx, %edx\n\t"
"pop %ebp\n\t"
"mov $0xdeadbabe,%edi\n\t"
"ret\n\t"
/********************************************/
"mov $0xdeadbeef,%edi\n\t"
"xchg %ecx, %edx\n\t"
"pop %ebp\n\t"
"mov $0xdefaced0,%edx\n\t"
"ret\n\t"
/********************************************/
"pop %edi\n\t"
"mov %edx, (%ecx)\n\t"
"pop %ebp\n\t"
"pop %ebx\n\t"
"xor %bl, (%ecx)\n\t"
"ret\n\t"

);
Binary file added Pwn/neko.rar
Binary file not shown.
Binary file added RE/.DS_Store
Binary file not shown.
Binary file added RE/D0gnamee/androidx-wp.docx
Binary file not shown.
Binary file added RE/D0gnamee/androidx-源码.zip
Binary file not shown.
Binary file added RE/D0gnamee/androidx.apk
Binary file not shown.
42 changes: 42 additions & 0 deletions RE/D0gnamee/login.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php
/*
*用户登录,服务器进行的处理
*/error_reporting(E_ALL^E_NOTICE^E_WARNING);
$getid=$_POST['uid'];//客户端post过来的用户名
$getpwd=$_POST['pwd'];//客户端post过来的密码
$getisvip=$_POST['isvip'];

if($getid==='D0gnamee'){
//存在该用户
if($getpwd==='L8ofiemm'){
//用户名密码匹配正确

$back['status']="1";
if($getisvip==0)
{
$back['info']="login success but not vip";
$back['talbe']="aXN2aXA9MCBvciBpc3ZpcD03MTMz";
}
else if($getisvip==7133)
{
$back['info']="JqCC3gLvSgGhHa0MwqTby83NmvkkrTKtULGMonWRKOnnRvBnGfaF8hKea6BkZOnnwi7C1hUXKFu4gSh3xs9E9IMN7W0WmZayxqfzSuo90egGgcutZQ7RkRHT9F9X0ovdIsH+OlA2tjBMh4ulPcwGFsEjeO+HpgVGXSWWjxbycAc=";
}
else
{
$back['info']="login success but vipkey not ture";
}
echo(json_encode($back));
}else{/*密码错误*/
$back['status']="-2";
$back['info']="password error";
echo(json_encode($back));
}

}else{
//不存在该用户
$back['status']="-1";
$back['info']="user not exist";
echo(json_encode($back));
}

?>
Binary file added RE/一个没什么用的病毒 /.DS_Store
Binary file not shown.
Binary file added RE/一个没什么用的病毒 /MBR.idb
Binary file not shown.
109 changes: 109 additions & 0 deletions RE/一个没什么用的病毒 /WriteUp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
#### 0x00
首先你需要准备 IDA
#### 0x01
**(1)**
> 没壳,就丢IDA好了。。。
> 先看看有没有什么String
> ![](https://i.imgur.com/1o9e7pp.png)
> emmmm?? shutdown、SeDebugPrivilege、PhysicalDrive0???有丶东西
> 感觉他要对硬盘干什么坏事。。
**(2)**
> 再看看导入表,用了什么奇怪的函数
> ![](https://i.imgur.com/pjbsQTD.png)
> 嗯?Regxxx注册键值、Adjustxxx提权、xxxFile文件
> 咳咳。。。这东西。。
**(3)**
再看看start函数
> ![](https://i.imgur.com/A8PxqRM.png)
>
> 按一下F5啦,就是这样。。。
> ![](https://i.imgur.com/lMlOSSD.png)
> 知道了。。这是MainCRTStartup。。。
**(4)**
> 好了,我们就知道main函数是sub\_401130(),跟进去看看他要干嘛QAQ。。。
> ![](https://i.imgur.com/MOOPYkr.png)
> woc。。它定义了512个char。。还赋了值。。。
> (最后赋值是 0x55, 0xAA, MBR结尾标志)
> emmmm先不管是什么,先看看他执行了什么东西
> ![](https://i.imgur.com/lYE4Rfn.png)
**(5)**
> 先是sub\_402170()
> ![](https://i.imgur.com/sUJHiD1.png)
> 返回 0???没什么用的函数??好吧。。。
>
> 然后是sub\_401e50()
> ![](https://i.imgur.com/vA8j1Ga.png)
>
> 对函数 sub\_402170 + 9 的位置修改值为 0x90(汇编对应 nop)长度为 202
> 哎?桥豆麻袋!
> 也就是说这是一个简单的 SMC,对 0x402179 到 0x402242 的位置 nop
> 我们打开 sub_402170 对应的 Text View
> ![](https://i.imgur.com/PXe3P8v.png)
> retn 后面的确有脏数据
> 好了~那我们只要分析 0x402243 后面的就好啦~
> (其实可以把 0x402179 到 0x402242 改为nop,直接F5。。。。简单粗暴。。)
> ![](https://i.imgur.com/DwTjgBt.png)
> 红框,分配了512字节空间
> 篮筐,打开物理磁盘0,看来这后面就是搞事情的东西了
**(6)**
> 那先看中间的那个函数 sub\_4020E0
> ![](https://i.imgur.com/aIsgj6R.png)
> 取个时间设为种子
> v3 = (rand() * 100 + rand() + 123)% 90000;
> 所以 v3 一定是 1W~9W 之间的数
> 把 v3 转化为字符数字附到 数组 30 和 43偏移处
> 把 (v3 + 321)% 90000 附到 49 偏移处
> 所以。。。。这个数组是个啥。。。应该是Flag吧???
> 好吧QAQ 暂时不管了
>
> 看后面的 sub\_401040 和 sub\_4010A0
> sub\_401040
> ![](https://i.imgur.com/Jf5JlV2.png)
> sub\_4010A0
> ![](https://i.imgur.com/N10PNIC.png)
> 读写硬盘函数
>
> 主要流程就是把从 0扇区 读到的数据存入 VirtualAlloc 分配的区域,
> 然后写回 1扇区 ,然后把 [esp + 8] 指向的数据写回 0扇区(MBR 512字节)
> 哎??wait!这个 [esp + 8] 是不是也传给过 sub\_4020E0
> emmmm。。。。这个函数返回 TRUE 就ok了
**(7)**
> 这时候我们回到主函数。。。。
> wait??这个函数接收了 &v1,v1这不是也是 512 字节的数组么。。。
> 先不看,我们分析一下其他流程
> sub\_401E80 提权
> ![](https://i.imgur.com/HRWBDHd.png)
>
> sub\_401F50 拷贝文件 & 设置注册表
> ![](https://i.imgur.com/YaxM687.png)
> 得到当前程序句柄
> 得到当前程序目录
> 得到系统目录
> strcat(SystemPath, "svchose.exe")
> 拷贝自身到系统目录(C:\Windows\System32\svchose.exe)
> 注册开机启动(SOFTWARE\Microsoft\Windows\CurrentVersion\Run)
**(8)**
> 程序大概流程就是
> sub\_402170 先迷糊人
> sub\_401E50 修改 sub\_402170
> sub\_401E80 提权、sub\_401F50 注册开机启动
> sub\_402170 修改扇区
> 执行成功关机,失败显示 oops。。。
> 现在就是分析那个写入的 MBR 了
**(9)**
> 二进制数据考下来,放入 IDA 分析
> 见附件
> 然后结合运行结果,计算出flag
> emmmm,flag是随机的,每次都不一样。。。
>
> 如果会调试 MBR 的话。。。。
> flag就在 0x7C26 放着的
> ![](https://i.imgur.com/hSmG0SG.png)
1 change: 1 addition & 0 deletions RE/一个没什么用的病毒 /解压密码.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
解压密码:gelibenjidakai
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Web/.DS_Store
Binary file not shown.
Loading

0 comments on commit 82ac75b

Please sign in to comment.