You've already forked greyhack
spacing and chmod
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
if params.len < 1 or params[0] == "-h" or params[0] == "--help" then
|
if params.len < 1 or params[0] == "-h" or params[0] == "--help" then
|
||||||
current_program = get_shell.host_computer.File(program_path)
|
current_program = get_shell.host_computer.File(program_path)
|
||||||
exit("Usage: "+current_program.name+" <source code path>")
|
exit "Usage: " + current_program.name + " <source code path>"
|
||||||
end if
|
end if
|
||||||
source_file = get_shell.host_computer.File(params[0])
|
source_file = get_shell.host_computer.File(params[0])
|
||||||
if not source_file then
|
if not source_file then
|
||||||
@@ -9,27 +9,28 @@ if not source_file then
|
|||||||
end if
|
end if
|
||||||
|
|
||||||
cp = get_shell.host_computer
|
cp = get_shell.host_computer
|
||||||
get_shell.build(source_file.path, current_path)
|
get_shell.build source_file.path, current_path
|
||||||
bin_name = source_file.name.split("\.")[0]
|
bin_name = source_file.name.split("\.")[0]
|
||||||
bin_file = cp.File(current_path + "/" + bin_name)
|
bin_file = cp.File(current_path + "/" + bin_name)
|
||||||
if not bin_file then exit("Compiler error")
|
if not bin_file then exit("Compiler error")
|
||||||
bin_file.move("/bin", bin_name)
|
bin_file.move "/bin", bin_name
|
||||||
bin_file.set_group("root")
|
bin_file.set_group "root"
|
||||||
bin_file.set_owner("root")
|
bin_file.set_owner "root"
|
||||||
|
|
||||||
source_content = source_file.get_content
|
source_content = source_file.get_content
|
||||||
if source_content.indexOf("""/lib/metaxploit.so""") and bin_name != "bbuild" then
|
if source_content.indexOf("""/lib/metaxploit.so""") and bin_name != "bbuild" then
|
||||||
source_content = source_content.replace("""/lib/metaxploit.so""", "current_path + ""/metaxploit.so""")
|
source_content = source_content.replace("""/lib/metaxploit.so""", "current_path + ""/metaxploit.so""")
|
||||||
cp.touch(current_path, bin_name + "_guest.src")
|
cp.touch current_path, bin_name + "_guest.src"
|
||||||
guest_source = cp.File(current_path + "/" + bin_name + "_guest.src")
|
guest_source = cp.File(current_path + "/" + bin_name + "_guest.src")
|
||||||
guest_source.set_content(source_content)
|
guest_source.set_content source_content
|
||||||
get_shell.build(guest_source.path, current_path)
|
get_shell.build guest_source.path, current_path
|
||||||
guest_source.delete
|
guest_source.delete
|
||||||
guest_file = cp.File(current_path + "/" + bin_name + "_guest")
|
guest_file = cp.File(current_path + "/" + bin_name + "_guest")
|
||||||
else
|
else
|
||||||
get_shell.build(source_file.path, current_path)
|
get_shell.build source_file.path, current_path
|
||||||
guest_file = cp.File(current_path + "/" + bin_name)
|
guest_file = cp.File(current_path + "/" + bin_name)
|
||||||
end if
|
end if
|
||||||
guest_file.move("/home/" + active_user + "/guest/", bin_name)
|
guest_file.move "/home/" + active_user + "/guest/", bin_name
|
||||||
guest_file.set_group("guest")
|
guest_file.set_group "guest"
|
||||||
guest_file.set_owner("guest")
|
guest_file.set_owner "guest"
|
||||||
|
guest_file.chmod "u+rwx,g+rwx,o+rwx"
|
||||||
|
|||||||
Reference in New Issue
Block a user