elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: (TUTORIAL) Aprende a emular Sentinel Dongle By Yapis


+  Foro de elhacker.net
|-+  Sistemas Operativos
| |-+  GNU/Linux (Moderador: MinusFour)
| | |-+  Duda con Proftpd en Debian 6
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: Duda con Proftpd en Debian 6  (Leído 2,513 veces)
PeGaSs0

Desconectado Desconectado

Mensajes: 13



Ver Perfil
Duda con Proftpd en Debian 6
« en: 16 Febrero 2015, 18:16 pm »

Buenas chicos, sigo haciendo el proyecto, esta vez con proftpd, parece que todo funciona "aparentemente" pero me gustaría enseñaros las líneas de código y me dierais vuestra opinión o al menos saber que cambios haríais vosotros, esto es lo que se plantea:

Se deberá instalar y configurar un servidor PROFTPD con los siguientes parámetros:

Host:  authenticated.seas-linux.es   

Configuración:

Directorio raíz: /var/ftp-<usuario>/
Accesible para el usuario guest-seas con la contraseña del sistema para el usuario del alumno.
Permisos:
   - MKD, STOR, RETR.
Solo accesible desde la subred del alumno.

Código:
#

# /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file.

# To really apply changes reload proftpd after modifications.

#



# Includes DSO modules

Include /etc/proftpd/modules.conf



# Set off to disable IPv6 support which is annoying on IPv4 only boxes.

UseIPv6 off

# If set on you can experience a longer connection delay in many cases.

IdentLookups off



ServerName "authenticated.seas-linux.es"

ServerType standalone

DeferWelcome on



MultilineRFC2228 on

DefaultServer on

ShowSymlinks off



TimeoutNoTransfer 600

TimeoutStalled 600

TimeoutIdle 1200



DisplayLogin                    welcome.msg

DisplayChdir               .message true

ListOptions                 "-l"



DenyFilter \*.*/



# Use this to jail all users in their homes

DefaultRoot "/var/ftp-alumno/" guest-seas



# Users require a valid shell listed in /etc/shells to login.

# Use this directive to release that constrain.

# RequireValidShell off



# Port 21 is the standard FTP port.

Port 21



# In some cases you have to specify passive ports range to by-pass

# firewall limitations. Ephemeral ports can be used for that, but

# feel free to use a more narrow range.

# PassivePorts                  49152 65534



# If your host was NATted, this option is useful in order to

# allow passive tranfers to work. You have to use your public

# address and opening the passive ports used on your firewall as well.

# MasqueradeAddress 1.2.3.4



# This is useful for masquerading address with dynamic IPs:

# refresh any configured MasqueradeAddress directives every 8 hours

<IfModule mod_dynmasq.c>

# DynMasqRefresh 28800

</IfModule>



# To prevent DoS attacks, set the maximum number of child processes

# to 30.  If you need to allow more than 30 concurrent connections

# at once, simply increase this value.  Note that this ONLY works

# in standalone mode, in inetd mode you should use an inetd server

# that allows you to limit maximum number of processes per service

# (such as xinetd)

MaxInstances 30



# Set the user and group that the server normally runs at.

User proftpd

Group nogroup



# Umask 022 is a good standard umask to prevent new files and dirs

# (second parm) from being group and world writable.

Umask 022  022

# Normally, we want files to be overwriteable.

AllowOverwrite on



# Uncomment this if you are using NIS or LDAP via NSS to retrieve passwords:

# PersistentPasswd off



# This is required to use both PAM-based authentication and local passwords

# AuthOrder mod_auth_pam.c* mod_auth_unix.c



# Be warned: use of this directive impacts CPU average load!

# Uncomment this if you like to see progress and transfer rate with ftpwho

# in downloads. That is not needed for uploads rates.

#

# UseSendFile off



TransferLog /var/log/proftpd/xferlog

SystemLog   /var/log/proftpd/proftpd.log



<IfModule mod_quotatab.c>

QuotaEngine off

</IfModule>



<IfModule mod_ratio.c>

Ratios off

</IfModule>





# Delay engine reduces impact of the so-called Timing Attack described in

# http://security.lss.hr/index.php?page=details&ID=LSS-2004-10-02

# It is on by default.

<IfModule mod_delay.c>

DelayEngine on

</IfModule>



<IfModule mod_ctrls.c>

ControlsEngine        off

ControlsMaxClients    2

ControlsLog           /var/log/proftpd/controls.log

ControlsInterval      5

ControlsSocket        /var/run/proftpd/proftpd.sock

</IfModule>



<IfModule mod_ctrls_admin.c>

AdminControlsEngine off

</IfModule>



#

# Alternative authentication frameworks

#

#Include /etc/proftpd/ldap.conf

#Include /etc/proftpd/sql.conf



#

# This is used for FTPS connections

#

#Include /etc/proftpd/tls.conf



#

# Useful to keep VirtualHost/VirtualRoot directives separated

#

#Include /etc/proftpd/virtuals.con



# A basic anonymous configuration, no upload directories.



# <Anonymous ~ftp>

#   User ftp

#   Group nogroup

#   # We want clients to be able to login with "anonymous" as well as "ftp"

#   UserAlias anonymous ftp

#   # Cosmetic changes, all files belongs to ftp user

#   DirFakeUser on ftp

#   DirFakeGroup on ftp

#

#   RequireValidShell off

#

#   # Limit the maximum number of anonymous logins

#   MaxClients 10

#

#   # We want 'welcome.msg' displayed at login, and '.message' displayed

#   # in each newly chdired directory.

#   DisplayLogin welcome.msg

#   DisplayChdir .message

#

#   # Limit WRITE everywhere in the anonymous chroot

#   <Directory *>

#     <Limit WRITE>

#       DenyAll

#     </Limit>

#   </Directory>

#

#   # Uncomment this if you're brave.

#   # <Directory incoming>

#   #   # Umask 022 is a good standard umask to prevent new files and dirs

#   #   # (second parm) from being group and world writable.

#   #   Umask 022  022

#   #            <Limit READ WRITE>

#   #            DenyAll

#   #            </Limit>

#   #            <Limit STOR>

#   #            AllowAll

#   #            </Limit>

#   # </Directory>

#

# </Anonymous>



<Limit LOGIN>

Order Allow,Deny

Allow from 10.0.2.15/24

Deny from all

</Limit>



<Limit LOGIN>

Order Allow,Deny

AllowUser guest-seas

DenyAll

</Limit>



<Directory "/var/ftp-alumno/">

<Limit MKD STOR RETR>

AllowUser guest-seas #¿Se podria cambiar por AllowAll?

</Limit>

</Directory>

1. No sé exactamente si tengo que crear de alguna manera especial ese host authenticated.seas-linux.es, yo de todas formas he agregado las líneas dentro de las zonas directa e inversa.

2. Podría crear expresamente ese host virtual basado en nombre dentro del proftpd verdad? Se modificaría dentro del mismo proftpd.conf?

3. Las últimas líneas son las que en principio se piden, estarían correctas?

Muchas gracias por vuestro tiempo.

Un saludo para todos.


En línea

el-brujo
ehn
***
Desconectado Desconectado

Mensajes: 21.580


La libertad no se suplica, se conquista


Ver Perfil WWW
Re: Duda con Proftpd en Debian 6
« Respuesta #1 en: 17 Febrero 2015, 19:31 pm »

jaja no sé si tu profesor estará contento que vayas añadiendo tanta cosa de configuración copiada de internet que no pide.


Te recomiendo también la directiva:


Código:
RootLogin off

En teoría el código está bien:

Código:
# Directorio raíz: /var/ftp-<usuario>/
DefaultRoot "/var/ftp-alumno/" guest-seas

#Solo accesible desde la subred del alumno.
<Limit LOGIN>
Order Allow,Deny
Allow from 10.0.2.15/24
Deny from all
</Limit>

#Accesible para el usuario guest-seas con la contraseña del sistema para el usuario del alumno.
<Limit LOGIN>
Order Allow,Deny
AllowUser guest-seas
DenyAll
</Limit>


<Directory "/var/ftp-alumno/">
#Permisos:  - MKD, STOR, RETR.
       <Limit MKD STOR RETR>
        AllowUser guest-seas
       </Limit>
</Directory>


En línea

PeGaSs0

Desconectado Desconectado

Mensajes: 13



Ver Perfil
Re: Duda con Proftpd en Debian 6
« Respuesta #2 en: 18 Febrero 2015, 01:35 am »

Gracias el-brujo por tu respuesta, la verdad es que ese código no funciona como debe, la mayoría de los casos los códigos que estoy intentando crear solo me hacen una cosa bien que es que solo entre el usuario guest-seas, en un momento dado incluso denegar todos los permisos MKD STOR y RETR si le pongo en DenyAll después, cualquier cosa que he intentado me hace todo pero es que también elimina ficheros cuando no debe y ya estoy loco con esto la verdad, se que es cuestión de tener las cosas muy claras y colocar las cosas en su lugar pero ya no se si tirarme por la ventana XD. Por cierto, el código no lo he copiado de ningún lado, simplemente está dentro del fichero de proftpd por defecto y no he eliminado ningún comentario ni nada jeje aunque intentaré mejorarlo si es que termino el trabajo algún día. Os iré informando, ahora mismo lo que medio funciona es este código pero aún así no hace nada de lo que quiero:

Código:
<Limit LOGIN>
Order Allow,Deny
AllowUser guest-seas
DenyAll
</Limit>

<Directory "/var/ftp-alumno/">
<Limit MKD STOR RETR>
#Esto de la subred estaba mal y me di cuenta en su momento
Allow from 10.0.2.0/24
</Limit>
</Directory>


<Limit MKD STOR RETR>
AllowUser guest-seas
</Limit>


AccessGrantMsg "Bienvenido guest-seas, ha accedido correctamente"
AccessDenyMsg "No puede acceder, acceso denegado"

Un saludo y gracias a todos por vuestro tiempo y ayuda.
En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
duda en opera con debian « 1 2 »
GNU/Linux
tecasoft 10 5,086 Último mensaje 8 Junio 2010, 00:24 am
por B€T€B€
Intentando Explotar bug ProFTPD 1.3.1 en maquina virtual Debian.
Bugs y Exploits
Fritos 1 4,633 Último mensaje 14 Marzo 2011, 17:07 pm
por AlbertoBSD
Duda con Debian
GNU/Linux
robebugaty 5 2,418 Último mensaje 16 Enero 2015, 14:45 pm
por robebugaty
proftpd 1.3.5
Hacking
Panic0 4 2,947 Último mensaje 21 Enero 2022, 23:56 pm
por Panic0
Problema con vulnerabilidad de ProFTPD 1.3.3c
Hacking
pocholo 1 2,431 Último mensaje 9 Abril 2023, 17:52 pm
por LlopoRobot
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines