mmb 0 Denunciar post Postado Agosto 14, 2009 Galera, estou tendo alguns problemas de ataque ao meu servidor. Pelo que notei o cara envia muita requisições o apache meio que trava, quando você tenta acessar mostra uma página totalmente em branco. Gostaria de saber como limitarr o nº de requisições por ip. Eu ja procurei pelo mod limitipcon mas não conseguir instalar =/ Utilizo: XAMPP 1.7.1 Windows Server 2003 x64 Valeu! Compartilhar este post Link para o post Compartilhar em outros sites
mmb 0 Denunciar post Postado Agosto 14, 2009 Derrepente se alguém puder me ajudar a instalar o limitipcon meu problema se resolve... Compartilhar este post Link para o post Compartilhar em outros sites
Diego Macêdo 6 Denunciar post Postado Agosto 14, 2009 1- Se o problema é com Apache e você utiliza Windows Server, por que está postando na categoria PHP? 2- Por experiência própria, instale um firewall de qualidade. Se seu server fosse linux eu até poderia te ajudar quanto a isso. Espero ter ajudado! http://forum.imasters.com.br/public/style_emoticons/default/thumbsup.gif Compartilhar este post Link para o post Compartilhar em outros sites
mmb 0 Denunciar post Postado Agosto 14, 2009 1. Pois não encontrei nenhuma outra área especifica 2. Qual firewall? Ja tentei o Comodo mas ele trava a máquina, lembrando que é um servidor dedicado e ele não pode interromper minha conexão via area de trabalho remota Compartilhar este post Link para o post Compartilhar em outros sites
Diego Macêdo 6 Denunciar post Postado Agosto 14, 2009 Aqui no fórum, a sua área específica seria a de "Microsoft Windows" Eu não posso te ajudar, exatamente por eu ter experiência apenas em servidores web linux. Mas posta o seu problema na categoria correta que o pessoal lá com certeza vai te ajudar. Compartilhar este post Link para o post Compartilhar em outros sites
mmb 0 Denunciar post Postado Agosto 14, 2009 É que meu problema necessariamente é com o Apache, o php está mais relacionado com apache do que com windows não acha? :s Compartilhar este post Link para o post Compartilhar em outros sites
Diego Macêdo 6 Denunciar post Postado Agosto 14, 2009 PHP faz parte do Apache. Seria tipo um "módulo" do Apache. Aqui o fórum é mais voltado para a programação. Compartilhar este post Link para o post Compartilhar em outros sites
mmb 0 Denunciar post Postado Agosto 15, 2009 Consegui instalar o limitipconn mas não adiantou, o erro no error.log é: [Fri Aug 14 23:37:54 2009] [warn] Server ran out of threads to serve requests. Consider raising the ThreadsPerChild setting Como que posso resolver isto? Compartilhar este post Link para o post Compartilhar em outros sites
Diego Macêdo 6 Denunciar post Postado Agosto 15, 2009 Ele ta pedindo pra você aumentar o valor da opção "ThreadsPerChild". Verifica nas opções do software. http://forum.imasters.com.br/public/style_emoticons/default/thumbsup.gif Estive olhando o site do Apache e vi uns módulos que talvez possam te ajudar com esse problema. - Apache DoS Evasive Maneuvers Module - Apache Intrusion Detection Module - Connection Limitation - mod_brutelog & mod_bruteban - mod_fortress: Apache Application IDS & Firewall - mod_hackprotect - mod_ip_count - mod_spamhaus Uns podem te ajudar diretamente e outros indiretamente. Cabe a você ver o que cada um deles faz e instalar ou não. P.S.: Não me responsabilizo! ;) De qualquer forma, boa sorte na solução do problema! http://forum.imasters.com.br/public/style_emoticons/default/joia.gif Compartilhar este post Link para o post Compartilhar em outros sites
mmb 0 Denunciar post Postado Agosto 15, 2009 Atualizei o xampp para a versão 1.7.2 e não consegui achar a diretiva ThreadsPerChild que antes ficava no httpd.conf. Estava verificando o /server-status e pelo que notei é o envio de algumas requisições nula, pois não é possivel identificar o ip. Estarei verificando e testando cada mod. Se alguém puder me ajudar de qualquer outra forma ficarei grato. Qualquer novidade retorno aqui. Compartilhar este post Link para o post Compartilhar em outros sites
hinom 5 Denunciar post Postado Agosto 15, 2009 mmb, instale o módulo "mod evasive" resolverá boa parte desses problemas quanto a esses IPs com requisições fora do normal, leve-os a uma delegacia de crimes digitais e denuncie-os. ao fazer isso você estará ajudando milhares de outros usuários a se livrarem desses "trastes" relate o caso ao seu provedor de hospedagem, pois no mínimo o provedor de hospedagem deve impedir o retorno multiplo de pings e ter firewalls de boa qualidade. Compartilhar este post Link para o post Compartilhar em outros sites
mmb 0 Denunciar post Postado Agosto 15, 2009 O problema é que no server-status não aparece o ip, como deveria aparecer em requisições normal. Pelo que entendi ele apenas "conecta" e sai esperando pelo Timeout, já diminui o tempo mas atrapalha na navegação e o problema ainda continua. Vou tentar achar alguma ferramenta para mostrar todos os ips que se conecto na dedicada, se alguem tiver um dica também aceito. Vou instalar os mods e volto para informar o que aconteceu. EDIT: Se alguém tiver alguma dica de algum software que detecte e registre todos os ip's que acessaram o servidor agradeço. Compartilhar este post Link para o post Compartilhar em outros sites
hinom 5 Denunciar post Postado Agosto 15, 2009 você deve consultar o seu provedor de hopspedagem se nao fornecerem isso, troque para um provedor seguro não recomendo alterar os threads do mpm, pois afetará os acessos legítimos, como você mesmo pôde comprovar. ative o log de acessos do apache e também o log de erros em todos os niveis temporariamente apenas para analisar oq ue está acontecendo de fato. Compartilhar este post Link para o post Compartilhar em outros sites
mmb 0 Denunciar post Postado Agosto 15, 2009 Sem querer abusar da boa vontade de vocês, teria como postar o mod_evasive no formato .so ou .dll? Ja tentei fazer pelo apxs e dá erro, achei uma DLL mas não permitiu o apache abrir. Existe alguma outra forma de compilar sem ser com o APXS? Compartilhar este post Link para o post Compartilhar em outros sites
hinom 5 Denunciar post Postado Agosto 15, 2009 Apache Mod Evasive http://www.zdziarski.com/projects/mod_evasive/ versão compilada para Windows http://rapidshare.com/files/111108411/dosevasive.zip.html httpd.conf <IfModule mod_evasive20.c> DOSHashTableSize 3097 DOSPageCount 2 DOSSiteCount 50 DOSPageInterval 1 DOSSiteInterval 1 DOSBlockingPeriod 10 </IfModule> links interessante: http://www.apachelounge.com/viewtopic.php?p=4356#4356 base de pesquisa: http://www.bing.com/search?q=apache+mod_evasive+windows&form=QBRE&scope=web&qs=n Compartilhar este post Link para o post Compartilhar em outros sites
mmb 0 Denunciar post Postado Agosto 15, 2009 Vlw hinom! Ontem eu já tinha achado essa DLL mas tava com sono e não consegui instalar, hoje consegui e ta funcionando, mas aparentemente não resolveu o problema, usei as configurações padrões e nada. Teve uma hora que no error.log apareceu isso: [sat Aug 15 13:40:34 2009] [info] Parent: Duplicating socket 304 and sending it to child process 132 [sat Aug 15 13:40:34 2009] [notice] Child 132: Acquired the start mutex. [sat Aug 15 13:40:34 2009] [notice] Child 132: Starting 250 worker threads. [sat Aug 15 13:40:34 2009] [notice] Child 132: Starting thread to listen on port 80. [sat Aug 15 13:43:34 2009] [warn] Server ran out of threads to serve requests. Consider raising the ThreadsPerChild setting [sat Aug 15 14:01:09 2009] [warn] (OS 64)The specified network name is no longer available. : winnt_accept: Asynchronous AcceptEx failed. [sat Aug 15 14:03:45 2009] [error] [client 189.79.131.220] client denied by server configuration: C:/xampp/htdocs/ (Possible DOS Attack) Você pode verificar o site: http://www.ph3tz.com/ Não sei o que fazer, você recomenda mudar de xampp para istalação manual do apache ou derrepente usar o ISS? Será que os problemas irão se resolver fazendo esta mudança? Compartilhar este post Link para o post Compartilhar em outros sites
hinom 5 Denunciar post Postado Agosto 16, 2009 1. qual o ambiente ? sistema operacional, versao do ph, apache, mysql, e outros serviços relacionados e também os serviços nao relacionados que estejam ativos no sevidor ? 2. o servidor pertence a uma empresa de hospedagem terceira ou é seu próprio servidor ? 3. abra uma queixa numa delegacia de crimes digitais 4. xaamp é recomendável para iniciantes e usuários php com conhecimentos muito avançados e abrangentes. recomendo, a desativá-lo e fazer as configurações manualmente. Existem alguns detalhes importantes na configuração qeu podem afetar o desempenho. 5. como está configurado o httpd.conf ? fez alteração manual ? poderia postar como estão as configs do MPM ? Compartilhar este post Link para o post Compartilhar em outros sites
mmb 0 Denunciar post Postado Agosto 16, 2009 hinom, consegui o programa que eles usam para derrubar o apache, posso lhe passar por pm? 1. Win Server Standard 2003 R2 SP2 x64, XAMPP 1.7.2(Apache 2.2.12 (IPv6 enabled) + OpenSSL 0.9.8k, MySQL 5.1.37 + PBXT engine, PHP 5.3.0, phpMyAdmin 3.2.0.1, Webalizer 2.21-02 + GeoIP lite, FileZilla FTP Server 0.9.32, msmtp 1.4.17) em negrito é o que eu utilizo. 2. O servidor fica hospedado nos EUA, mais especificadamente na LimeStone, é feito por um revendedor brasileiro 3. Com o mod_evasive instalado consegui apenas 1 vez o ip dos caras, ameacei eles e consegui o programa que eles utilizam 5. O httpd está quase como padrão com alguns modules desativados(como o autoindex) e outros adicionados(limitipcon e evasive) Segue o MPM # # Server-Pool Management (MPM specific) # # # PidFile: The file in which the server should record its process # identification number when it starts. # # Note that this is the default PidFile for most MPMs. # <IfModule !mpm_netware_module> PidFile "logs/httpd.pid" </IfModule> # # The accept serialization lock file MUST BE STORED ON A LOCAL DISK. # <IfModule !mpm_winnt_module> <IfModule !mpm_netware_module> LockFile "logs/accept.lock" </IfModule> </IfModule> # # Only one of the below sections will be relevant on your # installed httpd. Use "apachectl -l" to find out the # active mpm. # # prefork MPM # StartServers: number of server processes to start # MinSpareServers: minimum number of server processes which are kept spare # MaxSpareServers: maximum number of server processes which are kept spare # MaxClients: maximum number of server processes allowed to start # MaxRequestsPerChild: maximum number of requests a server process serves <IfModule mpm_prefork_module> StartServers 5 MinSpareServers 5 MaxSpareServers 10 MaxClients 150 MaxRequestsPerChild 0 </IfModule> # worker MPM # StartServers: initial number of server processes to start # MaxClients: maximum number of simultaneous client connections # MinSpareThreads: minimum number of worker threads which are kept spare # MaxSpareThreads: maximum number of worker threads which are kept spare # ThreadsPerChild: constant number of worker threads in each server process # MaxRequestsPerChild: maximum number of requests a server process serves <IfModule mpm_worker_module> StartServers 2 MaxClients 150 MinSpareThreads 25 MaxSpareThreads 75 ThreadsPerChild 25 MaxRequestsPerChild 0 </IfModule> # BeOS MPM # StartThreads: how many threads do we initially spawn? # MaxClients: max number of threads we can have (1 thread == 1 client) # MaxRequestsPerThread: maximum number of requests each thread will process <IfModule mpm_beos_module> StartThreads 10 MaxClients 50 MaxRequestsPerThread 10000 </IfModule> # NetWare MPM # ThreadStackSize: Stack size allocated for each worker thread # StartThreads: Number of worker threads launched at server startup # MinSpareThreads: Minimum number of idle threads, to handle request spikes # MaxSpareThreads: Maximum number of idle threads # MaxThreads: Maximum number of worker threads alive at the same time # MaxRequestsPerChild: Maximum number of requests a thread serves. It is # recommended that the default value of 0 be set for this # directive on NetWare. This will allow the thread to # continue to service requests indefinitely. <IfModule mpm_netware_module> ThreadStackSize 65536 StartThreads 250 MinSpareThreads 25 MaxSpareThreads 250 MaxThreads 1000 MaxRequestsPerChild 0 MaxMemFree 100 </IfModule> # OS/2 MPM # StartServers: Number of server processes to maintain # MinSpareThreads: Minimum number of idle threads per process, # to handle request spikes # MaxSpareThreads: Maximum number of idle threads per process # MaxRequestsPerChild: Maximum number of connections per server process <IfModule mpm_mpmt_os2_module> StartServers 2 MinSpareThreads 5 MaxSpareThreads 10 MaxRequestsPerChild 0 </IfModule> # WinNT MPM # ThreadsPerChild: constant number of worker threads in the server process # MaxRequestsPerChild: maximum number of requests a server process serves # Win32DisableAcceptEx: Use accept() rather than AcceptEx() to accept network connections <IfModule mpm_winnt_module> ThreadsPerChild 350 MaxRequestsPerChild 0 #Win32DisableAcceptEx </IfModule> Valeu pelo apoio, os cara pararo de atacar quando eu consegui o ip deles, mas de qualquer forma o servidor ainda está exposto, preciso de um firewall você tem algum para me indicar? Compartilhar este post Link para o post Compartilhar em outros sites
hinom 5 Denunciar post Postado Agosto 16, 2009 sugiro consultar o administrador do host. eles deveriam oferecer no minimo uma firewall para bloquear DoS. quanto ao MPM, você alterou a configuração original não é mesmo ? no trehco final <IfModule mpm_winnt_module> ThreadsPerChild 350 MaxRequestsPerChild 0 #Win32DisableAcceptEx </IfModule> retorne para o original 150 <IfModule mpm_winnt_module> ThreadsPerChild 150 MaxRequestsPerChild 0 </IfModule> perguntas: 1. qual a média de acessos ao site ? não conte o page views, conte a quantidade de acessos, independentemente de serem de mesmo ip 2. como está a configuração do my.ini, do mysql ? Compartilhar este post Link para o post Compartilhar em outros sites
mmb 0 Denunciar post Postado Agosto 16, 2009 Retornando para 150. 1. Segundo o google analytics 5.009 Visitas. 2. O my.ini está como original, possuo uma DB até que grande, a maioria das tabelas é InnoDB # Example MySQL config file for medium systems. # # This is for a system with little memory (32M - 64M) where MySQL plays # an important part, or systems up to 128M where MySQL is used together with # other programs (such as a web server) # # You can copy this file to # /etc/my.cnf to set global options, # mysql-data-dir/my.cnf to set server-specific options (in this # installation this directory is @localstatedir@) or # ~/.my.cnf to set user-specific options. # # In this file, you can use all long options that a program supports. # If you want to know which options a program supports, run the program # with the "--help" option. # The following options will be passed to all MySQL clients [client] #user = your_username #password = your_password host = . port = 3306 socket = "MySQL" # Here follows entries for some specific programs # The MySQL server [mysqld] basedir = "C:/xampp/mysql/" datadir = "C:/xampp/mysql/data/" port = 3306 socket = "MySQL" skip-locking key_buffer = 16M max_allowed_packet = 1M table_cache = 64 sort_buffer_size = 512K net_buffer_length = 8K read_buffer_size = 256K read_rnd_buffer_size = 512K myisam_sort_buffer_size = 8M default-time-zone = "America/Sao_Paulo" log_error = "C:/xampp/mysql/data/mysql.err" pid_file = "mysql.pid" general_log = 0 general_log_file = "C:/xampp/mysql/data/mysql.log" slow_query_log = 0 slow_query_log_file = "C:/xampp/mysql/data/mysql-slow.log" # Don't listen on a TCP/IP port at all. This can be a security enhancement, # if all processes that need to connect to mysqld run on the same host. # All interaction with mysqld must be made via Unix sockets or named pipes. # Note that using this option without enabling named pipes on Windows # (via the "enable-named-pipe" option) will render mysqld useless! # #skip-networking enable-named-pipe # Disable Federated by default skip-federated # Replication Master Server (default) # binary logging is required for replication #log-bin = mysql-bin # binary logging format - mixed recommended #binlog_format = mixed # required unique id between 1 and 2^32 - 1 # defaults to 1 if master-host is not set # but will not function as a master if omitted server-id = 1 # Replication Slave (comment out master section to use this) # # To configure this host as a replication slave, you can choose between # two methods : # # 1) Use the CHANGE MASTER TO command (fully described in our manual) - # the syntax is: # # CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>, # MASTER_USER=<user>, MASTER_PASSWORD=<password> ; # # where you replace <host>, <user>, <password> by quoted strings and # <port> by the master's port number (3306 by default). # # Example: # # CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306, # MASTER_USER='joe', MASTER_PASSWORD='secret'; # # OR # # 2) Set the variables below. However, in case you choose this method, then # start replication for the first time (even unsuccessfully, for example # if you mistyped the password in master-password and the slave fails to # connect), the slave will create a master.info file, and any later # change in this file to the variables' values below will be ignored and # overridden by the content of the master.info file, unless you shutdown # the slave server, delete master.info and restart the slaver server. # For that reason, you may want to leave the lines below untouched # (commented) and instead use CHANGE MASTER TO (see above) # # required unique id between 2 and 2^32 - 1 # (and different from the master) # defaults to 2 if master-host is set # but will not function as a slave if omitted #server-id = 2 # # The replication master for this slave - required #master-host = <hostname> # # The username the slave will use for authentication when connecting # to the master - required #master-user = <username> # # The password the slave will authenticate with when connecting to # the master - required #master-password = <password> # # The port the master is listening on. # optional - defaults to 3306 #master-port = <port> # # binary logging - not required for slaves, but recommended #log-bin = mysql-bin # Point the following paths to different dedicated disks tmpdir = "C:/xampp/tmp/" #log-update = "C:/xampp/tmp/mysql" # Uncomment the following if you are using InnoDB tables #skip-innodb innodb_data_home_dir = "C:/xampp/mysql/data/" innodb_data_file_path = ibdata1:10M:autoextend innodb_log_group_home_dir = "C:/xampp/mysql/data/" # You can set .._buffer_pool_size up to 50 - 80 % # of RAM but beware of setting memory usage too high innodb_buffer_pool_size = 16M innodb_additional_mem_pool_size = 2M # Set .._log_file_size to 25 % of buffer pool size innodb_log_file_size = 5M innodb_log_buffer_size = 8M innodb_flush_log_at_trx_commit = 1 innodb_lock_wait_timeout = 50 [mysqldump] quick max_allowed_packet = 16M [mysql] no-auto-rehash # Remove the next comment character if you are not familiar with SQL #safe-updates [isamchk] key_buffer = 20M sort_buffer_size = 20M read_buffer = 2M write_buffer = 2M [myisamchk] key_buffer = 20M sort_buffer_size = 20M read_buffer = 2M write_buffer = 2M [mysqlhotcopy] interactive-timeout Compartilhar este post Link para o post Compartilhar em outros sites