We develop a theoretical framework to study illicit drugs markets and we estimate it using data on purchases of crack cocaine. Buyers are searching for high-quality drugs, but they determine drugs’ quality (i.e., their purity) only after consuming them. Hence, sellers can rip off first-time buyers or can offer higher-quality drugs to induce buyers to purchase from them again. In equilibrium, a distribution of qualities persists. The estimated model implies that sellers’ moral hazard reduces the average and increases the dispersion of drug purity. Moreover, increasing penalties may increase the purity and affordability of the drugs traded because doing so increases sellers’ relative profitability of targeting loyal buyers versus first-time buyers.