In this work we use gamma-ray burst (GRB) afterglow spectra observed with the VLT/X-shooter spectrograph to measure rest-frame extinction in GRB lines-of-sight by modeling the broadband near-infrared (NIR) to X-ray afterglow spectral energy distributions (SEDs). Our sample consists of nine Swift GRBs, eight of them belonging to the long-duration and one to the short-duration class. Dust is modeled using the average extinction curves of the Milky Way and the two Magellanic Clouds. We derive the rest-frame extinction of the entire sample, which fall in the range $0 \lesssim {\it A}_{\rm V} \lesssim 1.2$. Moreover, the SMC extinction curve is the preferred extinction curve template for the majority of our sample, a result which is in agreement...