This is a basic question regarding ASLR
If I have a binary file which does not have ASLR enabled. However, the libc file it uses has ASLR enabled, then will the address of system() in libc file be randomized every time?
Or the address will be the same every time because the main binary itself does not have ASLR enabled?
In gdb, I am fetching the address of system() function as shown below:
(gdb) break main
(gdb) run
(gdb) print &system
So, does this return the address of system() from libc or the main binary's PLT?
Also, if I have a libc file from another system, then how can I find the address of system() inside it? By defaut, if I run gdb on my main binary, it will find the system() address for the libc on local system. Do I have to tell gdb to load the libc file (which I obtained from remote system)?