Follow us on Twitter!
Become the change you seek in the world. - Gandhi
Friday, April 25, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 19
Guests Online: 17
Members Online: 2

Registered Members: 82906
Newest Member: ilija
Latest Articles
View Thread

HellBound Hackers | Computer General | Networking

Author

Telnet strings?


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 29-04-07 17:27
I'm trying to make a basic telnet login just to test out my socket programming, which I just started today...

And the problem I'm having is comparing the entered password to a password I'm checking for...

The code (some of it anyway) is:

Code
msg = "Password: ";
   len = strlen(msg);
   bytes_sent = send( new_fd, msg, len, 0 );

   len = 20;
   bytes_recv = recv( new_fd, buf, len, 0 );
   
   if ( !strcmp( buf, "Pass123" ) )
   {
      msg = "\n\nCongratulations!";
      bytes_sent = send( new_fd, msg, len, 0 );
   }
   else
   {
      msg = "\n\nWrong :P";
      bytes_sent = send( new_fd, msg, len, 0 );
   }





And the problem is that when I type "Pass123" into telnet it's length is 9 characters, where the string itself is only 7, so it fails...

What are these extra characters and how to get around them ( or do I just add them to my password string? )


Author

RE: Telnet strings?


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 29-04-07 17:36
Never mind I got it... But since I can't delete the post I'll just add this...

And the solution was that there was a carriage return and then newline at the end of the string.