一、媒介
我小我是比较懒的,先也写了个被动的扫描器,不想改以前写的器械,并且被动也有被动的长处,所以就想可弗成以让爬虫也设置个代劳。就有了下面的器械,很便利。

二、实操
主构造:
以phantomjs为核心,用JS模仿人对页面的操作,代劳软件抓链接。以下贱程是通用pychon脚本实现的。
1打开浏览器并设置代劳->2输入网址->3填充表单->4点击按钮->5点击超链拉->6封闭标签->7封闭浏览器,轮回2-6。
1. 打开浏览器并设置代劳
- proxy_config = [
- '--proxy=127.0.0.1:8080',
- '--proxy-type=http',
- '--ignore-ssl-errors=yes',
- ]
- phantomjs_path='/home/ubuntu_235/proxyscan/phantomjs/phantomjs/bin/phantomjs'
- driver = webdriver.PhantomJS(executable_path=phantomjs_path,service_args=sys_config)
2. 输入网址
- driver.get('http://demo.aisec.cn')
3. 填充表单
- _input_text = """
- var input_list=document.getElementsByTagName("input");
- for (i_i=0;i_i<input_list.length;i_i++){
- var input_type=input_list[i_i].attributes["type"].value
- if (input_type == "text" || input_type == "password"){
- input_list[i_i].value="ascan@ascan.com";
- continue;
- }
- if (input_type == "radio" || input_type == "checkbox"){
- input_list[i_i].setAttribute('target','_blank');
- input_list[i_i].checked="True";
- }
- }
- """
如安在不改变原被动扫描器的情况下让被动变成主动。
4. 点击按钮

网友点评
精彩导读
科技快报
品牌展示