通用公开报告查询
接口说明
该接口用于查询指定 IOC 指标所关联的公开安全报告。数据源覆盖国内外 300 余个安全报告、漏洞披露站点。
请求通过query.keywords传入查询条件,支持domain、ip、url三种查询字段,传入对应指标值;接口检索索引库,返回所有提及该 IOC 的公开报告集合。
请求地址
https://api.f.360.cn/custom/intelligence/v2/public_report
请求方法
POST
请求参数
| 参数名 | 类型 | 位置 | 是否必填 | 示例值 | 说明 |
|---|---|---|---|---|---|
| query | object | body | 是 | | 查询条件,所有请求参数的父级结构 |
| query.keywords | Array(object) | body | 是 | | 查询条件,所有请求参数的子级结构 |
| query.keywords.field | string | body | 是 | url | 查询条件的字段名,支持的字段有:domain、ip、url |
| query.keywords.value | string | body | 是 | http://api.sekoia.io/v1/invitations | 查询条件的字段值,为单个url |
响应参数
| 名称 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| code | string | 0 | 响应状态码 |
| msg | string | ok | 响应状态信息 |
| ret.author | String | Jared Myers,Jared Myers | 提供的作者 |
| ret.cve | Array | | cve列表 |
| ret.domain | Array | | domain列表 |
| ret.email | Array | demo.user@example.com | email列表 |
| ret.filepath | Array | | filepath列表 |
| ret.header_time | String | 0000-00-00 00:00:00 | 页面头部时间 |
| ret.id | String | 3150690 | ioc存储表的id字段 |
| ret.ip | Array | | ip列表 |
| ret.md5 | Array | | md5列表 |
| ret.package | Array | | package列表 |
| ret.pdbpath | Array | | pdbpath列表 |
| ret.registry | Array | | registry列表 |
| ret.sha1 | Array | | sha1列表 |
| ret.sha256 | Array | | sha256列表 |
| ret.similar_urls | Array(string) | | 可以为空 |
| ret.tags | String | WEB安全,漏洞 | 文章tag |
| ret.title | String | SEKOIA.IO activity logs - SEKOIA.IO Documentation | 目标标题 |
| ret.trojan | Array | | trojan列表 |
| ret.update_time | String | 2022-12-31 21:33:23 | 上一次更新的时间 |
| ret.url | String | http://api.sekoia.io/v1/invitations | 页面的url地址 |
| ret.urls | Array | "https://app.sekoia.io/user/profile/communities/09c6528e-1b9f-4b81-98c8-482cea4e7974/members", "http://api.sekoia.io/v1/invitations", "https://app.test.sekoia.io/operations/intakes/new" | url列表 |
| search.type | String | ip | 查询参数携带的ioc类型 |
| search.value | String | 1.2.3.4 | 查询参数携带的ioc类型的值 |
| total | string | 10 | 查询出的公开报告数量 |
| total_info.domain | String | 73 | domain列表的数量 |
| total_info.ip | String | 60 | ip列表的数量 |
| total_info.md5 | String | 7 | md5列表的数量 |
| total_info.sha1 | String | 10 | sha1列表的数量 |
| total_info.sha256 | String | 152 | sha256列表的数量 |
请求示例
支持cUrl、Python、Java、PHP、Go语言的请求,示例如下
#!/usr/bin/env bash
set -euo pipefail
APPID="" # apikey
SECRET="" # salt
URL="https://api.f.360.cn/custom/intelligence/v2/public_report"
BODY='{"query":{"keywords":[{"field":"url","value":"http://api.sekoia.io/v1/invitations"}]}}'
NONCE=$(printf '%08d' $((RANDOM % 100000000)))
TIMESTAMP=$(date +%s)
BODY_MD5=$(printf '%s' "$BODY" | openssl dgst -md5 -hex | awk '{print $NF}')
SIGNATURE=$(printf '%s' "${BODY_MD5}${APPID}${NONCE}${TIMESTAMP}${SECRET}" | openssl dgst -md5 -hex | awk '{print $NF}')
SIGNATURE=${SIGNATURE:16}
curl --location --request POST "$URL" \
--header "Content-Type: application/json" \
--header "X-360-Key: ${APPID}" \
--header "X-360-Nonce: ${NONCE}" \
--header "X-360-Timestamp: ${TIMESTAMP}" \
--header "X-360-Signature: ${SIGNATURE}" \
--data "${BODY}"# python3.6.8
# -*- coding:utf-8 -*—
import hashlib
import json
import random
import time
import requests
APPID = "" # apikey
SECRET = "" # salt
def make_headers(appid, secret, body):
headers = {}
headers["X-360-Key"] = appid
headers["X-360-Nonce"] = str(random.randint(0, 99999999)).zfill(8)
headers["X-360-Timestamp"] = str(int(time.time()))
s = (
hashlib.md5(body.encode("utf8")).hexdigest()
+ headers["X-360-Key"]
+ headers["X-360-Nonce"]
+ headers["X-360-Timestamp"]
+ secret
)
md5 = hashlib.md5(s.encode("utf8")).hexdigest()
headers["X-360-Signature"] = md5[16:]
headers["Content-Type"] = "application/json"
return headers
def do_post(url, body):
res = requests.post(
url,
data=json.dumps(params),
headers=make_headers(APPID, SECRET, json.dumps(body)),
)
print(res.text)
if __name__ == "__main__":
# 请求地址
url = "https://api.f.360.cn/custom/intelligence/v2/public_report"
params = {
"query": {
"keywords": [
{"field": "url", "value": "http://api.sekoia.io/v1/invitations"}
]
}
}
do_post(url, params)import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.util.concurrent.ThreadLocalRandom;
public class Demo {
static String md5(String input) throws Exception {
byte[] digest = MessageDigest.getInstance("MD5")
.digest(input.getBytes(StandardCharsets.UTF_8));
StringBuilder sb = new StringBuilder();
for (byte b : digest) {
sb.append(String.format("%02x", b & 0xff));
}
return sb.toString();
}
public static void main(String[] args) throws Exception {
String appid = ""; // apikey
String secret = ""; // salt
String url = "https://api.f.360.cn/custom/intelligence/v2/public_report";
String body = "{\"query\":{\"keywords\":[{\"field\":\"url\",\"value\":\"http://api.sekoia.io/v1/invitations\"}]}}";
String nonce = String.format("%08d", ThreadLocalRandom.current().nextInt(100000000));
String timestamp = String.valueOf(System.currentTimeMillis() / 1000);
String signature = md5(md5(body) + appid + nonce + timestamp + secret).substring(16);
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Content-Type", "application/json")
.header("X-360-Key", appid)
.header("X-360-Nonce", nonce)
.header("X-360-Timestamp", timestamp)
.header("X-360-Signature", signature)
.POST(HttpRequest.BodyPublishers.ofString(body, StandardCharsets.UTF_8))
.build();
HttpClient client = HttpClient.newHttpClient();
HttpResponse<String> response = client.send(
request, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8));
System.out.println(response.body());
}
}<?php
// apikey
$appid = "";
// salt
$secret = "";
$url = 'https://api.f.360.cn/custom/intelligence/v2/public_report';
$body = json_encode([
'query' => ['keywords' => [['field' => 'url', 'value' => 'http://api.sekoia.io/v1/invitations']]],
], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
$nonce = str_pad((string) random_int(0, 99999999), 8, "0", STR_PAD_LEFT);
$timestamp = (string) time();
$signature = substr(md5(md5($body) . $appid . $nonce . $timestamp . $secret), 16);
$ch = curl_init($url);
$options = [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-360-Key: {$appid}",
"X-360-Nonce: {$nonce}",
"X-360-Timestamp: {$timestamp}",
"X-360-Signature: {$signature}",
],
];
$options[CURLOPT_POST] = true;
$options[CURLOPT_POSTFIELDS] = $body;
curl_setopt_array($ch, $options);
$response = curl_exec($ch);
if ($response === false) {
echo curl_error($ch), PHP_EOL;
} else {
echo $response, PHP_EOL;
}
curl_close($ch);package main
import (
"bytes"
"crypto/md5"
"encoding/hex"
"fmt"
"io"
"math/rand"
"net/http"
"time"
)
func md5Hex(s string) string {
sum := md5.Sum([]byte(s))
return hex.EncodeToString(sum[:])
}
func main() {
appid := "" // apikey
secret := "" // salt
url := "https://api.f.360.cn/custom/intelligence/v2/public_report"
body := []byte(`{"query":{"keywords":[{"field":"url","value":"http://api.sekoia.io/v1/invitations"}]}}`)
nonce := fmt.Sprintf("%08d", rand.Intn(100000000))
timestamp := fmt.Sprintf("%d", time.Now().Unix())
signature := md5Hex(md5Hex(string(body)) + appid + nonce + timestamp + secret)[16:]
req, err := http.NewRequest(http.MethodPost, url, bytes.NewReader(body))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-360-Key", appid)
req.Header.Set("X-360-Nonce", nonce)
req.Header.Set("X-360-Timestamp", timestamp)
req.Header.Set("X-360-Signature", signature)
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
respBody, err := io.ReadAll(resp.Body)
if err != nil {
panic(err)
}
fmt.Println(string(respBody))
}响应示例
业务正常响应
{
"_oid": 1,
"code": "0",
"msg": "ok",
"data": {
"total": "1",
"ret": [
{
"id": 3150690,
"title": "SEKOIA.IO activity logs - SEKOIA.IO Documentation",
"author": "",
"search": {
"type": "ip",
"value": "1.2.3.4"
},
"md5": [],
"sha1": [],
"sha256": [],
"ip": [
"107.0.0.0",
"1.2.3.4",
"1.9.7.20",
"141.229.130.228",
"51.255.128.104",
"149.202.162.59"
],
"urls": [
"https://app.sekoia.io/user/profile/communities/09c6528e-1b9f-4b81-98c8-482cea4e7974/members",
"http://api.sekoia.io/v1/invitations",
"https://app.test.sekoia.io/operations/intakes/new",
"https://app.sekoia.io/user/profile/communities/09c6528e-1b9f-4b81-98c8-482cea4e7974/members/1b28fe10-fa7c-430b-b97e-10874c9eca2e",
"https://api.sekoia.io/v1/user/profile/settings",
"https://app.sekoia.io/operations/events?jobid=e2516dab-a983-40bd-bc08-edfd76c5c07c",
"http://api.sekoia.io/v1/me?extended=true",
"http://api.sekoia.io/v1/ingest/formats/4d05ecd7-1a8a-4ce1-8e6d-c2de2593fa97/picture",
"http://api.sekoia.io/v1/sic/conf/events/search/jobs",
"http://api.sekoia.io/v1/communities/09c6528e-1b9f-4b81-98c8-482cea4e7974/roles/2379a555-2817-4503-b7da-a30595fd8af5"
],
"trojan": [],
"email": [
"demo.user@example.com"
],
"domain": [
"sekoiaio.activity.community",
"sekoiaio.activity.client.id",
"api.sekoia.io",
"sekoiaio.activity.entity.id",
"sekoiaio.activity.intake.format.name",
"user.target.email",
"sekoiaio.activity.rule.name",
"sekoiaio.activity.intake.name",
"sekoiaio.activity.user.email",
"sekoiaio.activity.asset.name",
"observer.name",
"sekoiaio.activity.role.name",
"sekoiaio.activity.intake.format.module.name",
"sekoiaio.activity.community.name",
"sekoiaio.activity.apikey.name",
"user.target.id",
"user.id",
"sekoiaio.activity.archive.name",
"sekoiaio.activity.entity.name",
"sekoiaio.activity.user.name",
"sekoia.io"
],
"filepath": [],
"pdbpath": [],
"registry": [],
"cve": [
"cve-2020-17530",
"cve-2020-1147",
"cve-2020-0688",
"cve-2021-20023",
"cve-2019-0604",
"cve-2021-20021"
],
"url": "https://t.co/l8lKHrfv06",
"update_time": "2022-12-31 21:33:23",
"header_time": "0000-00-00 00:00:00",
"total_info": {
"sha1": 0,
"sha256": 0,
"ip": 6,
"domain": 21,
"md5": 0
},
"similar_urls": [],
"package": []
}
]
},
"status": 0
}业务异常响应
{
"code": "GC00101",
"msg": "param missing"
}