A method of consolidating unconsolidated weak zones or formations formed of clays, shales, and sand stone to prevent sloughing and forming a chemical casing in a well bore penetrating the weak zones or formations to improve the mechanical strength thereof or to provide zonal isolation, or both, while drilling the well bore comprising drilling said well bore with a drilling fluid having a pH of about 8 and comprised of water, a cationic, polyethyleneimine catalyst which is adsorbed on said unconsolidated clays, shales and sand stone and present in an amount in the range of from about 2% to about 10% by weight of water in said drilling fluid, a polysaccharide polymer which is capable of being cross-linked by a thermoset resin and causes the resin to be hard and tough when cured present in said drilling fluid in an amount in the range of from about 1% to about 10% by weight of water in said drilling fluid, a particulate curable solid alkyl ether of melamine-formaldehyde resin present in said drilling fluid in an amount in the range of from about 10% to about 30% by weight of water in said drilling fluid, a water soluble or dispersible alkyl ether of melamine-formaldehyde resin present in said drilling fluid in an amount in the range of from about 20% to about 70% by weight of water in said drilling fluid and a dispersible delayed ammonium chloride acid catalyst for curing said particulate solid resin and said water soluble or dispersible resin present in said drilling fluid in an amount in the range of from about 1% to about 6% by weight of said resins in said drilling fluid, the drilling fluid forming a filter cake on the walls of said well bore that cures and consolidates said unconsolidated weak zones and formations penetrated by said well bore so that sloughing is prevented and forms a hard and tough cross-linked chemical casing on the walls of said well bore.