Buy a generic sensor, around $50. The generic senor will not have a wire connector like the OEM sensor dose. But it will have an instruction telling you how to connect the wires to the old wire connector from the original sensor. It will take you about 30 minutes finish the work. Unless the old wire connector is damaged too, you can use it again for sure.
O2 sensor is a very generic device. I will be supprised if there is any difference between the front and the back sensor.