Method and system for generating attack traffic of data network

The invention provides a method and a system for generating attack traffic of a data network. The method includes directly parsing specific rules in a rule base and extracting feature bytes of the specific rules; sorting the feature bytes of the specific rules after the feature bytes are acquired, filling the sorted feature bytes into corresponding positions of a data packet, and modifying the data packet to acquire an updated data packet; computing and verifying the updated data packet and transmitting the updated data packet into the network. The method and the system have the advantages that data packets do not need to be captured in an integral data network generating procedure, the meaning of each character in the data packet does not need to be definite, accordingly, the method and the system can be implemented easily without being operated by professional programming personnel, and the method for generating the attack traffic of the data network is simple and effective.