Yep because the force 2 massive objects exert on one another object is:

F = G m_{1} m_{2}

---------

r^{2}

where r is the distance between them

and G is the gravitational constant

because

F = ma

the acceleration m1 causes in m2

a = G m_{1}

-----

r^{2}

So if you know G and how the moon or a satellite is accelerating you can work out the earth's mass...

The trick is working out G....

this is really quite difficult as it is really tiny (about 0.0000000000138Nkg

^{-2}m

^{2} ) so means measuring absolutely tiny forces produced by quite large masses.

The experiment that can be used to work this out was first done by Henry Cavendish in 1797.

He did it by hanging a heavy lead dumbell on a thin wire,

*from the side:*Then moving two 350lb lead weights near to it on either side

*From the top:*and he could just about measure the deflection of the dumbell caused by the lead weights...

It is still the hardest of all the fundamental constants to measure, because gravity is so weak.