This method is copied from here.
Any version of IOS (I tried with with 5.1.1)
Jailbroken iphone (I used a iPhone 4S)
1. Install openssh from cydia.
2. On Windows workstation, download keychain_dumper, winscp & putty tools.
3. Connect iPhone and workstation to the same WI-FI network.
4. Run winscp and connect to the iPhone by typing iPhone IP address, root as username and alpine as password.
5. Copy keychaindumper executable to iPhone root directory.
6. Run putty and connect to the iPhone by typing iPhone IP, root as username and alpine as password.
7. On putty terminal, type chmod 777 keychain_dumper and ./keychain_dumper commands. It will execute the keychain_dumper tool and displays all the entries in keychain.