I've been reading the posts here about bypassing ASLR. On 32bit systems this appears to be trivial but I was surprised to see how trivial. It takes mere seconds to bruteforce ASLR address'. The reason seems to be that according to my tests only 12 bits actually change in the address:
export BLAH=$"/bin/sh"
BLAH will be at 0xbff5a78b
BLAH will be at 0xbf87778b
BLAH will be at 0xbfe1e78b
BLAH will be at 0xbf9f778b
BLAH will be at 0xbffc378b
BLAH will be at 0xbffd978b
BLAH will be at 0xbfa7f78b
BLAH will be at 0xbf94878b
BLAH will be at 0xbfe4378b
BLAH will be at 0xbff7978b
BLAH will be at 0xbfe4078b
It seems that on my laptop all random address' are
BF XX X7 8B
where X is a random hex. My knowledge of the low level workings of a CPU are quite limited, so why are these the only bytes that change?
Is it correct to say that on a 32bit machine there are only 16^3 = 4096 ASLR address'?
How many bits change on a 64bit system?