Let x be the unknown speed, y the unknown distance.
distance equals speed times time.
"With" an 8kph current means our speed is x+8. 2 hours with an 8 kph current gets is a distance y:
y = 2(x + 8)
Against the current, speed x-8, took 3 hours to go y:
y = 3(x-8)
Equating,
2(x+8)=3(x-8)
2x + 16 =3x - 24
40 = x
Answer: 40 km/h
Check: 2(40+8)=96 km. 3(40-8)=3(32)=96 km. Equal, good.