Liquid repellency treatment has many applications in various sectors including oil and gas reservoirs and self-cleaning surfaces. In this study, effect of silica, fluorine-doped silica and fluorine-doped silica-coating by fluorosilane nanofluid on ultrahydrophobic and ultraoleophobic surface of carbonate and sandstone rock were investigated. The nanoparticles were synthesized by sol-gel method and characterized using XRD, FTIR, FESEM and DLS and nanofluid was prepared. F–SiO2–F nanoparticle was adsorbed on surface of rocks and confirmed by FESEM and EDXA. Effect of nanofluid on wettability was investigated by measuring contact angles of water, crude oil, condensate, n-decane and ethylene glycol in air and stability of ultrahydrophobic and ultraoleophobic was investigated. Results show that nanofluid (0.05 wt% of nanoparticle) changes contact angle from strongly liquid-wet to strongly gas-wet in all systems. The original contact angle of water, crude oil, condensate, n-decane and ethylene glycol were 37.95°, 0°, 0°, 0° and 0° for carbonate rock and 40.30°, 0°, 0°, 0° and 0° for sandstone rock which altered to 146.47°, 145.59°, 138.24°, 139.06° and 146.52° for carbonate rock and 160.01°, 151.40°, 131.85°, 140.27° and 151.70° for sandstone rock after treatment. The ultraoleophobic and ultrahydrophobic stability were??>48?h and 120?min.