AC couple channel, gnd to gnd and probe x10 to OSC pin. If triggering this signal is imppssible (but can catch it with single on scope, run stop) than probabbly crystal if faullty and frequency is fluid.
Beside checking base frequency now You can perform math functions if scope allows. Do FFT and check charmonics level.
if you are using a discovery board, check on the schematic that the pins are not connected to soldered components as they likely be.
You can first run the code with HSI 16 MHz internal clock (just don't inject clocks) to see what happens.
Then run a simple test main function
enable the peripheral clock
configure the GPIOs as push pull outputs (you can directly write the GPIO peripheral registers in 16 bit blocks)
use a main loop with delay to toggle these pins (use a global reference uint16_t mask myPort = 0, and use myPort ^= 0xFFFF to toggle, in order not to read the port to toggle it.