Since this thread is bumped anyway.
Some little tricks i learned (some time ago, i.e. they might not work anymore)
/proc/self/environIf you only have an LFI posibility but no RFI, and are one a OS supporting the proc filesystem:
Try including /proc/self/environ. It contains (if not disabled) at least with appache, variables like User-Agent, Referer, and so on for the current request.
Both variables are under our control, so setting the user agent to
<?php 'MINI_SHELL_OR_DROPPER_CODE' ?>
could be interesting.
AFAIR: setting the login shell from the appache user to /sbin/nologin leads to no used environment variables.
Wrappers + filtersIf you just want to read the source code of a php page using a LFI
PHPs filter might be interesting.
They can be applied to to the file name like:
php://filter/convert.base64-encode/resource=FileNameToRead
i.e. if we want to read the source code of 'password.php' via an LFI in index.php the request string might be looking like this:
http://somedomain.com/index.php?page=php://filter/convert.base64-encode/resource=password
This would return the content as base64 encoded text.
There are other filters like rot13 also.
Edit: I just realized that ande also wrote something about LFI containing this information (with way better explanation).