An impact wrench is a power tool used for loosening or tightening lug nuts, large bolts, and frozen or rusted fasteners .