LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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, 06: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, 06:17 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

Rep: Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967
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 06:24 AM.
 
Old 06-29-2011, 06: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, 08:56 PM   #4
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,311

Rep: Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040
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, 03:13 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 02:19 PM
Which is better RSA or DSA public key? tarballedtux Linux - Security 12 02-03-2009 07:15 AM
public key encrypted email via command line? hank43 Linux - Software 4 04-21-2007 09:03 PM
RSA public key encryption/private key decription koningshoed Linux - Security 1 08-08-2002 08:25 AM


All times are GMT -5. The time now is 06:23 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration