How to retrieve a saved ftp password from phpStorm?
Asked Answered
A

5

12

I know that technically, this question should be asked on phpStorm's forums, but being a popular IDE (I bet an eventual solution would also work for other popular IDEs from JetBrains), I'm thinking:

  • someone on SO might know and share the answer (faster than I'd get it from vendor)
  • the question answer might be useful and valuable to other coders (for that matter, even if I shall need to go on the vendor's forum I will get back with the answer here, when I find it)

If there is any need of context: I accidentally switched the connection type of a saved connection from ftp to local folder and when I switched back, the saved credentials were gone.

The question: Can I retrieve the saved password...

  • Angle 1: ...from this computer?
  • Angle 2: ...from another computer that has the same credentials saved, which I could access via TeamViewer, but has the password ●●●●●●(hidden)?
Addressee answered 17/9, 2015 at 7:54 Comment(0)
B
4

I know this is a 1 year old question, but for everyone else, you can try to copy the selected (hidden) password with CTRL+C, and paste it in a text document (tested with 2016.3 on Debian).

Bertsche answered 6/2, 2017 at 14:25 Comment(4)
Simple and clean. Doesn't need any additional software. Nice one.Addressee
Wow.. Thank you.. :)Bertsche
No longer working on 2017.1.3, looking for the new answer.Organize
downvoted since it is not current anymore and the actual answer had less votesBarefoot
O
17

Edit: This method can only be used in the version of 2016.1 or before. For newer version (probably 2016.2), they changed the encode method. There is no clue for me to decode it.

  1. Open C:\Users\.WebIde100\config\options\webServers.xml
  2. Find your FTP and get the encrypted password from the password attribute.
  3. Decrypt the password. I have written a PHP script to decrypt the string:

      $pwd = "Your encrypted password here.";
      $decrypted = '';
    
      while (strlen($pwd) > 0) {
        $decrypted .= chr(hexdec(substr($pwd, 0, 4)) ^ hexdec('dfaa'));
        $pwd = substr($pwd, 4, strlen($pwd) - 1);
      }
      echo $decrypted;
    

    If you trust my tools, you can use https://louislam.net/phpstorm-decrypt-password

Organize answered 2/2, 2016 at 16:24 Comment(5)
As long as you don't have server and username, knowing the pass doesn't get you anywhere. Can't now, but I'll test it. Thanks.Addressee
Does anyone know the location of the webServers.xml on Mac?Decrescendo
For MAC: ~/Library/Preferences/PhpStorm2017.X/options/webServers.xmlLasting
The hashed password seems to not be inside webServers.xml anymore. I believe they store it inside the binary file ~/Library/Caches/PhpStorm2017.X/caches/records.datLasting
would have prefered javascript or the like, so I hadn't have to set up an entire web server for this :P but your script did the job for a webServers.xml from march 2017. Thanks a lot! Wonder why the process has to be this complicated. Revertable encoding is equal to no security measures at all (apart from preventing clear text storage)Arrogate
A
14

If you use KeePass database file to store passwords, you can easely set password for that file, save and then open in KeePass manager, or migrate to other PHPStorm.

  1. Go to Settings/Preferences | Appearance & Behavior | System Settings | Passwords, enter new master password and save.
  2. Open /.PhpStorm2017.1/config/c.kdbx (in "Keepass 2" or "Keeweb") with saved master password.
  3. Here it is!

See answer here Retrieve saved (hidden) SSH password from PhpStorm 2017.1

Arrogance answered 11/8, 2017 at 10:33 Comment(0)
H
7

One way that just worked for me was to install Wireshark.
Use a capture filter of 'ftp', and do a "Test connection" inside PHPStorm.
Now stop the capture and examine what you've sniffed. The password will be in there.

Herta answered 26/11, 2015 at 6:38 Comment(2)
You might be able to switch modes to FTP to sniff.Mantua
Thumbs up! Worked for me using 2016.3.2. Simply copy the deployment profile, so the original settings remain unchanged. Then set the new profile to FTP, enter some random public ftp server and watch the port 21 traffic with Wireshark.Item
D
5

For OSX users

Open keychain -> select the System Roots keychain (on the left side) -> search for IntelliJ.

If you click it you will see the ftp-username in the "Account" field. You can also use right click on the records to copy the password.

Delaunay answered 2/12, 2021 at 18:8 Comment(0)
B
4

I know this is a 1 year old question, but for everyone else, you can try to copy the selected (hidden) password with CTRL+C, and paste it in a text document (tested with 2016.3 on Debian).

Bertsche answered 6/2, 2017 at 14:25 Comment(4)
Simple and clean. Doesn't need any additional software. Nice one.Addressee
Wow.. Thank you.. :)Bertsche
No longer working on 2017.1.3, looking for the new answer.Organize
downvoted since it is not current anymore and the actual answer had less votesBarefoot

© 2022 - 2025 — McMap. All rights reserved.