[Guia]Proteger server con ipfw

Topic created · 79 Mensajes · 6974 Visitas
  • @i99daddy said:

    Yo creo que mejor HACKSHIELD.. 😄

    ¬¬ el hackshield es para que no usen hacks en el juego, esto es para que no te hackeen el server, informate mejor.

    con los instant que lo he probado son el original de Rain que no lo recomiendo hacer ahi, yaq ue la version de FreeBSD que tiene no trae un archivo necesario para realizar el proceso, y tambien lo probe en el de computerkrank y ahi i se puede hacer sin ningun problema, y creo que en los demas instant como el Paraguana v1.1 de narcotico tambien se puede y otros mas tambien.

    P.D: he actualizado una cosa en la configuracion del firewall, ya que podian haber problemas al conectar mediante ftp u otros medios.

  • como doi los permisos entro al winscp
    luego le doi ala carpeta usr klik derecho,le doi permisos y a 0777 y se marca todos le doi aceptar cvoi acceder ala carpeta y me dice permission denied

    p

  • debes darle los permisos tambien al archivo GENERIC, con eso ya te permitiria hacer lo que quieras en el.

  • le di permisos a usr y a etc completo y le di a reboot por k no me dejaba y aora no me deja entrar desde el winscp al server
    pero si puedo montarlo y entrar desde el kliente xd

  • eso es porque despues de instalar y configurar lso archivos del ipfw debes configurar las "reglas del firewall" que son las que dicen si permite una conexion desde algun puerto o si la niega, ahi en la guia esta como configurarlo, revisa el segundo texto oculto y lo veras.

  • no e configurado solo di permisos y rebotee y aora no me deja entrar

  • pero te digo que debes hacer la otra parte de la guia qeu ahi se configuran los permisos a los puertos del server.

    Guía para activar firewall de los puertos P2P(no deben realizar esta guía sin haber hecho la anterior)
    Esto es una guía para activar el firewall a los puertos p2p del server, hoy en dia hay ciertas herramientas (no diré ninguna así que no se molesten en preguntar) que se valen de estos puertos para acceder a los servers y hackearlos recuerden que deben tener sumo cuidado porque un error les puede dañar el server, les recomiendo hacer un respaldo de su server antes de intentarlo.

    Comencemos pues
    Prendemos el virtual box o virtual pc, después de loguearnos tecleamos esto :

    #ee /etc/rc.conf
    

    después que entre a la ruta seleccionada bajamos todo hasta el final y agregamos esto:

    firewall_enable="YES"
    firewall_script="/etc/ipfw.rules"
    

    Nota: el firewall_enable="YES" algunos ya lo deben tener agregado si hicieron la guia que dejo narcótico de proteger los puertos, si es así no deben volver a agregar la primera línea pero la segunda (firewall_script="/etc/ipfw.rules") si deben agregarla

    ahora guardan los cambios dando a Esc, luego "a" y otra vez "a", o presionando Ctrl+c y teclean exit.

    ahora creamos el archivo ipfw.rules de la siguiente forma:

    #ee /etc/ipfw.rules
    

    ahi debemos agregar todo esto :

    Donde dice serverip deben poner su ip para que les permita acceder al server, si después cambian de ip y esta esto activado les negara el acceso al server, yo ya lo probé.

    IPF="ipfw -q add" 
    ipfw -q -f flush 
    
    #P2P FiXX 
    $IPF 4 allow all from serverip to any 12001 
    $IPF 5 allow all from 127.0.0.0/8 to any 12001 
    $IPF 6 deny all from any to me 12001 
    $IPF 7 allow all from serverip to any 14000 
    $IPF 8 allow all from 127.0.0.0/8 to any 14000 
    $IPF 9 deny all from any to me 14000 
    $IPF 10 allow all from serverip to any 14001 
    $IPF 11 allow all from 127.0.0.0/8 to any 14001 
    $IPF 12 deny all from any to me 14001 
    $IPF 13 allow all from serverip to any 14002 
    $IPF 14 allow all from 127.0.0.0/8 to any 14002 
    $IPF 15 deny all from any to me 14002 
    $IPF 16 allow all from serverip to any 14003 
    $IPF 17 allow all from 127.0.0.0/8 to any 14003 
    $IPF 18 deny all from any to me 14003 
    $IPF 19 allow all from serverip to any 14004 
    $IPF 20 allow all from 127.0.0.0/8 to any 14004 
    $IPF 21 deny all from any to me 14004 
    $IPF 22 allow all from serverip to any 14061 
    $IPF 23 allow all from 127.0.0.0/8 to any 14061 
    $IPF 24 deny all from any to me 14061 
    $IPF 25 allow all from serverip to any 14099 
    $IPF 26 allow all from 127.0.0.0/8 to any 14099 
    $IPF 27 deny all from any to me 14099 
    $IPF 28 allow all from serverip to any 17000 
    $IPF 29 allow all from 127.0.0.0/8 to any 17000 
    $IPF 30 deny all from any to me 17000 
    $IPF 31 allow all from serverip to any 17001 
    $IPF 32 allow all from 127.0.0.0/8 to any 17001 
    $IPF 33 deny all from any to me 17001 
    $IPF 34 allow all from serverip to any 17002 
    $IPF 35 allow all from 127.0.0.0/8 to any 17002 
    $IPF 36 deny all from any to me 17002 
    $IPF 37 allow all from serverip to any 17003 
    $IPF 38 allow all from 127.0.0.0/8 to any 17003 
    $IPF 39 deny all from any to me 17003 
    $IPF 40 allow all from serverip to any 17004 
    $IPF 41 allow all from 127.0.0.0/8 to any 17004 
    $IPF 42 deny all from any to me 17004 
    $IPF 43 allow all from serverip to any 17061 
    $IPF 44 allow all from 127.0.0.0/8 to any 17061 
    $IPF 45 deny all from any to me 17061 
    $IPF 46 allow all from serverip to any 17099 
    $IPF 47 allow all from 127.0.0.0/8 to any 17099 
    $IPF 48 deny all from any to me 17099 
    $IPF 49 allow all from serverip to any 19000 
    $IPF 50 allow all from 127.0.0.0/8 to any 19000 
    $IPF 51 deny all from any to me 19000 
    $IPF 52 allow all from serverip to any 19001 
    $IPF 53 allow all from 127.0.0.0/8 to any 19001 
    $IPF 54 deny all from any to me 19001 
    $IPF 55 allow all from serverip to any 19002 
    $IPF 56 allow all from 127.0.0.0/8 to any 19002 
    $IPF 57 deny all from any to me 19002 
    $IPF 58 allow all from serverip to any 19003 
    $IPF 59 allow all from 127.0.0.0/8 to any 19003 
    $IPF 60 deny all from any to me 19003 
    $IPF 61 allow all from serverip to any 19004 
    $IPF 62 allow all from 127.0.0.0/8 to any 19004 
    $IPF 63 deny all from any to me 19004 
    $IPF 64 allow all from serverip to any 19061 
    $IPF 65 allow all from 127.0.0.0/8 to any 19061 
    $IPF 66 deny all from any to me 19061 
    $IPF 67 allow all from serverip to any 19099 
    $IPF 68 allow all from 127.0.0.0/8 to any 19099 
    $IPF 69 deny all from any to me 19099 
    $IPF 70 allow all from serverip to any 21000 
    $IPF 71 allow all from 127.0.0.0/8 to any 21000 
    $IPF 72 deny all from any to me 21000 
    $IPF 73 allow all from serverip to any 21001 
    $IPF 74 allow all from 127.0.0.0/8 to any 21001 
    $IPF 75 deny all from any to me 21001 
    $IPF 76 allow all from serverip to any 21002 
    $IPF 77 allow all from 127.0.0.0/8 to any 21002 
    $IPF 78 deny all from any to me 21002 
    $IPF 79 allow all from serverip to any 21003 
    $IPF 80 allow all from 127.0.0.0/8 to any 21003 
    $IPF 81 deny all from any to me 21003 
    $IPF 82 allow all from serverip to any 21004 
    $IPF 83 allow all from 127.0.0.0/8 to any 21004 
    $IPF 84 deny all from any to me 21004 
    $IPF 85 allow all from serverip to any 21061 
    $IPF 86 allow all from 127.0.0.0/8 to any 21061 
    $IPF 87 deny all from any to me 21061 
    $IPF 88 allow all from serverip to any 21099 
    $IPF 89 allow all from 127.0.0.0/8 to any 21099 
    $IPF 90 deny all from any to me 21099 
    
    # open port ftp (20,21), ssh (22), mail (25)
    # http (80), dns (53) etc
    #$IPF 100 pass log tcp from any 20 to any 1024-65535 setup
    $IPF 100 allow log tcp from any to any 20 in
    $IPF 105 allow log tcp from any to any 20 out
    $IPF 110 allow log tcp from any to any 21 in
    $IPF 120 allow log tcp from any to any 21 out
    $IPF 130 allow tcp from any to any 22 in
    $IPF 140 allow tcp from any to any 22 out
    $IPF 150 allow tcp from any to any 25 in
    $IPF 160 allow tcp from any to any 25 out
    $IPF 170 allow udp from any to any 53 in
    $IPF 175 allow tcp from any to any 53 in
    $IPF 180 allow udp from any to any 53 out
    $IPF 185 allow tcp from any to any 53 out
    $IPF 190 allow tcp from any to any 80 in
    $IPF 192 allow tcp from any to any 8010 in
    $IPF 193 allow tcp from any to any 8010 out
    $IPF 195 allow tcp from any to any 80 out
    
    #Standart Regeln 
    
    $IPF 10000 allow all from any to any via lo0 
    $IPF 20000 deny all from any to 127.0.0.0/8 
    $IPF 30000 deny all from 127.0.0.0/8 to any 
    $IPF 40000 allow all from any to any
    

    Nota: esta parte la he actualizado, ya qeu como estaba antes podia dar problemas al conectar via ftp(filezilla o winscp)

    después de escribir todo eso guardan y hacen reboot, y listo sus puertos P2P ya estarán protegidos.

    Nota: hay personas que tal vez hayan cambiado sus puertos P2P, esas personas deben tener mucho cuidado al hacer esta guía, porque tal como está sirve solo para los puertos que trae por defecto la mayoría de los instant, así que si han cambiado esos puertos también deben cambiar los puertos que protegen con la guía

  • @Aquiles94 said:

    pero te digo que debes hacer la otra parte de la guia qeu ahi se configuran los permisos a los puertos del server.

    Guía para activar firewall de los puertos P2P(no deben realizar esta guía sin haber hecho la anterior)
    Esto es una guía para activar el firewall a los puertos p2p del server, hoy en dia hay ciertas herramientas (no diré ninguna así que no se molesten en preguntar) que se valen de estos puertos para acceder a los servers y hackearlos recuerden que deben tener sumo cuidado porque un error les puede dañar el server, les recomiendo hacer un respaldo de su server antes de intentarlo.

    Comencemos pues
    Prendemos el virtual box o virtual pc, después de loguearnos tecleamos esto :

    #ee /etc/rc.conf
    

    después que entre a la ruta seleccionada bajamos todo hasta el final y agregamos esto:

    firewall_enable="YES"
    firewall_script="/etc/ipfw.rules"
    

    Nota: el firewall_enable="YES" algunos ya lo deben tener agregado si hicieron la guia que dejo narcótico de proteger los puertos, si es así no deben volver a agregar la primera línea pero la segunda (firewall_script="/etc/ipfw.rules") si deben agregarla

    ahora guardan los cambios dando a Esc, luego "a" y otra vez "a", o presionando Ctrl+c y teclean exit.

    ahora creamos el archivo ipfw.rules de la siguiente forma:

    #ee /etc/ipfw.rules
    

    ahi debemos agregar todo esto :

    Donde dice serverip deben poner su ip para que les permita acceder al server, si después cambian de ip y esta esto activado les negara el acceso al server, yo ya lo probé.

    IPF="ipfw -q add" 
    ipfw -q -f flush 
    
    #P2P FiXX 
    $IPF 4 allow all from serverip to any 12001 
    $IPF 5 allow all from 127.0.0.0/8 to any 12001 
    $IPF 6 deny all from any to me 12001 
    $IPF 7 allow all from serverip to any 14000 
    $IPF 8 allow all from 127.0.0.0/8 to any 14000 
    $IPF 9 deny all from any to me 14000 
    $IPF 10 allow all from serverip to any 14001 
    $IPF 11 allow all from 127.0.0.0/8 to any 14001 
    $IPF 12 deny all from any to me 14001 
    $IPF 13 allow all from serverip to any 14002 
    $IPF 14 allow all from 127.0.0.0/8 to any 14002 
    $IPF 15 deny all from any to me 14002 
    $IPF 16 allow all from serverip to any 14003 
    $IPF 17 allow all from 127.0.0.0/8 to any 14003 
    $IPF 18 deny all from any to me 14003 
    $IPF 19 allow all from serverip to any 14004 
    $IPF 20 allow all from 127.0.0.0/8 to any 14004 
    $IPF 21 deny all from any to me 14004 
    $IPF 22 allow all from serverip to any 14061 
    $IPF 23 allow all from 127.0.0.0/8 to any 14061 
    $IPF 24 deny all from any to me 14061 
    $IPF 25 allow all from serverip to any 14099 
    $IPF 26 allow all from 127.0.0.0/8 to any 14099 
    $IPF 27 deny all from any to me 14099 
    $IPF 28 allow all from serverip to any 17000 
    $IPF 29 allow all from 127.0.0.0/8 to any 17000 
    $IPF 30 deny all from any to me 17000 
    $IPF 31 allow all from serverip to any 17001 
    $IPF 32 allow all from 127.0.0.0/8 to any 17001 
    $IPF 33 deny all from any to me 17001 
    $IPF 34 allow all from serverip to any 17002 
    $IPF 35 allow all from 127.0.0.0/8 to any 17002 
    $IPF 36 deny all from any to me 17002 
    $IPF 37 allow all from serverip to any 17003 
    $IPF 38 allow all from 127.0.0.0/8 to any 17003 
    $IPF 39 deny all from any to me 17003 
    $IPF 40 allow all from serverip to any 17004 
    $IPF 41 allow all from 127.0.0.0/8 to any 17004 
    $IPF 42 deny all from any to me 17004 
    $IPF 43 allow all from serverip to any 17061 
    $IPF 44 allow all from 127.0.0.0/8 to any 17061 
    $IPF 45 deny all from any to me 17061 
    $IPF 46 allow all from serverip to any 17099 
    $IPF 47 allow all from 127.0.0.0/8 to any 17099 
    $IPF 48 deny all from any to me 17099 
    $IPF 49 allow all from serverip to any 19000 
    $IPF 50 allow all from 127.0.0.0/8 to any 19000 
    $IPF 51 deny all from any to me 19000 
    $IPF 52 allow all from serverip to any 19001 
    $IPF 53 allow all from 127.0.0.0/8 to any 19001 
    $IPF 54 deny all from any to me 19001 
    $IPF 55 allow all from serverip to any 19002 
    $IPF 56 allow all from 127.0.0.0/8 to any 19002 
    $IPF 57 deny all from any to me 19002 
    $IPF 58 allow all from serverip to any 19003 
    $IPF 59 allow all from 127.0.0.0/8 to any 19003 
    $IPF 60 deny all from any to me 19003 
    $IPF 61 allow all from serverip to any 19004 
    $IPF 62 allow all from 127.0.0.0/8 to any 19004 
    $IPF 63 deny all from any to me 19004 
    $IPF 64 allow all from serverip to any 19061 
    $IPF 65 allow all from 127.0.0.0/8 to any 19061 
    $IPF 66 deny all from any to me 19061 
    $IPF 67 allow all from serverip to any 19099 
    $IPF 68 allow all from 127.0.0.0/8 to any 19099 
    $IPF 69 deny all from any to me 19099 
    $IPF 70 allow all from serverip to any 21000 
    $IPF 71 allow all from 127.0.0.0/8 to any 21000 
    $IPF 72 deny all from any to me 21000 
    $IPF 73 allow all from serverip to any 21001 
    $IPF 74 allow all from 127.0.0.0/8 to any 21001 
    $IPF 75 deny all from any to me 21001 
    $IPF 76 allow all from serverip to any 21002 
    $IPF 77 allow all from 127.0.0.0/8 to any 21002 
    $IPF 78 deny all from any to me 21002 
    $IPF 79 allow all from serverip to any 21003 
    $IPF 80 allow all from 127.0.0.0/8 to any 21003 
    $IPF 81 deny all from any to me 21003 
    $IPF 82 allow all from serverip to any 21004 
    $IPF 83 allow all from 127.0.0.0/8 to any 21004 
    $IPF 84 deny all from any to me 21004 
    $IPF 85 allow all from serverip to any 21061 
    $IPF 86 allow all from 127.0.0.0/8 to any 21061 
    $IPF 87 deny all from any to me 21061 
    $IPF 88 allow all from serverip to any 21099 
    $IPF 89 allow all from 127.0.0.0/8 to any 21099 
    $IPF 90 deny all from any to me 21099 
    
    # open port ftp (20,21), ssh (22), mail (25)
    # http (80), dns (53) etc
    #$IPF 100 pass log tcp from any 20 to any 1024-65535 setup
    $IPF 100 allow log tcp from any to any 20 in
    $IPF 105 allow log tcp from any to any 20 out
    $IPF 110 allow log tcp from any to any 21 in
    $IPF 120 allow log tcp from any to any 21 out
    $IPF 130 allow tcp from any to any 22 in
    $IPF 140 allow tcp from any to any 22 out
    $IPF 150 allow tcp from any to any 25 in
    $IPF 160 allow tcp from any to any 25 out
    $IPF 170 allow udp from any to any 53 in
    $IPF 175 allow tcp from any to any 53 in
    $IPF 180 allow udp from any to any 53 out
    $IPF 185 allow tcp from any to any 53 out
    $IPF 190 allow tcp from any to any 80 in
    $IPF 192 allow tcp from any to any 8010 in
    $IPF 193 allow tcp from any to any 8010 out
    $IPF 195 allow tcp from any to any 80 out
    
    #Standart Regeln 
    
    $IPF 10000 allow all from any to any via lo0 
    $IPF 20000 deny all from any to 127.0.0.0/8 
    $IPF 30000 deny all from 127.0.0.0/8 to any 
    $IPF 40000 allow all from any to any
    

    Nota: esta parte la he actualizado, ya qeu como estaba antes podia dar problemas al conectar via ftp(filezilla o winscp)

    después de escribir todo eso guardan y hacen reboot, y listo sus puertos P2P ya estarán protegidos.

    Nota: hay personas que tal vez hayan cambiado sus puertos P2P, esas personas deben tener mucho cuidado al hacer esta guía, porque tal como está sirve solo para los puertos que trae por defecto la mayoría de los instant, así que si han cambiado esos puertos también deben cambiar los puertos que protegen con la guía

    perdona mi ignorancia pero pone k no lo aga si no exo el primer paso y ese no lo exo solo di permiso 777 para poder acer el primer paso,y no puedo entrar al winscp

  • a disculpa no te entendia XD, termina los pasos qeu et faltan en el freebsd y despues haces lo otro y ay podras acceder por el winscp.

  • cuando pongo el comando en el server
    cd /usr/src
    que sale al apretar enter?la siguiente linea mcncc.com# para seguir escriviendo sin ninguna cosa mas?