You actually have a couple options:
The ability to see through walls is no longer the stuff of science fiction, thanks to new radar technology developed at MIT’s Lincoln Laboratory.
You may be thinking that this should be impossible. That's because:
At first, their radar functions as any other: Transmitters emit waves of a certain frequency in the direction of the target. But in this case, each time the waves hit the wall, the concrete blocks more than 99 percent of them from passing through. And that’s only half the battle: Once the waves bounce off any targets, they must pass back through the wall to reach the radar’s receivers — and again, 99 percent don’t make it. By the time it hits the receivers, the signal is reduced to about 0.0025 percent of its original strength.
But they managed it:
The Lincoln Lab team’s system may be used at a range of up to 60 feet away from the wall. (Demos were done at 20 feet, which Charvat says is realistic for an urban combat situation.) And, it gives a real-time picture of movement behind the wall in the form of a video at the rate of 10.8 frames per second.
Muon are produced in star cores and can pass through planets. The Earth itself in its whole is practically transparent to them. Well, most of them pass through, anyway. A very small fraction of them do collide with matter, and can thus be detected with special machinery. Some scientists in Japan used this to build a muon detector, and when pointed at a volcano, they could see where it had different densities. Kinda like an X-ray:
Images of Mount Asama published in 2007 astonished the world’s scientists. They revealed for the first time, the interior of an active volcano, impossible to see with the naked eye (Figure 1). These images, published by Professor Hiroyuki Tanaka of the Center for High Energy Geophysics Research at the Earthquake Research Institute, the University of Tokyo, were made possible by volcano muography, a technique devised at the University of Tokyo in the 1990s.
This is passive detection. However, since muons also come from outside the solar system, it just might be possible that you don't need to bring your own source even if the sun is behind you.
Right now, both technologies require big machines (there is a picture of the one used by MIT in the first link), and the resolution and rate of capture/frames are... well... for the purpose you want them. But technology usually evolves towards being faster, more accurate, and miniaturized. In real life we have to give it some more time, but in your stories people could already have both technologies made portable enough for a rifle scope.