Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /opt/rh/gcc-toolset-11/root/usr/share/systemtap/tapset/linux/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //opt/rh/gcc-toolset-11/root/usr/share/systemtap/tapset/linux/sysc_setxattr.stp
# setxattr ___________________________________________________
# long sys_setxattr(char __user *path,
#		  char __user *name,
#		  void __user *value,
#		  size_t size,
#		  int flags)
#

@define _SYSCALL_SETXATTR_NAME
%(
	name = "setxattr"
%)

@define _SYSCALL_SETXATTR_ARGSTR
%(
	argstr = sprintf("%s, %s, %s, %u, %s", path, name_str, value_str,
	                 size, flags_str)
%)

@define _SYSCALL_SETXATTR_REGARGS
%(
	path_uaddr = pointer_arg(1)
	path = user_string_quoted(path_uaddr)
	path_unquoted = user_string_nofault(pointer_arg(1))
	name_uaddr = pointer_arg(2)
	name_str = user_string_quoted(name_uaddr)
	name_str_unquoted = user_string_nofault(pointer_arg(2))
	value_uaddr = pointer_arg(3)
	size = ulong_arg(4)
	value_str = _stp_xattr_val_str(value_uaddr, size)
	flags = int_arg(5)
	flags_str = _stp_xattr_flags_str(flags)
%)

@define _SYSCALL_SETXATTR_REGARGS_STORE
%(
        if (@probewrite(path_uaddr))
          set_pointer_arg(1, path_uaddr)

	if (@probewrite(path_unquoted))
	  set_user_string_arg(pointer_arg(1), path_unquoted)

	if (@probewrite(name_uaddr))
	  set_pointer_arg(2, name_uaddr)

	if (@probewrite(name_str_unquoted))
	  set_user_string_arg(pointer_arg(2), name_str_unquoted)

	if (@probewrite(value_uaddr))
	  set_pointer_arg(3, value_uaddr)

	if (@probewrite(size))
	  set_ulong_arg(4, size)

	if (@probewrite(flags))
	  set_int_arg(5, flags)
%)

probe syscall.setxattr = dw_syscall.setxattr !, nd_syscall.setxattr ? {}
probe syscall.setxattr.return = dw_syscall.setxattr.return !,
                                nd_syscall.setxattr.return ? {}

# dw_setxattr _____________________________________________________

probe dw_syscall.setxattr = kernel.function("sys_setxattr").call
{
	@_SYSCALL_SETXATTR_NAME
	path_uaddr = @choose_defined($pathname, $path)
	path = user_string_quoted(@choose_defined($pathname, $path))
	name_uaddr = $name
	name_str = user_string_quoted($name)
	value_uaddr = $value
	value_str = _stp_xattr_val_str($value, $size)
	size = __ulong($size)
	flags = __int32($flags)
	flags_str = _stp_xattr_flags_str(__int32($flags))
	@_SYSCALL_SETXATTR_ARGSTR
}
probe dw_syscall.setxattr.return = kernel.function("sys_setxattr").return
{
	@_SYSCALL_SETXATTR_NAME
	@SYSC_RETVALSTR($return)
}

# nd_setxattr _____________________________________________________

probe nd_syscall.setxattr = nd1_syscall.setxattr!, nd2_syscall.setxattr!, tp_syscall.setxattr
  { }

probe nd1_syscall.setxattr = kprobe.function("sys_setxattr") ?
{
	@_SYSCALL_SETXATTR_NAME
	asmlinkage()
	@_SYSCALL_SETXATTR_REGARGS
	@_SYSCALL_SETXATTR_ARGSTR
}

/* kernel 4.17+ */
probe nd2_syscall.setxattr = kprobe.function(@arch_syscall_prefix "sys_setxattr") ?
{
	__set_syscall_pt_regs(pointer_arg(1))
	@_SYSCALL_SETXATTR_NAME
	@_SYSCALL_SETXATTR_REGARGS
	@_SYSCALL_SETXATTR_ARGSTR
},
{
        %( @_IS_SREG_KERNEL %? @_SYSCALL_SETXATTR_REGARGS_STORE %)
}

/* kernel 3.5+, but undesirable because it affects all syscalls */
probe tp_syscall.setxattr = kernel.trace("sys_enter")
{
	__set_syscall_pt_regs($regs)
	@__syscall_compat_gate(@const("__NR_setxattr"), @const("__NR_compat_setxattr"))
	@_SYSCALL_SETXATTR_NAME
	@_SYSCALL_SETXATTR_REGARGS
	@_SYSCALL_SETXATTR_ARGSTR
},
{
        %( @_IS_SREG_KERNEL %? @_SYSCALL_SETXATTR_REGARGS_STORE %)
}

probe nd_syscall.setxattr.return = nd1_syscall.setxattr.return!, nd2_syscall.setxattr.return!, tp_syscall.setxattr.return
  { }

probe nd1_syscall.setxattr.return = kprobe.function("sys_setxattr").return ?
{
	@_SYSCALL_SETXATTR_NAME
	@SYSC_RETVALSTR(returnval())
}

/* kernel 4.17+ */
probe nd2_syscall.setxattr.return = kprobe.function(@arch_syscall_prefix "sys_setxattr").return ?
{
	@_SYSCALL_SETXATTR_NAME
	@SYSC_RETVALSTR(returnval())
}

/* kernel 3.5+, but undesirable because it affects all syscalls */
probe tp_syscall.setxattr.return = kernel.trace("sys_exit")
{
	__set_syscall_pt_regs($regs)
	@__syscall_compat_gate(@const("__NR_setxattr"), @const("__NR_compat_setxattr"))
	@_SYSCALL_SETXATTR_NAME
	@SYSC_RETVALSTR($ret)
}

Spamworldpro Mini