[ERROR] Could not find a terminal binary to use. Set context.terminal to your terminal报错的解决办法(亲测有效!)

一、问题描述

在通过ssh连接服务器,在命令行界面进行pwntools的实验中,在调用gdb进行debug时会报这样一个错

[ERROR] Could not find a terminal binary to use. Set context.terminal to your terminal,如下图所示

 其中部分实验代码如下:

from pwn import *

sh = process('./leakmemory')

...

gdb.attach(sh)

...

经过对源码的分析,我们知道是脚本在第9行调用gdb对sh进程进行debug时,需要新开一个终端,也就是说在前面对新开终端的参数进行设置(即context.terminal=[])。

一开始我到/usr/bin下找类似terminal、gnome-terminal的指令,因为我本能的就将context.terminal=['gnome-terminal','sh',-x]进行设置,然后运行脚本的时候发现程序卡在waiting for debugger的进度,最后发现这个服务器并没有安装gnome...都ssh连接了...

二、解决办法

使用tmux。

1、在gdb.attach()命令行之前加一句:

context.terminal = ['tmux','splitw','-h']</

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值