Do the math.
Let's say the bullet in question is travelling at about the speed of sound, around 330 m/s. That means it moves 1 meter in 3 ms, or about a foot in 1 ms.
Now look at the speed of "prosumer" flashes. 1 ms for the flash duration would not be out of the ordinary, especially for a bright flash. After all, that translates to an equivalent shutter speed of 1/1000 second. That's plenty fast enough for the vast majority of pro uses, so there is little pressure to make flashes faster than that. In fact, since brightness is a big selling point, pro photography flashes will be optimized for longer times to get more overall brightness, so long as the effective shutter time is still "short". 1 ms achieves that quite well.
You need something substantially faster than that. A 10 µs flash would still blur the bullet by over 3 mm. Maybe that's good enough for your purpose. It would take about a 1 µs flash to effectively "freeze" such a bullet in flight.
Some prosumer flashes have a "rapid-fire" mode that doesn't require a few seconds of recharge between flashes. This is usually accomplished by making the flash time shorter so that each flash uses only a fraction of the energy stored at the last recharge. Those may get down to below 100 µs flash times. It may be hard to get definitive specs on that since it's irrelevant to the pro photography use cases the flash was designed for.
So, it seems you have two options. First, find some off the shelf photography flash units with rapid-fire mode, and test their speed yourself. You may find one that is suitable. Second, get a real scientific flash that can do 1 µs or shorter. At least those will come with datasheets so that you know upfront what it can do.
The other part of your question is how to trigger the flash. A microphone trigger should work here. Remember that the bullet is moving at about the speed of sound, so moving the microphone away from the end of the barrel also moves how far the bullet will be from the end of the barrel by about the same amount. There will be some delay in the circuit and the triggering mechanism, so start with the microphone near the end of the barrel. You can then move it sideways away from the rifle to adjust how far the bullet is captured from the end of the barrel.
Note that circuits you might find out there often trigger a relay, which then ultimately triggers the flash. Most of the time that's actually a good idea, but not in your case. Relays have some delay, often a few ms at least. Even if the circuit triggers immediately as the round goes off when the bullet is still in the chamber, the flash won't fire until the bullet is well past the end of the barrel. You need the circuit to drive a transistor that acts like a switch, which then triggers the flash. A scientific flash will come with a datasheet detailing what it takes to trigger it. With consumer flashes, you'll have to experiment.
Response to comments
I wonder why I have to use a flash there? Wouldn't it be enough to choose the smallest possible exposure time (might still be too long) and just have enough light.
The "smallest possible exposure time" of a mechanical shutter is usually much longer than a fast flash. The other problem is that the shorter exposure time reduces overall light.
An electronic flash solves both these problems. It can be accurately controlled to be much faster than mechanical shutters on pro cameras, and it adds a lot of light right when you need it.
This is why timing is almost exclusively done by controlling the light source in high-speed photography (like what Doc Edgerton used to do), and macro photography.