Linux - pure-ftpd

来源:互联网 发布:网络与新媒体专业美国 编辑:程序博客网 时间:2024/04/28 23:31

pure-ftpd - Secure and efficient FTP server.

Platform: Linux kali 3.14-kali1-686-pae #1 SMP Debian 3.14.5-1kali1


Install pure-ftpd

root:~ /# apt-get install pure-ftpd

Permissions

  1. Create a group and a user for ftp access.
  2. Create a ftp user, and give him a password.
  3. Set FTP root directory permissions.
root:~ /# groupadd ftproot:~ /# useradd -g ftp -d /dev/null -s /etc ftproot:~ /# mkdir /var/ftprootroot:~ /# pure-pw useradd ftp -u ftp -g ftp -d /var/ftproot/Password: Enter it again: root:~ /# pure-pw mkdbroot:~ /# pure-pw listftp                 /var/ftproot/./                                            root:~ /# pure-pw show ftpLogin              : ftpPassword           : $1$0k4WWhr0$6oFQbM9s9WRHDQH.hVtlk0UID                : 1000 (ftp)GID                : 1002 (ftp)Directory          : /var/ftproot/./Full name          : Download bandwidth : 0 Kb (unlimited)Upload   bandwidth : 0 Kb (unlimited)Max files          : 0 (unlimited)Max size           : 0 Mb (unlimited)Ratio              : 0:0 (unlimited:unlimited)Allowed local  IPs : Denied  local  IPs : Allowed client IPs : Denied  client IPs : Time restrictions  : 0000-0000 (unlimited)Max sim sessions   : 0 (unlimited)root:~ /# ln -s /etc/pure-ftpd/pureftpd.passwd /etc/pure-ftpd.passwdroot:~ /# ln -s /etc/pure-ftpd/pureftpd.pdb /etc/pureftpd.pdbroot:~ /# ln -s /etc/pure-ftpd/conf/PureDB /etc/pure-ftpd/auth/PureDBroot:~ /# chown -R ftp:ftp /var/ftproot/

Start Ftp Server

root:~ /# service pure-ftpd startStarting ftp server: Running: /usr/sbin/pure-ftpd -l puredb:/etc/pure-ftpd/pureftpd.pdb -l pam -l puredb:/etc/pure-ftpd/pureftpd.pdb -8 UTF-8 -E -u 1000 -O clf:/var/log/pure-ftpd/transfer.log -Broot:~ /# ss -antState      Recv-Q Send-Q                                                                                      Local Address:Port                                                                                        Peer Address:Port LISTEN     0      9                                                                                                      :::21                                                                                                    :::*     LISTEN     0      9                                                                                                       *:21                        

Connect to FTP Server

root:~ /# ftp ftp> open 127.0.0.1 21Connected to 127.0.0.1.220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------220-You are user number 1 of 50 allowed.220-Local time is now 22:26. Server port: 21.220-This is a private system - No anonymous login220-IPv6 connections are also welcome on this server.220 You will be disconnected after 15 minutes of inactivity.Name (127.0.0.1:root): ftp331 User ftp OK. Password requiredPassword:230 OK. Current directory is /Remote system type is UNIX.Using binary mode to transfer files.ftp> ls 200 PORT command successful150 Connecting to port 36495-rw-r--r--    1 0          0                  22 Jul  9 22:27 README.md226-Options: -l 226 1 matches totalftp> quit221-Goodbye. You uploaded 0 and downloaded 0 kbytes.221 Logout.

Crack FTP User Password

Crack pure-ftpd hash with john the ripper.

root:~ /# cat hash.txt ftp:$1$0k4WWhr0$6oFQbM9s9WRHDQH.hVtlk0:::::root:~ /# john --single  hash.txt Loaded 1 password hash (FreeBSD MD5 [128/128 SSE2 intrinsics 12x])ftp              (ftp)guesses: 1  time: 0:00:00:00 DONE (Thu Jul  9 22:33:43 2015)  c/s: 85.71  trying: ftp - ftPUse the "--show" option to display all of the cracked passwords reliablyroot:~ /# john --show  hash.txt ftp:ftp:::::1 password hash cracked, 0 left

References

  1. Installing Pure-FTPD - http://www.fuzzysecurity.com/tutorials/1.html
0 0
原创粉丝点击