To some degree, all squats work the hamstrings, but I wouldn’t rely on squats as your primary movement for that purpose. However, you can use the safety bar for this purpose – especially if you decide to try stiff-leg good mornings!