To recover Einstein's equations (sourceless) in string theory, start with the following world sheet theory (Polchinski vol 1 eq 3.7.2):
$$
S = \frac{1}{4\pi \alpha'} \int_M d^2\sigma\, g^{1/2} g^{ab}G_{\mu\nu}(X) \partial_aX^\mu \partial_bX^\nu
$$
where $g$ is the worldsheet metric, $G$ is the spacetime metric, and $X$ are the string embedding coordinates. This is an action for strings moving in a curved spacetime. This theory is classically scale-invariant, but after quantization there is a Weyl anomaly measured by the non-vanishing of the beta functional. In fact, one can show that to order $\alpha'$, one has
$$
\beta^G_{\mu\nu} = \alpha' R^G_{\mu\nu}
$$
where $R^G$ is the spacetime Ricci tensor. Notice that now, if we enforce scale-invariance at the qauntum level, then the beta function must vanish, and we reproduce the vacuum Einstein equations;
$$
R_{\mu\nu} = 0
$$
So in summary, the Einstein equations can be recovered in string theory by enforcing scale-invariance of a worldsheet theory at the quantum level!