awvs13使用教程_脚本网

awvs13使用教程_脚本网你可以在以下渠道联系到我,转载请注明文章来源地址~知乎:Sp4rkWGITHUB:Sp4rkWB站:一只技术君博客:https://sp4rkw.blog.csdn.net/联系邮箱:getf_own@163.com文章目录前言核心接口仪表盘接口新增任务接口设置扫描速度启动扫描任务丝滑脚本前言最近在改reaper的awvs互动功能,因为自己的服务器垃圾,一次最多扫四个站,否则就卡死了。所以需要对现有的批量脚本进行修改处理。逻辑比较简单:拿到web资产,django异步启扫描任务从l

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE使用 1年只要46元 售后保障 童叟无欺

你可以在以下渠道联系到我,转载请注明文章来源地址~

  • 知乎:Sp4rkW
  • GITHUB:Sp4rkW
  • B站:一只技术君
  • 博客:https://sp4rkw.blog.csdn.net/
  • 联系邮箱:getf_own@163.com

前言

最近在改reaper的awvs互动功能,因为自己的服务器垃圾,一次最多扫四个站,否则就卡死了。所以需要对现有的批量脚本进行修改处理。逻辑比较简单:

  • 拿到web资产,django异步启扫描任务
  • 从list中取出前四个,丢入awvs,选择slow模式慢慢扫
  • 一分钟判断一次目前正在扫描的任务数量,不满4个自动新增补全到4个任务
  • 知道列表为空

django部分代码略去,awvs的部分代码我提取出来了,供大家使用

核心接口

仪表盘接口

/api/v1/me/stats
参数 说明
most_vulnerable_targets 最脆弱的目标
scans_conducted_count 总进行扫描个数
scans_running_count 正在扫描的个数
scans_waiting_count 等待扫描的个数
targets_count 总进行扫描个数
top_vulnerabilities 排名靠前漏洞分布
vuln_count_by_criticality 通过危险程度进行漏洞等级个数分布
vuln_count 漏洞数据
vuln_count_by_criticality 通过危险程度进行漏洞等级个数分布
top_vulnerabilities 排名靠前漏洞分布
vulnerabilities_open_count 共发现漏洞总数
#核心代码如下
api_running_url = 'https://x/api/v1/me/stats'
headers = { 
   
    'X-Auth': 'x',
    'Content-type': 'application/json'
}
r = requests.get(url=api_running_url, headers=headers, verify=False).json()
print(r['scans_running_count']) # 正在扫描的个数

# 返回数据如下:
{ 
   'most_vulnerable_targets': [], 'scans_conducted_count': 0, 'scans_running_count': 0, 'scans_waiting_count': 0, 'targets_count': 0, 'top_vulnerabilities': [], 'vuln_count': { 
   'high': None, 'low': None, 'med': None}, 'vuln_count_by_criticality': { 
   'critical': None, 'high': None, 'low': None, 'normal': None}, 'vulnerabilities_open_count': 0}

新增任务接口

Method:POST 
URL: /api/v1/targets
发送参数 类型 说明
address string 目标网址:需http或https开头
criticality Int 危险程度;范围:[30,20,10,0];默认为10
description string 备注
# 发送代码如下
api_add_url = "https://x/api/v1/targets"
headers = { 
   
    'X-Auth': 'x',
    'Content-type': 'application/json'
}

data = '{"address":"http://vulnweb.com/","description":"create_by_reaper","criticality":"10"}'

r = requests.post(url=api_add_url, headers=headers, data=data,verify=False).json()
print(r)
返回参数 说明
address 目标网址
criticality 危险程度
description 备注
type 类型
domain 域名
target_id 目标id
target_type 目标类型
canonical_address 根域名
canonical_address_hash 根域名hash
# 返回包如下

{'address': 'http://vulnweb.com/', 'criticality': 10, 'description': 'create_by_reaper', 'type': 'default', 'domain': 'vulnweb.com', 'target_id': '13564b22-7fd8-46d5-b10f-3c87a6cc6afa', 'target_type': None, 'canonical_address': 'vulnweb.com', 'canonical_address_hash': '823a9c89d4aea02ab8a4f5d31fd603c7'} 

设置扫描速度

Method:PATCH 
URL: /api/v1/targets/{target_id}/configuration
参数 类型 说明
scan_speed string 由慢到快:sequential slow moderate fast
# 核心代码
api_speed_url = "https://x/api/v1/targets/{}/configuration".format(target_id)
data = json.dumps({ 
   "scan_speed":"sequential"})

r = requests.patch(url=api_speed_url, headers=headers, data=data, verify=False)

print(r)

# 返回
<Response [204]>   #代表成功

启动扫描任务

Method:POST
URL: /api/v1/scans
参数 类型 说明
profile_id string 扫描类型
ui_session_i string 可不传
schedule json 扫描时间设置(默认即时)
report_template_id string 扫描报告类型(可不传)
target_id string 目标id
扫描类型 国光翻译的理解
Full Scan 11111111-1111-1111-1111-111111111111 完全扫描
High Risk Vulnerabilities 11111111-1111-1111-1111-111111111112 高风险漏洞
Cross-site Scripting Vulnerabilities 11111111-1111-1111-1111-111111111116 XSS漏洞
SQL Injection Vulnerabilities 11111111-1111-1111-1111-111111111113 SQL注入漏洞
Weak Passwords 11111111-1111-1111-1111-111111111115 弱口令检测
Crawl Only 11111111-1111-1111-1111-111111111117 Crawl Only
Malware Scan 11111111-1111-1111-1111-111111111120 恶意软件扫描
# 核心代码
data = '{"profile_id":"11111111-1111-1111-1111-111111111111","schedule":{"disable":false,"start_date":null,"time_sensitive":false},"target_id":"%s"}'% target_id

r = requests.post(url=api_run_url, headers=headers, data=data, verify=False).json()
print(r)


# 返回包
{ 
   'profile_id': '11111111-1111-1111-1111-111111111111', 'schedule': { 
   'disable': False, 'start_date': None, 'time_sensitive': False, 'triggerable': False}, 'target_id': '13564b22-7fd8-46d5-b10f-3c87a6cc6afa', 'incremental': False, 'max_scan_time': 0, 'ui_session_id': None}

丝滑脚本

import requests
import json
import time
from requests.packages.urllib3.exceptions import InsecureRequestWarning

requests.packages.urllib3.disable_warnings(InsecureRequestWarning)


# 请自行对接子域名列表,格式demo见main

awvs_token = 'xxx'
website = ""


def awvs_reaper(domainlist):# 接受域名list类型
    headers = { 
   
        'X-Auth': awvs_token,
        'Content-type': 'application/json;charset=utf8'
    }

    api_running_url = website+'/api/v1/me/stats'
    api_add_url = website+"/api/v1/targets"
    api_run_url = website+"/api/v1/scans"

    # 先把所有任务添加上并调整速度
    target_list = []
    for target in domainlist:
        data = '{"address":"%s","description":"create_by_reaper","criticality":"10"}'% target
        r = requests.post(url=api_add_url, headers=headers, data=data, verify=False).json()
        target_id = r['target_id']
        api_speed_url = website+"/api/v1/targets/{}/configuration".format(target_id)
        data = json.dumps({ 
   "scan_speed":"fast"})# slow最慢,一般建议fast
        r = requests.patch(url=api_speed_url, headers=headers, data=data, verify=False)
        target_list.append(target_id)

    target_num = len(target_list)

    if target_num <= 4:
        for target_id in target_list:
            data = '{"profile_id":"11111111-1111-1111-1111-111111111111","schedule":{"disable":false,"start_date":null,"time_sensitive":false},"target_id":"%s"}'% target_id
            r = requests.post(url=api_run_url, headers=headers, data=data, verify=False).json()
    else:
        r = requests.get(url=api_running_url, headers=headers, verify=False).json()
        runnum = int(r['scans_running_count']) # 正在扫描的个数
        flag = 0 # 做数组标志位
        while flag < target_num:
            if runnum < 4:
                target_id = target_list[flag]
                flag = flag + 1
                data = '{"profile_id":"11111111-1111-1111-1111-111111111111","schedule":{"disable":false,"start_date":null,"time_sensitive":false},"target_id":"%s"}'% target_id
                r = requests.post(url=api_run_url, headers=headers, data=data, verify=False).json()
                r = requests.get(url=api_running_url, headers=headers, verify=False).json()
                runnum = int(r['scans_running_count']) # 正在扫描的个数
            else:
                pass
            time.sleep(60)
    return target_num


if __name__ == "__main__":
    domainlist = ['http://10086.1.com', 'http://10087.1.com', 'http://10088.1.com']#必须带http或者https
    awvs_reaper(domainlist)

# linux服务器配合screen持久化运行

#注意,无授权请勿扫描,后果自负
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/190716.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • idea激活码2021.4.21【在线破解激活】

    idea激活码2021.4.21【在线破解激活】,https://javaforall.net/100143.html。详细ieda激活码不妨到全栈程序员必看教程网一起来了解一下吧!

    2022年3月16日
    57
  • 100道Go语言面试题

    100道Go语言面试题多选题1.【初级】下面属于关键字的是()A.funcB.defC.structD.class参考答案:AC2.【初级】定义一个包内全局字符串变量,下面语法正确的是()A.varstrstringB.str:=””C.str=””D.varstr=””参考答案:AD3.【初级】通过指针变量p访问其成员变量name,下面语法正确的是()A.p.nameB.(*p).nameC.(&…

    2022年6月28日
    34
  • Centos开启6379端口

    Centos开启6379端口查看zone名称[root@vm-centos-1data]#firewall-cmd–get-active-zones#显示publicinterfaces:ens33开启6379端口[root@vm-centos-1data]#firewall-cmd–zone=public–add-port=6379/tcp–permanent#显示…

    2022年5月22日
    78
  • Java PreparedStatement

    Java PreparedStatementJavaPreparedStatementisjustlikeaStatementandit’spartoftheJavaJDBCFramework.JavaPreparedStatement就像一个Statement,它是JavaJDBCFramework的一部分。ItisusedtoperformcrudoperationswithData…

    2022年6月6日
    38
  • 文字超出三行省略…显示全文「建议收藏」

    文字超出三行省略…显示全文「建议收藏」1、在开发过程中,我们经常会用到这种超出三行显示…的要求,使用css属性是可以的,但是需要考虑兼容性问题实现单行文本的溢出显示省略号,我们应该都知道用text-overflow:ellipsis

    2022年8月2日
    2
  • 网络推广100种方法有哪些_100种宣传方式

    网络推广100种方法有哪些_100种宣传方式一米软件发现网上很多人都在找网络推广100种方法,但 其实网站推广并不是方法越多越好,而是找到适合自己的方法为宜,下面一米软件就来给大家介绍下一些常用网站推广的方法。1、搜索引擎营销搜索引擎营销,这种方法一般是通过自建官网然后针对官网进行优化与更新,使得网站在搜索引擎中有一个好的排名。也有通过做付费推广,使得网站的某个关键词在搜索引擎中有个好的排名。2、自媒…

    2022年4月20日
    190

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号