
텍스트에서 CVE 번호를 추출하는 DataSurgeon 플러그인 (예: CVE-2021-56789)
텍스트에서 CVE 번호를 추출하는 DataSurgeon 플러그인입니다 (예: CVE-2021-56789)
Windows 사용자의 경우 C:\ds\ 디렉터리에서 플러그인 파일을 찾을 수 있습니다. Linux의 경우 ~/.DataSurgeon/plugins.json에서 플러그인 파일을 찾으세요. 혹시 이 디렉터리들에서 플러그인 파일을 찾을 수 없는 경우, 현재 작업 디렉터리를 자동으로 확인합니다.
JSON 객체의 모든 필드는 중요합니다. 플러그인이 DataSurgeon의 --add 및 --remove 옵션과 원활하게 작동하도록 하려면 plugins.json 파일을 GitHub 저장소에 업로드해야 합니다. 파일 이름을 plugins.json으로 유지하고 업로드하려는 플러그인 옵션만 포함하세요. 다음은 필드에 대한 간략한 안내입니다:
예시는 다음과 같습니다:
[
{
"content_type": "windows_registry",
"arg_long_name": "winregistry",
"version": "1.0.0",
"help_message": "Extracts windows registry paths",
"regex": "^(HKEY_(?:LOCAL_MACHINE|CURRENT_USER|CLASSES_ROOT|CURRENT_CONFIG|USERS)\\\\[\\w\\-\\.\\\\]*)",
"source_url": "https://github.com/DataSurgeon-ds/ds-cve-plugin/"
}
]
플러그인 파일이 로드되면 옵션이 추가 인수로 추가됩니다. 보시다시피 인수의 이름은 arg_long_name입니다.
drew@DESKTOP-A5AO3TO$ ds -h
Options:
......
-a, --aws Extract AWS keys
--cve Extracts CVE Identifiers
-V, --version Print version
그리고 실행 방법은 다음과 같습니다:
┌──(drew㉿IT-DREW)-[~]
└─$ ds --cve -f cves.txt
cve: The first one is CVE-2023-1234. This is a hypothetical vulnerability that was supposedly discovered in 2023.
cve: Here's another one: CVE-2021-56789. This one was supposedly discovered in 2021.
cve: And here's a third one: CVE-2020-1234567. This one was supposedly discovered in 2020.
cve: But not all strings that look like CVE identifiers are actual CVE identifiers. For example, CVE-23-1234 is not a valid identifier because the year part only has two digits. Similarly, CVE-2023-123 is not valid because the identifier part only has three digits. And CVE-2023-12345678 is not valid because the identifier part has eight digits, which is too many.
cve: Finally, note that not all CVE identifiers are associated with actual vulnerabilities. For example, CVE-2023-9999 might not be associated with any known vulnerability. To check if a CVE identifier is real, you would need to look it up in a CVE database.
┌──(drew㉿IT-DREW)-[~]
└─$ ds --cve -f cves.txt --clean
cve: CVE-2023-1234
cve: CVE-2021-56789
cve: CVE-2020-1234567
cve: CVE-2023-1234567
cve: CVE-2023-9999
새 플러그인을 추가하려면 --add <URL> 옵션을 사용해야 합니다. URL은 plugins.json 파일을 호스팅하는 원격 GitHub 저장소여야 합니다. 새 플러그인 사용 방법.
drew@DESKTOP-A5AO3TO:~$ ds --add https://github.com/DataSurgeon-ds/ds-cve-plugin/
[*] Download and added plugin: https://github.com/DataSurgeon-ds/ds-cve-plugin/
모든 플러그인을 나열하려면 --list 옵션을 사용할 수 있습니다.
drew@DESKTOP-A5AO3TO$ ds --list
Plugin File: /home/drew/.DataSurgeon/plugins.json
Source URL | Argument Long Name
https://raw.githubusercontent.com/DataSurgeon-ds/ds-cve-plugin | cve
더 이상 필요하지 않은 플러그인을 제거하려면 --remove 옵션을 사용할 수 있습니다.
drew@DESKTOP-A5AO3TO:~$ ds --remove https://github.com/DataSurgeon-ds/ds-cve-plugin//
[*] Removed plugin: https://github.com/DataSurgeon-ds/ds-cve-plugin//
| 필드 | 설명 |
|---|
| content_type | 검색 중인 콘텐츠의 한 단어 설명이어야 합니다 (공백 없음). 일치하는 콘텐츠와 함께 출력되는 단어입니다. |
| arg_long_name | 명령줄 인터페이스의 고유 인수 이름입니다. 모든 플러그인에서 고유해야 합니다. |
| help_message | 플러그인이 수행하는 작업에 대한 간결한 설명입니다. 도구의 도움말 메시지에 표시됩니다. |
| version | 플러그인의 버전 번호입니다 (예: 1.0.0) |
| regex | 콘텐츠를 일치시키는 데 사용되는 정규식입니다. --clean 옵션과의 호환성을 보장하려면 전체 일치 ($0)에 관심 있는 정확한 콘텐츠가 포함되도록 정규식을 설계해야 합니다. 이렇게 하면 --clean 옵션이 관련 일치 콘텐츠만 추출할 수 있습니다. 정규식 패턴 테스트에는 https://regexr.com/을 사용하는 것이 좋습니다. |
| source_url | 플러그인을 호스팅하는 GitHub 저장소의 URL입니다. |