Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

探讨下 #1

Open
npc7 opened this issue Jul 15, 2019 · 7 comments
Open

探讨下 #1

npc7 opened this issue Jul 15, 2019 · 7 comments

Comments

@npc7
Copy link

npc7 commented Jul 15, 2019

请问 .bash_history 和jumpserver记录的有什么区别?
第二个问题是探讨型,为何采用这种方式收集?

@kkilloas
Copy link
Contributor

Q1: .bash_history 和jumpserver记录的有什么区别?
A1: 很抱歉对jumpserver不是很了解,因此无法从记录上的区别来回答您。但jumpserver的功能及使用上对于我们的需求来讲有些冗余,显得有些沉重,因此当时我们很快就pass了jumpserver。
Q2: 为何采用这种方式收集?
A2: 相比于“项目介绍“中提到的其他两种方式,这种方式更加灵活、轻便、成本低,易于部署和维护。而且在满足我们现有需求的同时,可以快速落地,同时对用户无感知。

@bbxc
Copy link

bbxc commented Aug 7, 2019

这种方式在稳定性、兼容性、性能方面有没有测试?或者实践中是否存在一些异常问题?

@kkilloas
Copy link
Contributor

kkilloas commented Aug 7, 2019

这种方式在稳定性、兼容性、性能方面有没有测试?或者实践中是否存在一些异常问题?

稳定性上目前来讲,在CentOS 6、7上是没有问题的。
兼容性的话目前仅支持CentOS的bash,其他shell的兼容性很难扩展;但是其他Linux系统还是比较好扩展的,理论上来讲修改下脚本中用到的指令绝对路径就好了。
性能方面没有详细测试,至少对系统使用者是无感的,也没有出现过异常大量占用资源的情况。

@bbxc
Copy link

bbxc commented Aug 8, 2019

好的,是否有微信交流群?可以多多交流

@bbxc
Copy link

bbxc commented Aug 9, 2019

#audit non-interactive shell
if [[ ! $- =~ "i" ]];
then #non-interactive shell then do
AUDIT_CMD=" 0000 $(/bin/date +%F\ %H:%M:%S) :: $CMDLINE"
LOGGER
这段脚本中无法获取 xx.sh 脚本中的命令操作,是什么原因?

@kkilloas
Copy link
Contributor

kkilloas commented Aug 9, 2019

#audit non-interactive shell
if [[ ! $- =~ "i" ]];
then #non-interactive shell then do
AUDIT_CMD=" 0000 $(/bin/date +%F\ %H:%M:%S) :: $CMDLINE"
LOGGER
这段脚本中无法获取 xx.sh 脚本中的命令操作,是什么原因?

这个获取的只是ssh远程操作之类的指令,本身无法获取xx.sh脚本中的命令操作。因为想获取这种情况的操作需要在运行sh脚本的shell中手动打开history。可以参考如下代码开启这个功能:

if [[ ! $- =~ "i" ]] && [[ "$(shopt login_shell)" =~ "off"  ]]
then
  set -o history
fi

但是并不推荐。因为这样会改变sh脚本的运行环境,可能会造成一些意想不到的后果。

目前并没有专门的微信交流群,不过欢迎加入我们陌陌src的微信群交流探讨~

@lshc666
Copy link

lshc666 commented Feb 8, 2022

反弹shell场景,在shell断开时才会记录命令,是否有办法前置

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants