Detection of malicious activities against advanced metering infrastructure in smart grid