A police investigation is under way after an eight-year-old girl was targeted in a sextortion plot.