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

 

 


Tema destacado: Los 10 CVE más críticos (peligrosos) de 2020


  Mostrar Temas
Páginas: [1]
1  Comunicaciones / Redes / Problema con firewall en: 12 Enero 2016, 15:05 pm
Hola a todos

    mi problema es el siguiente tengo instalado como firewall smootwall el cual funcionaba bien, pero ahora tengo problemas ya que me da acceso a internet pero no me deja ver paginas como entel.cl, paginas de bancos, entre otras a que se debe..   (las paginas mencionadas no las tengo bloqueadas)

  Saludos y gracias por su tiempo
2  Comunicaciones / Redes / Abrir puertos por medio de dos router. en: 14 Octubre 2015, 19:44 pm
Hola  :D

 Bueno mi consulta es la siguiente, tengo un router arris con ip 192.168.1.1 el cual reparte con direccioes DHCP( 1.2 hasta la 1.98) all cual le llega internet y un router linksys con ip 192.168.0.1 el cual reparte con direccioes DHCP( 0.2 hasta la 0.99) , mi duda es la siguiente

como puedo abrir el puerto 3389 en los dos router?, afecta el  que tengan diferentes ip?

lo intente, asigandole la ip del linksys, en la dmz del modem arris para tener acceso a los puertos, y posterior abriendo el puerto en el router linksys, pero me fallo  :xD


ojala se entienda..

Saludos
3  Programación / Programación C/C++ / quien me ayuda con este codigo en: 8 Mayo 2010, 01:09 am
#include <windows.h>
#include <string>
#include<stdio.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include<iostream>
#include<fstream>
using namespace std;
int copy();
int creardirecotio();
int crear( char *archivo, char *contenido );

   int main(void){
      int opc;
      char archivo[32], contenido[10];
      string name;
      string rent;
       ifstream infile;
       unsigned long bytesescritos;
        DWORD dwBytesRead = 0;
        char cNextChar;
      
   do{
   printf("**Menu**\n");
   printf("\n1-crear directorio");
   printf("\n2-crear fichero ");
   printf("\n3-mostrar contenido");
   printf("\n4-copiar fichero");
   printf("\n5-borrar directorio");
   printf("\ningrese opcion :");
   scanf("%i",&opc);
   }while(opc<1 || opc>5);
   
   switch(opc){
   
   case 1:
      creardirecotio();
      break;
   
   case 2:
     printf("ingrese palabra :");
      scanf("%s",contenido);
      crear(archivo,contenido);
      printf("fichero creado ");
   
   break;
   case 3:
       HANDLE hFile;
    ReadFile( hFile, &cNextChar, "archivo.txt", &dwBytesRead, NULL );
   break ;
   
    case 4:
      copy();
      printf("copiado");
    break ;
    case 5:
       DeleteFile("archivo.txt");
    break;
   
   }
      
   return 0;
}
int crear( char* archivo, char* contenido )
   {
      
       unsigned long bytesescritos;
      HANDLE hFile = CreateFile( "archivo.txt", GENERIC_WRITE, 0, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0 ); 
      WriteFile( hFile, contenido, strlen( contenido ), &bytesescritos, 0 );
      CloseHandle( hFile );

      /*hFile = CreateFile( "archivo2.txt", GENERIC_WRITE, 0, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0 ); 
      WriteFile( hFile, cont, strlen( cont ), &bytesescritos, 0 );
      CloseHandle( hFile );*/
      return 0;
   }
int creardirecotio(){
   char str[100];
   LPSECURITY_ATTRIBUTES attr;
   attr = NULL;
   printf( "nombre de la carpeta a crear\n");
   printf( "Nombre:");
   fflush(stdin);
   fgets(str, sizeof(str),stdin);
   str[strlen(str)-1]='\0';
   CreateDirectory(str, attr);
   printf( "\nCarpeta creada!\n");
   return 0;
}
int copy(){
   int file1,file2;
   int total,nbytes;
   char buf[512];
   char *s;
   if ((file1 = open("archivo.txt",O_RDONLY)) == -1){
      s = "error al abrir el fichero de entrada. \n";
      write(2,s,strlen(s));
      exit(1);
   }
   if ((file2 = creat("archivo2.txt",0777)) == -1){
      s = "error al crear el fichero de salida.\n";
      write(2,s,strlen(s));
      exit(1);
   }
      nbytes = 512;
   while ((total = read(file1,buf,nbytes)) > 0)
   if (write(file2,buf,total) == -1){
      s = "error al escribir en el fichero.\n";
      write(2,s,strlen(s));
      exit(1);
   }
   if (total == -1){
      s = "error al leer del fichero.\n";
      write(2,s,strlen(s));
      exit(1);
   }
   if (close(file1) == -1){
      s = "error al cerrar el fichero de entrada.\n";
      write(2,s,strlen(s));
      exit(1);
   }
return 0;   
}
necesito q al mostrat el contenido del archivo sea con la llamada readfile pero no se como ocuparla quie me daria una manito o un ejemplo gracias :D
4  Programación / Programación C/C++ / quien me ayuda con este codigo en: 28 Abril 2010, 23:54 pm
#include <windows.h>
#include <stdio.h>

#define BUFSIZE 4096

HANDLE hChildStdoutRd, hChildStdoutWr, hStdout;

BOOL CreateChildProcess (char *cmdline) {

   PROCESS_INFORMATION piProcInfo;
   STARTUPINFO siStartInfo;
   BOOL bFuncRetn = FALSE;

   // Set up members of the PROCESS_INFORMATION structure.
   ZeroMemory (&piProcInfo, sizeof (PROCESS_INFORMATION));

   // Set up members of the STARTUPINFO structure.
   ZeroMemory (&siStartInfo, sizeof (STARTUPINFO));
   siStartInfo.cb = sizeof (STARTUPINFO);
   siStartInfo.hStdError = hChildStdoutWr;
   siStartInfo.hStdOutput = hChildStdoutWr;
   siStartInfo.dwFlags |= STARTF_USESTDHANDLES;

   // Create the child process.
   bFuncRetn = CreateProcess (NULL, cmdline="notepad.exe", NULL, NULL, TRUE, 0, NULL,
                     NULL, &siStartInfo, &piProcInfo);

   if (bFuncRetn == 0) {
      printf ("CreateProcess failed\n");
      return FALSE;
   } else {
      CloseHandle (piProcInfo.hProcess);
      CloseHandle (piProcInfo.hThread);
      return bFuncRetn;
   }
}

int ReadFromPipe () {

   DWORD dwRead, dwWritten;
   char chBuf[BUFSIZE];

   // Close the write end of the pipe before reading from the
   // read end of the pipe.
   if (!CloseHandle (hChildStdoutWr)) {
      printf ("Closing handle failed");
      return -1;
   }

   // Read output from the child process, and write to parent's STDOUT.
   for (;;) {

      if (! ReadFile (hChildStdoutRd, chBuf, BUFSIZE, &dwRead, NULL)
         || dwRead == 0)
      {
         break;
      }

      if (! WriteFile (hStdout, chBuf, dwRead, &dwWritten, NULL))
         break;
   }

   return 0;
}

int main (int argc, char *argv[]) {

   SECURITY_ATTRIBUTES saAttr;
   BOOL fSuccess;

   // Get a handle to the parent's input file.
   if (argc == 1) {
      printf ("Must be a parameter.\n");
      return -1;
   }
   // Set the bInheritHandle flag so pipe handles are inherited.
   saAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
   saAttr.bInheritHandle = TRUE;
   saAttr.lpSecurityDescriptor = NULL;

   // Get the handle to the current STDOUT.
   hStdout = GetStdHandle (STD_OUTPUT_HANDLE);

   // Create a pipe for the child process's STDOUT.
    if (! CreatePipe (&hChildStdoutRd, &hChildStdoutWr, &saAttr, 0))
      return -2;

   // Ensure that the read handle to the child process's pipe for
   // STDOUT is not inherited.
   SetHandleInformation (hChildStdoutRd, HANDLE_FLAG_INHERIT, 0);

   // Now create the child process.
   fSuccess = CreateChildProcess (argv[1]);
   if (! fSuccess)
      return -3;

   printf ("\nContents of %s:\n\n", argv[1]);

   // Read from pipe that is the standard output for child process.
    ReadFromPipe ();

   return 0;
}



lo q necesito es darle paramatros al programa pero no caxo como ???
Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines