  The Event Horizon Telescope has recently observed the images and shadows of
the compact objects M87$^*$ and Sgr A$^*$ at the centres of the galaxies
Messier 87 and Milky Way. This has opened up a new window in observational
astronomy to probe and test gravity and fundamental physics in the strong-field
regime. In this paper, we consider a rotating version of a modified
Janis-Newman-Winicour metric, study its shadow, and constrain the metric
parameters using the observed shadows of M87$^*$ and Sgr A$^*$. Depending on
parameter values, the spacetime metric represents either a naked singularity or
a wormhole. We find that the naked singularity case is not consistent with
observations, as it casts a shadow which is much smaller than the observed
ones. On the other hand, the shadow formed by the wormhole branch, depending on
the parameter values, is consistent with the observations. We put constraints
on the wormhole throat radius by comparing the shadow with the observed ones of
M87$^*$ and Sgr A$^*$.
