Gynaecology & Obstetrics

In child with ambiguous genitalia, first test to be done is