To be certain, you'll need to:
1. Consult a repair manual specific to your 1997 Chevy Malibu's engine: A Haynes or Chilton manual will have diagrams showing the exact location. Your engine code (found on a sticker under the hood) will help you find the correct manual.
2. Use an online parts diagram: Many auto parts websites (like AutoZone, Advance Auto Parts, etc.) allow you to search by your vehicle's year, make, model, and engine to find diagrams showing the knock sensor placement.
Without knowing your specific engine, I can only give a general area. Looking in the area described above, on the engine block near the cylinder head on the passenger side, is your best starting point. But using a repair manual or parts diagram is essential for accurate identification.