web安全二进制安全C/C++汇编Shellcode [2021]windows 2021H奇怪的安全机制导致堆栈回溯出现问题 今天发现的,我syscall hook了zwcreatefile这个API做了堆栈回溯: ![](https://key08.com/usr/uploads/2021/04/1314842216.png) 结果各种bug,详细看: ![](https://key08.com/usr/uploads/2021/04/2583737094.png) ![](https://key08.com/usr/uploads/2021/04/1983365686.png) 似乎windows 2021H先申请了一个read only内存,然后给这个read only内存设置了excute属性,设置完毕后再执行系统代码.执行完毕后再设置为noaccess 因此堆栈回溯会看到大部分都在private属性里面,如果异步回溯则看到noaccess 挺奇怪的机制.目前不确定为什么.暂时没空逆向,如果有知道的tx可以在评论区留言 阅读全文 2021-04-25 huoji 1 条评论
二进制安全C/C++汇编 [2021]syscall、sysret研究 https://events.static.linuxfound.org/sites/events/files/slides/entry-lce.pdf 备份: [entry-lce.pdf](https://key08.com/usr/uploads/2021/04/37404595.pdf) 阅读全文 2021-04-20 huoji 0 条评论
python工具软件 [2021]MySQL蜜罐,读取攻击者任意文件 mysql客户端load data语句这块没有受到限制,服务端发什么信息就会读什么,而且没有校验,特别蠢 原理 > MySQL中 load data local infile '/etc/passwd' into table test fields terminated by '\n';语句可以读取客户端本地文件并插进表中,那么我们可以伪造一个恶意的服务器,向连接服务器的客户端发送读取文件的payload。这个技术并不新鲜,但是合理利用就能起到一些不错的成果。 脚本: https://github.com/ev0A/Mysqlist https://github.com/qigpig/MysqlHoneypot ```c chrome的login data,虽然无法解密出密码,但是还是可以获取到对方的一些账号的 'C:/Users/' + username + '/AppData/Local/Google/Chrome/User Data/Default/Login Data' chrome的历史记录 'C:/Users/' + username + '/AppData/Local/Google/Chrome/User Data/Default/History' 用户的NTLM Hash(Bettercap + responder) \\ip\test C:\Users\username\Documents\WeChat Files\All Users\config\config.data中含有微信ID C:\Windows\PFRO.log中较大几率能找到用户名 ``` 阅读全文 2021-04-11 huoji 0 条评论
python工具软件 [2021]SSH流量取证工具 在实战中我们经常遇到ssh被爆破登陆后搞这个搞那个 我们需要一个工具来解密ssh流量并且取证 packetStrider就是干这个的 使用: ```bash pip3 install pandas matplotlib pyshark git clone https://github.com/benjeems/packetStrider.git python3 packetStrider-ssh.py -h usage: packetStrider-ssh.py [-h] [-f FILE] [-n NSTREAM] [-m] [-k] [-p] [-z ZOOM] [-d DIRECTION] [-o OUTPUT_DIR] [-w WINDOW] [-s STRIDE] packetStrider-ssh is a packet forensics tool for SSH. It creates a rich feature set from packet metadata such SSH Protocol message content, direction, size, latency and sequencing. It performs pattern matching on these features, using statistical analysis, and sliding windows to predict session initiation, keystrokes, human/script behavior, password length, use of client certificates, context into the historic nature of client/server contact and exfil/infil data movement characteristics in both Forward and Reverse sessions optional arguments: -h, --help show this help message and exit -f FILE, --file FILE pcap file to analyze -n NSTREAM, --nstream NSTREAM Perform analysis only on stream n -m, --metaonly Display stream metadata only -k, --keystrokes Perform keystroke prediction -p, --predict_plot Plot data movement and keystrokes -z ZOOM, --zoom ZOOM Narrow down/zoom the analysis and plotting to only packets "x-y" -d DIRECTION, --direction DIRECTION Perform analysis on SSH direction : "forward", "reverse" OR "both" -o OUTPUT_DIR, --output_dir OUTPUT_DIR Directory to output plots -w WINDOW, --window WINDOW Sliding window size, # of packets to side of window center packet, default is 2 -s STRIDE, --stride STRIDE Stride between sliding windows, default is 1 ``` 解密ssh流量与时间会话: ```bash python3 packetStrider-ssh.py -f tcpdump.pcap -k -p -o out ``` 基本上全出来了 ![](https://key08.com/usr/uploads/2021/04/3355700718.png) github: https://github.com/benjeems/packetStrider 阅读全文 2021-04-11 huoji 0 条评论
二进制安全C/C++汇编 [2021]基于虚拟化的HIPS架构 从0到1 二 (SVM部分) 上一章 [基[2021]于hypervisor的HIPS架构 从0到1(VT部分)](https://key08.com/index.php/2021/02/24/915.html "基[2021]于hypervisor的HIPS架构 从0到1(VT部分)") 我们讨论了INTEL的 VT-X的情况,对于AMD的SVM,我们还没有做过多讨论,本篇文章就会继续讨论SVM的情况. 网上关于AMD的资料几乎为0,我希望这篇文章给你带来启发 ## 1.准备工作 首先我们要确保SVM是否是支持的: ![1.png](https://key08.com/usr/uploads/2021/04/2334368837.png) 这是万事开头 阅读全文 2021-04-11 huoji 3 条评论
python一线开发 [2021]最佳路径算法与状态转移方程与三角形最大路径问题 做游戏的动态巡路用 ```python # 状态转移方程: 最佳路径(i, j) = 目标数组(i, j) + max{最佳路径(i + 1, j), 最佳路径(i + 1, j + 1)}。 def walk_array(pArray): saved_path = [] saved_array = pArray[-1] # 最佳路径要倒叙 for i in range(len(pArray)-2, -1, -1): # 从底往上 # 更改dp前j个的值 save_path_num = 0 for j in range(i+1): max_num = max(saved_array[j], saved_array[j+1]) saved_array[j] = pArray[i][j] + max_num save_path_num = pArray[i][j] saved_path.append(save_path_num) return (saved_array[0], saved_path) ``` ```python (max_num, saved_path) = walk_array(triangle_array) print('最大值: {}, 路径:'.format(max_num)) for item in range(len(saved_path)-1, -1, -1): print("{}->".format(saved_path[item])) ``` ```python triangle_array = [ [7], [3, 8], [8, 1, 0], [2, 7, 4, 4], [4, 5, 2, 6, 5] ] ``` 时间复杂度n2 阅读全文 2021-04-05 huoji 0 条评论