An investigation of compressible flow over two-dimensional obstacles is presented in this paper. When shock waves are formed on surfaces due to compressibility and these shocks interfere with the boundary layer, undesirable effects such as friction, separation, and flow instability occur. To weaken the shock and reduce its effects, various methods have been employed in the past, including surface suction, surface blowing, and vortex generators. Using numerical solutions, the present work attempts to reduce the negative effects of the shock generated by the obstacle by creating porosity on its surface. Numerical methods such as the finite volume method and the Navier-Stokes equations as well as the Spalart-Allmaras model are used. By creating suction and blowing and increasing the cross-sectional area of the flow, porous surfaces reduce the effects of shock. Achieving around 50% porosity on the obstacle weakened the shock and reduced the Mach number after it, according to this paper's results. Also, the area under the skin friction diagram has decreased by about 38% as a result of less interference between the shock and the boundary layer and blowing caused by the porous surface.