This paper introduces GHGfrack, an open-source engineering-based model that estimates energy consumption and associated GHG emissions from drilling and hydraulic fracturing operations. We describe verification and calibration of GHGfrack against field data for energy and fuel consumption. We run GHGfrack using data from 6927 wells in Eagle Ford and 4431 wells in Bakken oil fields. The average estimated energy consumption in Eagle Ford wells using lateral hole diameters of 8 (3)/4 and 6 (1)/8 in. are 2.25 and 2.73 TJ/well, respectively. The average estimated energy consumption in Bakken wells using hole diameters of 6 in. for horizontal section is 2.16 TJ/well. We estimate average greenhouse gas (GHG) emissions of 419 and 510 tonne of equivalent CO2 per well (tonne of CO2 eq/well) for the two aforementioned assumed geometries in Eagle Ford, respectively, and 417 tonne of CO2 eq/well for the case of Bakken. These estimates are limited only to GHG emissions from combustion of diesel fuel to supply energy only for rotation of drill string, drilling mud circulation, and fracturing pumps. Sensitivity analysis of the model shows that the top three key variables in driving energy intensity in drilling are the lateral hole diameter, drill pipe internal diameter, and mud flow rate. In hydraulic fracturing, the top three are lateral casing diameter, fracturing fluid volume, and length of the lateral.