Menú

Mostrar Mensajes

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.

Mostrar Mensajes Menú

Mensajes - crimi

#1
Seguridad / ¿QUIÉN DA CON EL PROBLEMA?
14 Diciembre 2012, 19:26 PM
Hola a tod@s:

Viendo los siguientes 2 fragmentos de código, ¿quién es capaz de identificar los posibles problemas o debilidades de seguridad y, si es posible, ofrecer una solución?:

1.

[...]
char *tmp_name;
int tmpfd;
tmp_name = "/tmp/tmpfile.XXXXX";
if( (tmpfd = open(tmp_name, O_RDWR | O_CREAT)) < 0) lnegra
exit(-1);
[...]
unlink(tmp_name);
/*
** remove the filename so that the file is not left on the
** file system when the program code completes or when
** the file descriptor is closed.
*/
[...]

2,
[...]
String comment = request.getParameter("comment");
//Validate input for quotes and SQL especific chars
[...]
// End of SQL validation and begin XSS validation
comment.replaceAll("<script>","");
comment.replaceAll("</script>","");
// Other cleanup operations
[...]
#2
Bugs y Exploits / DISEÑO DE EXPLOIT
12 Diciembre 2012, 00:39 AM
Hola:

¿Alguien me podría ayudar con el siguiente ejercicio?

1.Dado el siguiente código fuente, diseñar un exploit que permita la función "privada":

#include <string.h>
void privada (void) {
printf("Hola función pública\n");
}
int main(int argc, char * argv [])
{
char buffer [40];
if (argc != 2){
printf("Necesito un argumento %d\n",argc);
exit(-1);
}
strcpy(buffer, argv[1]);
printf("%s\n",buffer);
return (0);
}