Those are wire-guided missiles, usually used to destroy tanks and other armed vehicles. The length of the wire is just few kilometers. The wire is needed to actually tell the rocket where to steer [1].
More modern approach to anti-tank missiles are those with lasers being used for highlighting the target [2], while the missile has a battery and a camera to find the spot. The other approach is to do on-the-fly image recognition [3].
Edit: interesting fact: DART space craft sent by NASA to hit an asteroid used a missile derived technology to recognize the image and steer itself into the target, since direct control from Earth was not possible due to communication lag [4] (also try googling "dart mission" to see google's doodle on the topic).