Your forum username:
Do you already have an account?
Forgot your password?
  • Log in or Sign up


    Welcome to Sky User - The Unofficial Support Forum for everything Sky! - Proudly helping over 65k members.


    Advertisement

    Page 2 of 11 FirstFirst 1234 ... LastLast
    Results 11 to 20 of 108
    Like Tree10Likes

    Simple tool for extracting the username and password from YOUR router.

    This is a discussion on Simple tool for extracting the username and password from YOUR router. within the Extracting Sky Router passwords forums, part of the Broadband Technical Help category; Originally Posted by Shonk Nice will test it now with an sr101 and sr102 Its an installer sort that out ...

    1. #11
      marjohn56's Avatar
      marjohn56 is offline Sky User Member
      Exchange: Cricklewood
      Broadband ISP: ZEN
      Router: Billion 8800NL(Modem Bridge) + OPNsense 21.7.a*
      Sky TV: Sky Q 2Tb+Mini
      Join Date
      Dec 2011
      Posts
      1,811
      Thanks
      13
      Thanked 144 Times in 135 Posts

      Re: Simple tool for extracting the username and password from YOUR router.

      Quote Originally Posted by Shonk View Post
      Nice will test it now with an sr101 and sr102

      Its an installer sort that out geez
      For you Shonk, I have done so...
      --------------------------------------------------------
      Artificial Intelligence is no match for Natural Stupidity.
      --------------------------------------------------------


    2. Advertisement
    3. #12
      marjohn56's Avatar
      marjohn56 is offline Sky User Member
      Exchange: Cricklewood
      Broadband ISP: ZEN
      Router: Billion 8800NL(Modem Bridge) + OPNsense 21.7.a*
      Sky TV: Sky Q 2Tb+Mini
      Join Date
      Dec 2011
      Posts
      1,811
      Thanks
      13
      Thanked 144 Times in 135 Posts

      Re: Simple tool for extracting the username and password from YOUR router.

      Here you go seawright...

      // SkyCredExtract.cpp : Defines the entry point for the console application.
      //


      #include "stdafx.h"
      #include <stdio.h>
      #include <stdlib.h>
      #include <string.h>
      #include <winsock.h>
      #include <time.h>


      #define BUFFER_SIZE 4096


      void usage(void);
      int searchcookie(char *buffer, int numbytes);




      int main(int argc, char** argv)
      {
      WSADATA w; /* Used to open windows connection */

      int a1, a2, a3, a4; /* Components of address in xxx.xxx.xxx.xxx form */
      int client_length; /* Length of client struct */
      int bytes_received; /* Bytes received from client */
      SOCKET sd; /* Socket descriptor of server */
      struct sockaddr_in server; /* Information about the server */
      struct sockaddr_in client; /* Information about the client */
      char buffer[BUFFER_SIZE]; /* Where to store received data */
      struct hostent *hp; /* Information about this computer */
      char host_name[256]; /* Name of the server */
      int Option61_length;
      int Option60_length;


      char username[32];
      char password[32];
      char Option60[32];
      char MACAddress[32];
      int x, marker;
      bool complete;
      bool Do_Auto;





      Do_Auto = false;




      /* Interpret command line */
      if (argc == 1)
      {
      a1 = 192;
      a2 = 168;
      a3 = 0;
      a4 = 10;



      }
      else if (argc == 2)
      {
      /* Copy address */
      if(strcmp(argv[1],"auto") == 0)
      {
      Do_Auto = true;
      }
      else if (sscanf_s(argv[1], "%d.%d.%d.%d", &a1, &a2, &a3, &a4) != 4)
      {
      usage();
      }


      }
      else
      {
      usage();
      }


      printf("Sky Router Login Extractor from the SkyUser forum\n");
      printf("Waiting for DHCP request from router...\n");




      /* Open windows connection */
      if (WSAStartup(0x0101, &w) != 0)
      {
      fprintf(stderr, "Could not open Windows connection.\n");
      exit(0);
      }


      /* Open a datagram socket */
      sd = socket(AF_INET, SOCK_DGRAM, 0);
      if (sd == INVALID_SOCKET)
      {
      fprintf(stderr, "Could not create socket.\n");
      WSACleanup();
      exit(0);
      }


      /* Clear out server struct */
      memset((void *)&server, '\0', sizeof(struct sockaddr_in));


      /* Set family and port */
      server.sin_family = AF_INET;
      server.sin_port = htons(67);


      /* Set address automatically if desired */
      if (Do_Auto)
      {
      /* Get host name of this computer */
      gethostname(host_name, sizeof(host_name));
      hp = gethostbyname(host_name);


      /* Check for NULL pointer */
      if (hp == NULL)
      {
      fprintf(stderr, "Could not get host name.\n");
      closesocket(sd);
      WSACleanup();
      exit(0);
      }

      /* Assign the address */
      server.sin_addr.S_un.S_un_b.s_b1 = hp->h_addr_list[0][0];
      server.sin_addr.S_un.S_un_b.s_b2 = hp->h_addr_list[0][1];
      server.sin_addr.S_un.S_un_b.s_b3 = hp->h_addr_list[0][2];
      server.sin_addr.S_un.S_un_b.s_b4 = hp->h_addr_list[0][3];
      }
      /* Otherwise assign it manually */
      else
      {
      server.sin_addr.S_un.S_un_b.s_b1 = (unsigned char)a1;
      server.sin_addr.S_un.S_un_b.s_b2 = (unsigned char)a2;
      server.sin_addr.S_un.S_un_b.s_b3 = (unsigned char)a3;
      server.sin_addr.S_un.S_un_b.s_b4 = (unsigned char)a4;
      }


      /* Bind address to socket */
      if (bind(sd, (struct sockaddr *)&server, sizeof(struct sockaddr_in)) == -1)
      {
      fprintf(stderr, "Could not bind name to socket.\n");
      closesocket(sd);
      WSACleanup();
      exit(0);
      }


      /* Print out server information */
      printf("Listening on IP %u.%u.%u.%u\n", (unsigned char)server.sin_addr.S_un.S_un_b.s_b1,
      (unsigned char)server.sin_addr.S_un.S_un_b.s_b2,
      (unsigned char)server.sin_addr.S_un.S_un_b.s_b3,
      (unsigned char)server.sin_addr.S_un.S_un_b.s_b4);
      printf("Press CTRL + C to quit\n");


      complete = false;


      /* Loop and get data from clients */
      while (!complete)
      {
      client_length = (int)sizeof(struct sockaddr_in);


      /* Receive bytes from client */
      bytes_received = recvfrom(sd, buffer, BUFFER_SIZE, 0, (struct sockaddr *)&client, &client_length);
      if (bytes_received < 0)
      {
      fprintf(stderr, "Could not receive datagram.\n");
      closesocket(sd);
      WSACleanup();
      exit(0);
      }


      /* Check for magic packet */
      if(bytes_received > 300)
      {

      // printf("Bytes received is %d\n",bytes_received);

      x = searchcookie(buffer,bytes_received);


      printf("Found DHCP Cookie at %d\n\n",x);


      // Now find the length of option 61


      Option61_length = buffer[x+8];
      Option60_length = buffer[Option61_length + x + 10];


      memset((void *)&username, '\0', sizeof(username));
      memset((void *)&password, '\0', sizeof(password));
      memset((void *)&Option60, '\0', sizeof(Option60));
      memset((void *)&MACAddress, '\0', sizeof(MACAddress));




      // find the marker


      for(marker = x+9;marker < Option61_length+x+9; marker++)
      {
      if(buffer[marker] == 124)
      {
      memcpy(username,&buffer[x+9],marker-(x+9));
      printf("Username = %s\n",username);


      memcpy(password,&buffer[x+9+strlen(username)+1],Option61_length-(strlen(username)+1));
      printf("Password = %s\n",password);


      memcpy(Option60,&buffer[x+Option61_length+11],Option60_length);
      printf("Option60 = %s\n",Option60);


      memcpy(MACAddress,&buffer[28],6);
      printf("MAC Address = %02X:%02X:%02X:%02X:%02X:%02X\n\n",MACAddress[0] & 0xff,MACAddress[1] & 0xff,MACAddress[2] & 0xff,MACAddress[3] & 0xff,MACAddress[4] & 0xff,MACAddress[5] & 0xff);
      complete = true;
      }
      }


      }

      }
      closesocket(sd);
      WSACleanup();


      printf("Brought to you by the Skyuser forum. Join us on www.skyuser.co.uk\n");
      system("pause");
      return 0;


      }


      int searchcookie(char *buffer, int numbytes)
      {
      int z;


      char Cookie[] = {0x63, 0x82, 0x53, 0x63,0x35,0x01,0x01,0x3d}; // cookie and lead chars






      for(z = 1;z < numbytes-8;z++)
      {

      if(memcmp(Cookie,&buffer[z],8) == 0)
      {
      return(z);
      }


      }


      return(0);
      }
      void usage(void)
      {
      fprintf(stderr, "SkyCredExtract [auto] ||
      [listening_address in the form x.x.x.x]\n");
      exit(0);
      }
      Last edited by marjohn56; 23-10-15 at 10:03 AM. Reason: Modifed code
      --------------------------------------------------------
      Artificial Intelligence is no match for Natural Stupidity.
      --------------------------------------------------------

    4. The Following User Says Thank You to marjohn56 For This Useful Post:

      seawright (19-10-15)

    5. #13
      skyeci's Avatar
      skyeci is offline Sky User Member
      Exchange:
      Broadband ISP: Zen VDSL 80/20 - ex sky fibre pro
      Router: ECI CAB - Zyxel vmg3925 (bridge mode) + i5 Qotom OPNSense with IPV6
      Sky TV: Sky+HD box
      Join Date
      May 2015
      Posts
      791
      Thanks
      13
      Thanked 59 Times in 59 Posts

      Re: Simple tool for extracting the username and password from YOUR router.

      great tool. nice work!, thanks - just tested it on my sr102 and worked a treat

    6. #14
      marjohn56's Avatar
      marjohn56 is offline Sky User Member
      Exchange: Cricklewood
      Broadband ISP: ZEN
      Router: Billion 8800NL(Modem Bridge) + OPNsense 21.7.a*
      Sky TV: Sky Q 2Tb+Mini
      Join Date
      Dec 2011
      Posts
      1,811
      Thanks
      13
      Thanked 144 Times in 135 Posts

      Re: Simple tool for extracting the username and password from YOUR router.

      Quote Originally Posted by choppersrock View Post
      great tool. nice work!, thanks - just tested it on my sr102 and worked a treat

      Great... It works. I'm going to add aa complete string including the '|' to the ouput as soon as I get five minutes to do that.

      Might add a command line option for auto ip too.
      --------------------------------------------------------
      Artificial Intelligence is no match for Natural Stupidity.
      --------------------------------------------------------

    7. #15
      skyeci's Avatar
      skyeci is offline Sky User Member
      Exchange:
      Broadband ISP: Zen VDSL 80/20 - ex sky fibre pro
      Router: ECI CAB - Zyxel vmg3925 (bridge mode) + i5 Qotom OPNSense with IPV6
      Sky TV: Sky+HD box
      Join Date
      May 2015
      Posts
      791
      Thanks
      13
      Thanked 59 Times in 59 Posts

      Re: Simple tool for extracting the username and password from YOUR router.

      the only thing I found is after install it did not run the program from the start menu if its supposed to do that?, I just manually found the credextract and just clicked it so this manually started the applicaiton. (windows 10 laptop)

    8. #16
      marjohn56's Avatar
      marjohn56 is offline Sky User Member
      Exchange: Cricklewood
      Broadband ISP: ZEN
      Router: Billion 8800NL(Modem Bridge) + OPNsense 21.7.a*
      Sky TV: Sky Q 2Tb+Mini
      Join Date
      Dec 2011
      Posts
      1,811
      Thanks
      13
      Thanked 144 Times in 135 Posts

      Re: Simple tool for extracting the username and password from YOUR router.

      Ah, that depends which version you run. If you run the version with the installer then it should have created a shortcut to run it from; if you downloaded the console version, there's no installer, you just extract it and run in in a from the command line.

      I created the non installer version as Shonk did not like the idea of installer, so there's now a choice. The installer one is better in one aspect as it uses .net, and using that means it listens for a DHCP packet on all ports, no matter how many ports you have on your PC.
      --------------------------------------------------------
      Artificial Intelligence is no match for Natural Stupidity.
      --------------------------------------------------------

    9. #17
      Shonk's Avatar
      Shonk is offline Sky User Member
      Exchange:
      Broadband ISP: Sky Fibre Unlimited Pro
      Router: Asus RT-AC88U
      Sky TV: Sky+ HD
      Join Date
      Mar 2010
      Posts
      1,482
      Thanks
      7
      Thanked 121 Times in 116 Posts

      Re: Simple tool for extracting the username and password from YOUR router.

      Activation context generation failed for "D:\SkyCredExtract\SkyCredExtract.exe". Dependent Assembly Microsoft.VC90.MFC,processorArchitecture="x86",pub licKeyToken="1fc8b3b9a1e18e3b",type="win32",versio n="9.0.21022.8" could not be found. Please use sxstrace.exe for detailed diagnosis.

    10. #18
      marjohn56's Avatar
      marjohn56 is offline Sky User Member
      Exchange: Cricklewood
      Broadband ISP: ZEN
      Router: Billion 8800NL(Modem Bridge) + OPNsense 21.7.a*
      Sky TV: Sky Q 2Tb+Mini
      Join Date
      Dec 2011
      Posts
      1,811
      Thanks
      13
      Thanked 144 Times in 135 Posts

      Re: Simple tool for extracting the username and password from YOUR router.

      Thats's the c++ version. Hmm, did not test that on another machine.

      I'll look at that tonight.
      --------------------------------------------------------
      Artificial Intelligence is no match for Natural Stupidity.
      --------------------------------------------------------

    11. #19
      marjohn56's Avatar
      marjohn56 is offline Sky User Member
      Exchange: Cricklewood
      Broadband ISP: ZEN
      Router: Billion 8800NL(Modem Bridge) + OPNsense 21.7.a*
      Sky TV: Sky Q 2Tb+Mini
      Join Date
      Dec 2011
      Posts
      1,811
      Thanks
      13
      Thanked 144 Times in 135 Posts

      Re: Simple tool for extracting the username and password from YOUR router.

      Quote Originally Posted by Shonk View Post
      Activation context generation failed for "D:\SkyCredExtract\SkyCredExtract.exe". Dependent Assembly Microsoft.VC90.MFC,processorArchitecture="x86",pub licKeyToken="1fc8b3b9a1e18e3b",type="win32",versio n="9.0.21022.8" could not be found. Please use sxstrace.exe for detailed diagnosis.
      Ok, a little research comes up with the following. As it's written in VS2008 you need...

      Download and install the x86 Visual C++ 2008 Redist, as well as the servicepack for it.

      I'll include these in the archive.
      --------------------------------------------------------
      Artificial Intelligence is no match for Natural Stupidity.
      --------------------------------------------------------

    12. #20
      marjohn56's Avatar
      marjohn56 is offline Sky User Member
      Exchange: Cricklewood
      Broadband ISP: ZEN
      Router: Billion 8800NL(Modem Bridge) + OPNsense 21.7.a*
      Sky TV: Sky Q 2Tb+Mini
      Join Date
      Dec 2011
      Posts
      1,811
      Thanks
      13
      Thanked 144 Times in 135 Posts

      Re: Simple tool for extracting the username and password from YOUR router.

      Quote Originally Posted by choppersrock View Post
      the only thing I found is after install it did not run the program from the start menu if its supposed to do that?, I just manually found the credextract and just clicked it so this manually started the applicaiton. (windows 10 laptop)
      OK, that's now fixed. I have replaced the original link with a new one. I've created a propper installer this time and checked it all.
      --------------------------------------------------------
      Artificial Intelligence is no match for Natural Stupidity.
      --------------------------------------------------------

    13. The Following User Says Thank You to marjohn56 For This Useful Post:

      skyeci (21-10-15)

     

     
    Page 2 of 11 FirstFirst 1234 ... LastLast

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •  
    SkyUser - Copyright © 2006-2020. SatDish and NewsreadeR | SkyUser is in no way affiliated with Sky Broadband / BSkyB
    RIPA NOTICE: NO CONSENT IS GIVEN FOR INTERCEPTION OF PAGE TRANSMISSION