AWVS 使用方法归纳

 1.首先确认扫描的网站,以本地的dvwa为例

2.在awvs中添加目标

输入的地址可以是域名也可以是ip,只要本机可以在浏览器访问的域名或ip即可

添加地址及描述之后,点击保存,就会展现出目标设置选项

business criticality译为业务关键性,可理解为扫描资产的重要性

扫描速度:Moderate模式代表的是同一时间发送5个请求,然后每个请求延迟20毫秒

3.添加登录信息

需要登陆的页面,点new BLR会自动记录登录的响应

除了自动添加外

还有跟稳定更推荐用的手动添加cookie方式

点击cookie打开附加选项

选择该选项手动添加cookie

cookie可在开发者工具-‘网络’选项卡中获得

添加cookie之后,还要手动添加排除路径也就是登出路径。防止工具在扫描到登出路径提前退出扫描

4.之后就可以开始扫描

显示有五个选项卡,scan information、vulnerablities(扫到的漏洞)、site structure(网站目录结构)、scan statistics(扫描统计信息)、events

AWVS(Acunetix Web Vulnerability Scanner)是一款常用的Web漏洞扫描器,其支持API接口,可以与其他应用程序进行集成。在Java中调用AWVS方法主要有以下几步: 1. 通过HTTP POST方法AWVS发送扫描请求,同时传递扫描相关的参数,如目标URL、扫描策略等; 2. 获取AWVS返回的扫描任务ID,可以通过AWVS提供的API获取; 3. 通过AWVS提供的API获取扫描任务的状态,直到扫描任务完成或者出现错误; 4. 获取扫描结果,包括漏洞报告、扫描日志等。 以下是一个示例代码,可以帮助你更好地理解Java调用AWVS方法: ``` import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.HttpClientBuilder; import org.json.JSONException; import org.json.JSONObject; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class AwvsScanner { private static final String AWVS_API_URL = "https://your-awvs-url-here.com/api/v1"; private static final String AWVS_API_KEY = "your-awvs-api-key-here"; public static void main(String[] args) throws IOException, JSONException { String targetUrl = "http://example.com"; String scanPolicy = "full-audit"; String scanRequest = buildScanRequest(targetUrl, scanPolicy); String scanTaskId = startScan(scanRequest); String scanStatus = getScanStatus(scanTaskId); while (!"completed".equals(scanStatus) && !"failed".equals(scanStatus)) { try { Thread.sleep(5000); scanStatus = getScanStatus(scanTaskId); } catch (InterruptedException e) { e.printStackTrace(); } } String scanResult = getScanResult(scanTaskId); System.out.println(scanResult); } private static String buildScanRequest(String targetUrl, String scanPolicy) throws JSONException { JSONObject request = new JSONObject(); request.put("target_url", targetUrl); request.put("profile_id", scanPolicy); return request.toString(); } private static String startScan(String scanRequest) throws IOException, JSONException { String scanTaskId = null; HttpClient httpClient = HttpClientBuilder.create().build(); HttpPost request = new HttpPost(AWVS_API_URL + "/scans"); StringEntity params = new StringEntity(scanRequest); request.addHeader("X-Auth", AWVS_API_KEY); request.addHeader("Content-Type", "application/json"); request.setEntity(params); HttpResponse response = httpClient.execute(request); BufferedReader reader = new BufferedReader( new InputStreamReader(response.getEntity().getContent())); String line; while ((line = reader.readLine()) != null) { JSONObject jsonResponse = new JSONObject(line); scanTaskId = jsonResponse.getString("target_id"); } return scanTaskId; } private static String getScanStatus(String scanTaskId) throws IOException, JSONException { String scanStatus = null; HttpClient httpClient = HttpClientBuilder.create().build(); HttpGet request = new HttpGet(AWVS_API_URL + "/scans/" + scanTaskId + "/status"); request.addHeader("X-Auth", AWVS_API_KEY); request.addHeader("Content-Type", "application/json"); HttpResponse response = httpClient.execute(request); BufferedReader reader = new BufferedReader( new InputStreamReader(response.getEntity().getContent())); String line; while ((line = reader.readLine()) != null) { JSONObject jsonResponse = new JSONObject(line); scanStatus = jsonResponse.getString("status"); } return scanStatus; } private static String getScanResult(String scanTaskId) throws IOException, JSONException { String scanResult = null; HttpClient httpClient = HttpClientBuilder.create().build(); HttpGet request = new HttpGet(AWVS_API_URL + "/scans/" + scanTaskId + "/results"); request.addHeader("X-Auth", AWVS_API_KEY); request.addHeader("Content-Type", "application/json"); HttpResponse response = httpClient.execute(request); BufferedReader reader = new BufferedReader( new InputStreamReader(response.getEntity().getContent())); String line; while ((line = reader.readLine()) != null) { scanResult += line; } return scanResult; } } ``` 需要注意的是,以上示例代码仅供参考,实际调用AWVS时需要根据自己的需求进行适当的修改。同时,由于AWVS的API接口可能会发生变化,建议在使用时先查阅相关的API文档。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值