The study was carried out under an experimental protocol for obtaining metallic aluminum foams with varied porosity. The protocol was based on the infiltration method in water-soluble preforms; sodium oxide (Na2O) was used as preform material, with sizes of 3, 5 and 7 mm respectively, which were placed in a pyramid shape. A metallographic analysis was carried out to determine the most relevant properties of the metallic foams, such as relative density, porosity and bond thickness. As a result of this analysis, an average relative density of the foams of 0.504 and an average porosity percentage of 49.578% were obtained. To know the ligament thickness, the Image J computer program was used, and a thickness of approximately 0.94, 1.5 and 1.8 mm was obtained for pore diameters of 3, 5 and 7 mm, respectively. As part of this research, quasi-static compression testing was performed to obtain the energy absorbed by integrating the area under the stress-strain curve. To complete the mechanical test, a dynamic compression test was carried out by frontal impact of a pendulum designed for automotive applications, in order to observe the behavior of the foams as shock absorbers. Finally, the energy absorbed was studied by calculation and demonstrates the great capacity of this type of foams to absorb deformation energy.