Make a Web honeypot scanner from scratch (2)

Make a Web honeypot scanner from scratch (0)_luozhonghua2000's blog-CSDN blog

Make a Web honeypot scanner from scratch (1) - luozhonghua2000's blog - CSDN blog 

The implementation of file reading and writing
has completed the logical judgment part of the above work, and some side branches need to be further improved below because the file generated by the crawler is an ison file, so a function is needed to operate this file, and at the same time, the file After the operation is completed, the result needs to be written to a file for final review. Therefore, it is also necessary to add modules for file reading and writing.
The read module is implemented as follows

#加载文件
def loadfile(filename):
 with open(filename,encoding='utf-8') as f:
 content = f.read()
return content

 

The write module is implemented as follows:

 

After completing the above steps, a simple honeypot scanner dimension shape is actually built.

Guess you like

Origin blog.csdn.net/luozhonghua2014/article/details/131652282