LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-29-2011, 05:07 AM   #1
caseydk
LQ Newbie
 
Registered: Jun 2011
Posts: 2

Rep: Reputation: Disabled
Retrieving a public RSA key through the command line


I'm doing a project demonstrating weaknesses in facebook's security setup, and I've reached a bit of a roadblock.

I need to retrieve the public RSA key of the website (facebook) that it uses for https traffic. I know I can do this through firefox and everything, but I need to do it through the command line. If that's possible, that would be great, and would lead me to question number two. Once I have the public key, how would I use it to decrypt raw network traffic, like from wireshark, that came from facebooks servers that was encrypted using the public key?

If any of you guys know, I would really appreciate it.

Thanks!
 
Old 06-29-2011, 05:17 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
The transmitted keys are generated dynamically, and so without being part of the encryption handshake you can't decrypt the data.

in terms of SSL and wireshark, just read up on it's wiki http://wiki.wireshark.org/SSL With the right credentials you can decrypt the stream, but it's a prety vague / odd system they've hacked into it.

There's a good discussion of the issues here: http://stackoverflow.com/questions/4...r-certificates

Last edited by acid_kewpie; 06-29-2011 at 05:24 AM.
 
Old 06-29-2011, 05:36 AM   #3
caseydk
LQ Newbie
 
Registered: Jun 2011
Posts: 2

Original Poster
Rep: Reputation: Disabled
Ahhhhhh, that bit on the public key being different for every session was news to me. Thank you for the clarification, I should have caught that somewhere. :P
 
Old 06-29-2011, 07:56 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
If you want to play around with SSL from the cmd line, have a look at
Code:
openssl sclient -connect host:port
http://linux.die.net/man/1/openssl
http://www.openssl.org/docs/apps/s_client.html
 
Old 06-30-2011, 02:13 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
s_client, not sclient.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Putty/SSH login failed when using RSA public key: 'Server refused our key' itsecx@gmail.com Linux - Server 10 10-04-2010 01:19 PM
Which is better RSA or DSA public key? tarballedtux Linux - Security 12 02-03-2009 06:15 AM
public key encrypted email via command line? hank43 Linux - Software 4 04-21-2007 08:03 PM
RSA public key encryption/private key decription koningshoed Linux - Security 1 08-08-2002 07:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration