-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add experimental api for payload elf loader
- Loading branch information
1 parent
5f277a2
commit 4cc9e0a
Showing
9 changed files
with
470 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>ELF Launcher</title> | ||
<link rel="stylesheet" href="xterm.css"> | ||
</head> | ||
<body> | ||
<script src="xterm.js"></script> | ||
|
||
<form action="/elfldr" method="POST" enctype="multipart/form-data"> | ||
<label for="elf">ELF:</label> | ||
<input type="file" id="elf" name="elf" required><br> | ||
|
||
<label for="args">Args:</label> | ||
<input type="text" id="args" name="args"><br> | ||
|
||
<input type="submit" value="Deploy"> | ||
</form> | ||
</body> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env bash | ||
# Copyright (C) 2024 John Törnblom | ||
# | ||
# This file is free software; you can redistribute it and/or modify it | ||
# under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation; either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, but | ||
# WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
# General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program; see the file COPYING. If not see | ||
# <http://www.gnu.org/licenses/> | ||
|
||
PS5_HOST= | ||
|
||
|
||
while getopts "h:" opt; do | ||
case ${opt} in | ||
h) PS5_HOST=$OPTARG;; | ||
esac | ||
done | ||
shift $((OPTIND -1)) | ||
|
||
if [[ -z $PS5_HOST || -z $1 ]]; then | ||
echo "Usage: $(basename $0) -h HOST PAYLOAD [ARGS...]" >&2 | ||
exit 1 | ||
fi | ||
|
||
PAYLOAD_PATH=$1 | ||
PAYLOAD_NAME=$(basename "$PAYLOAD_PATH") | ||
shift | ||
|
||
PAYLOAD_ARGS=${PAYLOAD_NAME// /\\ } | ||
for ARG in "$@"; do | ||
PAYLOAD_ARGS="${PAYLOAD_ARGS} ${ARG// /\\ }" | ||
done | ||
|
||
curl --form "elf=@${PAYLOAD_PATH}" \ | ||
--url-query pipe="1" \ | ||
--url-query args="$PAYLOAD_ARGS" \ | ||
http://$PS5_HOST:8080/elfldr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.