The effects of the coefficient of friction and porosity on impact cratering are not sufficiently considered in scaling laws that predict the crater size from a known impactor size, velocity, and mass. We carried out a systematic numerical study employing more than 1000 two‐dimensional models of simple crater formation under lunar conditions in targets with varying properties. A simple numerical setup is used where targets are approximated as granular or brecciated materials, and any compression of porous materials results in permanent compaction. The results are found to be consistent with impact laboratory experiments for water, low‐strength and low‐porosity materials (e.g., wet sand), and sands. Using this assumption, we found that both the friction coefficient and porosity are important for estimating transient crater diameters as is the strength term in crater scaling laws, i.e., the effective strength. The effects of porosity and friction coefficient on impact cratering were parameterized and incorporated into π group scaling laws, and predict transient crater diameters within an accuracy of ±5% for targets with friction coefficients f ≥ 0.4 and porosities Φ = 0–30%. Moreover, 90 crater scaling relationships are made available and can be used to estimate transient crater diameters on various terrains and geological units with different coefficient of friction, porosity, and cohesion. The derived relationships are most robust for targets with Φ > 10–15%, applicable for a lunar environment, and could therefore yield significant insights into the influence of target properties on cratering statistics.