The construction of the defense capability portrait can accurately locate the weak points of university defenses, locate the risks of the university’s network information system, and provide security suggestions and countermeasures for university risk defense. Aiming at the problems in the construction method of network security defense capability portrait, such as large evaluation indicator system, strong subjectivity of weight and lack of theoretical support of profiling technology. The method integrates the hierarchical network security defense capability assessment with profiling technology organically, to simplify the evaluation indicator system. Relying on network security knowledge and statistical methods, it realizes the quantification of portrait labels in different dimensions and uses Analytic Hierarchy Process (AHP) to determine the weight of different indicator items, avoiding the subjectivity and arbitrariness in determining weight factors. Experimental results show that the proposed method can effectively solve the aforementioned problems, enhance the credibility and accuracy of network security defense capability portrait, and provide a theoretical basis for profiling technology. The experimental results show that the method in this paper effectively solves the shortcomings of the traditional network security capability portrait construction. In the real university network data, the evaluation results of this method are consistent with the expected effects, effectively evaluating the network security defense capabilities of universities.