I've been thinking about expanding what I could do with an LFI attack to somehow extract information that we usually get by invoking commands. And since a lot of things in Linux behave like a file or at least streams of bytes, I thought I could get almost any info I want.
I have success reading /proc/*
and configuration files /home/user/.*
but can't seem to get anything on my network information IP, gateway etc. Tried strace
-ing /bin/ifconfig
but they seem to read .so files.
So, is there any way of achieving this through LFI? I'm testing this on a Debian machine but I'm just curious about the possibility in general regardless of platform.
To clarify, The LFI exploit I'm testing this on is technically an arbitrary file download vulnerability where the response MIME type is image/php
so you can safely download a binary file. Didn't think this changes anything though unless I can derive the information I need by scraping some binary file's content.