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_lsetxattr.stp
# lsetxattr __________________________________________________
# long sys_lsetxattr(char __user *path,
#               char __user *name,
#               void __user *value,
#               size_t size,
#               int flags)
#

@define _SYSCALL_LSETXATTR_NAME
%(
	name = "lsetxattr"
%)

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

@define _SYSCALL_LSETXATTR_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_LSETXATTR_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.lsetxattr = dw_syscall.lsetxattr !, nd_syscall.lsetxattr ? {}
probe syscall.lsetxattr.return = dw_syscall.lsetxattr.return !,
                                 nd_syscall.lsetxattr.return ? {}

# dw_lsetxattr _____________________________________________________

probe dw_syscall.lsetxattr = kernel.function("sys_lsetxattr").call
{
	@_SYSCALL_LSETXATTR_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
	size = __ulong($size)
	value_str = _stp_xattr_val_str($value, size)
	flags = __int32($flags)
	flags_str = _stp_xattr_flags_str(__int32($flags))
	@_SYSCALL_LSETXATTR_ARGSTR
}
probe dw_syscall.lsetxattr.return = kernel.function("sys_lsetxattr").return
{
	@_SYSCALL_LSETXATTR_NAME
	@SYSC_RETVALSTR($return)
}

# nd_lsetxattr _____________________________________________________

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

probe nd1_syscall.lsetxattr = kprobe.function("sys_lsetxattr") ?
{
	@_SYSCALL_LSETXATTR_NAME
	asmlinkage()
	@_SYSCALL_LSETXATTR_REGARGS
	@_SYSCALL_LSETXATTR_ARGSTR
}

/* kernel 4.17+ */
probe nd2_syscall.lsetxattr = kprobe.function(@arch_syscall_prefix "sys_lsetxattr") ?
{
	__set_syscall_pt_regs(pointer_arg(1))
	@_SYSCALL_LSETXATTR_NAME
	@_SYSCALL_LSETXATTR_REGARGS
	@_SYSCALL_LSETXATTR_ARGSTR
},
{
        %( @_IS_SREG_KERNEL %? @_SYSCALL_LSETXATTR_REGARGS_STORE %)
}

/* kernel 3.5+, but undesirable because it affects all syscalls */
probe tp_syscall.lsetxattr = kernel.trace("sys_enter")
{
	__set_syscall_pt_regs($regs)
	@__syscall_compat_gate(@const("__NR_lsetxattr"), @const("__NR_compat_lsetxattr"))
	@_SYSCALL_LSETXATTR_NAME
	@_SYSCALL_LSETXATTR_REGARGS
	@_SYSCALL_LSETXATTR_ARGSTR
},
{
        %( @_IS_SREG_KERNEL %? @_SYSCALL_LSETXATTR_REGARGS_STORE %)
}

probe nd_syscall.lsetxattr.return = nd1_syscall.lsetxattr.return!, nd2_syscall.lsetxattr.return!, tp_syscall.lsetxattr.return
  { }
  
probe nd1_syscall.lsetxattr.return = kprobe.function("sys_lsetxattr").return ?
{
	@_SYSCALL_LSETXATTR_NAME
	@SYSC_RETVALSTR(returnval())
}

/* kernel 4.17+ */
probe nd2_syscall.lsetxattr.return = kprobe.function(@arch_syscall_prefix "sys_lsetxattr").return ?
{
	@_SYSCALL_LSETXATTR_NAME
	@SYSC_RETVALSTR(returnval())
}
 
/* kernel 3.5+, but undesirable because it affects all syscalls */
probe tp_syscall.lsetxattr.return = kernel.trace("sys_exit")
{
	__set_syscall_pt_regs($regs)
	@__syscall_compat_gate(@const("__NR_lsetxattr"), @const("__NR_compat_lsetxattr"))
	@_SYSCALL_LSETXATTR_NAME
	@SYSC_RETVALSTR($ret)
}

Spamworldpro Mini