The shortest webshell of PHP
One day wandering Wooyun, found a very interesting article ———— "32C3 CTF two Web topics writeup." It mentions two interesting things:
The shortest webshell of PHP
PHP execution Operator Inverted quote
The article mentioned above, I read several times before the time is very puzzling! Later, the toast of the P-ox gave me some pointers, suddenly enlightened
Google "The shortest Webshell"
<?= ' $_get[1] '?>
One of the results from Google is 15 characters, as shown above. What's interesting here is that
PHP.ini need to open short_open_tag to use the short label, can use <?= instead of.? Echo
Parsing with semicolon-delimited statements in PHP
The last line does not require a semicolon
PHP multiple statements can be written in the same, but need to be separated by semicolons
As long as the whitespace between multiple semicolons, PHP is allowed! (to be studied)
<?= ' $_get[1] ';
Google gets the shortest webshell as shown above, a total of 14 characters
The closing tag is removed, but the semicolon is added.
The last line does not require a semicolon, but must be a closed tag!
In addition, it is not feasible to embed this type of writing in other files, so you must write a closing tag!
The magical uses of bash in Linux
<?= ' * ';
A 7 character, what can these seven characters do?
In a Linux system, running on a terminal is the same as the above!
* Used to match all file names (including directory names) under the directory.
An inverted quote is an execution operator that executes the file name in the directory as a command! The next thing is Linux.