Skip to content

Commit

Permalink
Merge pull request #14 from Frissi0n/bugfix/missing-shell-spawn
Browse files Browse the repository at this point in the history
fix: Add missing shell spawn on manual arbitrary write
  • Loading branch information
Frissi0n authored Dec 3, 2023
2 parents 6a5b7c1 + 0769743 commit 0a6acdf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions gtfonow/gtfonow.py
Original file line number Diff line number Diff line change
Expand Up @@ -3364,15 +3364,16 @@ def arbitrary_file_write(binary, payload, risk, user="root", command=None):
elif chosen_option == "ld_preload":
ld_preload_exploit(binary, payload, command)
elif chosen_option == "arbitrary":
manual_arbitrary_file_write(binary, payload, risk, user, command)
manual_arbitrary_file_write(payload)
else:
manual_arbitrary_file_write(binary, payload, risk, user, command)
manual_arbitrary_file_write(payload)


def manual_arbitrary_file_write(binary, payload, risk, user="root", command=None):
def manual_arbitrary_file_write(payload):
print("Create a file named " + GREEN + "input_file" +
RESET + " containing the file content")
log.info("Spawning temporary shell to create file, type 'exit' when done")
os.system("/bin/bash")
print("Enter the file path that you wish to write to. (eg: /root/.ssh/authorized_keys)")
file_to_write = input("> ")
payload = payload.replace("file_to_write", file_to_write)
Expand Down

0 comments on commit 0a6acdf

Please sign in to comment.