题目
题目来源: 暂无
题目描述:运行就能拿到shell呢,真的
场景:IP:port
审题
作为第一道 PWN 题,应该不会很难。这道题给了场景,应该是通过 nc 连接,然后运行。
题解
nc
bash
nc IP port
cat ./flagnclib
python
import nclib
def main():
nc = nclib.Netcat(connect=('IP', port))
nc.send_line('cat ./flag')
print(nc.recv().decode())
if __name__ == '__main__':
main()pwntool
python
from pwn import *
def main():
io = remote('IP', port)
io.sendline(b'cat ./flag')
print(io.recv().decode())
if __name__ == '__main__':
main()总结
通过本题练习 netcat 的用法,学习使用具有 netcat 功能的 Python 库。
- nc
- nclib
- pwntools