基于TF-IDF的防网页篡改监测系统
2021-01-28麦欣彦郑棉炜张占英
麦欣彦 郑棉炜 张占英



摘要:在信息技术飞速发展的现代,网络安全越加重要已是未来的趋势所向。随着越来越多的人登录网站、浏览网站,判断网站内容是否真实、是否被篡改成为一大难题。于是网站防篡改监测系统的构建变得极其重要,本文构建了一种基于TF-IDF的防网页篡改监测系统,用于解决网页内容被篡改而导致获得信息不真实的情况。基于TF-IDF的防网页篡改监测系统通过使用爬虫技术获得网页信息,并对爬虫获得的网页信息进行预处理,接着使用TF-IDF算法将网页信息量化,计算网页间的余弦相似度,当相似度低于报警阈值时,系统将对网站管理者发出警报。本系统解决了由于网站管理人员水平的参差不齐以及不同网站管理的难度差异大所造成的网站安全隐患,建立了有效的监测机制,适用于绝大多数网站。在成本和效率上大大的改进了传统的人工监测网站的方法,有很大的应用前景。
关键词:爬虫技术;TF-IDF算法;余弦相似度;防网页篡改监测系统
Abstract:In the modern era of rapid development of information technology, the increasing importance of network security is the future trend. As more and more people log on and browse the website, judging whether the content of the website is authentic and whether it has been tampered with has become a major problem. Therefore, the construction of an anti-tampering monitoring system for websites has become extremely important. This article constructs a TF-IDF-based anti-tampering monitoring system for web pages to solve the problem of untrue information obtained due to tampering of web content. The TF-IDF-based anti-tampering monitoring system for web pages obtains web page information by using crawler technology, and preprocesses the web page information obtained by the crawler, and then uses the TF-IDF algorithm to quantify the web page information and calculate the cosine similarity between web pages. When the degree is lower than the alarm threshold, the system will issue an alarm to the site manager. This system solves the hidden dangers of website security caused by the unevenness of the level of website management personnel and the large differences in the difficulty of different website management, and establishes an effective monitoring mechanism, which is suitable for most websites. It has greatly improved the traditional website monitoring method in terms of cost and efficiency, and has great application prospects.
Keywords: crawler technology, TF-IDF algorithm, cosine similarity, anti-tampering monitoring system.
一、引言
近年来,随着互联网行业的高速发展,越来越多的人已经习惯通过访问一个学校或者公司的官网来了解相关信息。但是由于网站管理人员水平的参差不齐,缺乏有效监测机制,导致网站存在着不同程度的安全隐患。2017年我国开始施行《中华人民共和国网络安全法》,其中第二十一条明确规定了“国家实行网络安全等级保护制度,要求网络运营者应当按照网络安全等级保护制度要求,履行安全保护义务”,体现了国家对网络安全这一领域的重视。……
