The interaction between clay minerals in formations and drilling fluids was analyzed through a study of four core plugs in different types of fluid, including gas oil, anionic surfactant (SDS), non-ionic surfactant (PEG), and cationic surfactant (CTAB). The core plugs were cut for petrophysical tests, including permeability, saturation, X-ray diffraction, and petrographical analyses. The original samples contained clay minerals such as illite and smectite. A static immersion test revealed that swelling and dispersing changed the original petrophysical rock properties of the samples. The addition of nanoparticles of Ca, K, Na, Cl at low, high, and saturated salinity in sodium chloride (NaCl), potassium chloride (KCl), and calcium chloride (CaCl2) was used to reduce active shale and increase mud density from 8.33 to 11.8 ppg, improving petrophysical rock properties by reducing filtration and swelling. The permeability and water saturation were measured before and after core injection of the drilling fluids. The results showed that surfactants (PEG) > (SDS) > (CTAB) in a water-based drilling fluid improved fluid loss and viscosity and reduced the interfacial tension, shifting the reservoir wettability towards a more water-wet state in low, high, and saturation salinity. The use of surfactants in water-based mud reduced formation damage and increased well productivity.