Code Monkey home page Code Monkey logo

Comments (4)

icxcoffee avatar icxcoffee commented on August 24, 2024 2

我也遇到了这个问题,发现是由于syshook_execve.ko内核模块重启后,需要重新加载才能使用,而驭龙系统在自启动时没有重新加载syshook_execve.ko这个模块,导致无法监控进程,希望官方能在代码上解决这个问题。

#手工解决方式
[root@localhost ~]# cd /usr/yulong-hids/
[root@localhost yulong-hids]# ls
agent daemon data.zip nohup.out syshook_execve.ko
[root@localhost yulong-hids]# ps -ef|grep yulong
root 676 1 0 03:12 ? 00:00:00 /usr/yulong-hids/daemon -netloc 192.168.200.2
root 1384 676 0 03:12 ? 00:00:00 /usr/yulong-hids/agent 192.168.200.2
root 1457 1436 0 03:15 pts/0 00:00:00 grep --color=auto yulong
[root@localhost yulong-hids]# kill 676
[root@localhost yulong-hids]# insmod syshook_execve.ko
[root@localhost yulong-hids]# nohup ./daemon -netloc 192.168.200.2 &

#自写自启动脚本,在驭龙自启动之前加载syshook_execve.ko

from yulong-hids-archived.

icxcoffee avatar icxcoffee commented on August 24, 2024 2

经测试,在yulong-hids/agent/agent.go的15行后面添加如下代码即可解决此问题

	if runtime.GOOS == "linux" {
		out, _ := common.CmdExec(fmt.Sprintf("lsmod|grep syshook_execve"))
		if out == "" {
			common.CmdExec(fmt.Sprintf("insmod %s/syshook_execve.ko", common.InstallPath))
		}
	}

需要导入如下package

import "runtime"
import "yulong-hids/daemon/common"

from yulong-hids-archived.

zj1244 avatar zj1244 commented on August 24, 2024

自己调试后感觉应该是process_linux.go这个文件里的sock_fd = socket(PF_NETLINK, SOCK_RAW, NETLINK_USER);出错,出错信息Protocol not supported。很奇怪为什么不重启的时候好好的,重启后就不行了。
版本:
Linux localhost 3.10.0-693.el7.x86_64 #1 SMP Tue Aug 22 21:09:27 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Linux localhost.localdomain 2.6.32-573.el6.x86_64 #1 SMP Thu Jul 23 15:44:03 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

from yulong-hids-archived.

icxcoffee avatar icxcoffee commented on August 24, 2024

以上代码会使编译生成的agent体积增大1Mb左右,如果将其放在yulong-hids/daemon/daemon.go的main函数开始位置,编译生成的daemon体积基本不变,也能解决问题,但重启后,daemon和agent进程会延迟两分钟左右才会启动,不知道是什么问题

from yulong-hids-archived.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.