CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/lib/rex/post/process.rb
Views: 1904
1
# -*- coding: binary -*-
2
3
module Rex
4
module Post
5
6
###
7
#
8
# This class performs basic process operations against a process running on a
9
# remote machine via the post-exploitation mechanisms. Refer to the Ruby
10
# documentation for expected behaviors.
11
#
12
###
13
class Process
14
15
def Process.getresuid
16
raise NotImplementedError
17
end
18
def Process.setresuid(a, b, c)
19
raise NotImplementedError
20
end
21
22
def Process.euid
23
getresuid()[1]
24
end
25
def Process.euid=(id)
26
setresuid(-1, id, -1)
27
end
28
def Process.uid
29
getresuid()[0]
30
end
31
def Process.uid=(id)
32
setresuid(id, -1, -1)
33
end
34
35
def Process.egid
36
getresgid()[1]
37
end
38
def Process.egid=(id)
39
setresgid(-1, id, -1)
40
end
41
def Process.gid
42
getresgid()[0]
43
end
44
def Process.gid=(id)
45
setresgid(id, -1, -1)
46
end
47
48
def Process.pid
49
raise NotImplementedError
50
end
51
def Process.ppid
52
raise NotImplementedError
53
end
54
55
end
56
57
end; end # Post/Rex
58
59