Hack Forums
[Python] Cert Pinning Web Requests - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Python] Cert Pinning Web Requests (/showthread.php?tid=5923491)



Cert Pinning Web Requests - 05317832892 - Dec 28, 2018

Having trouble pinning certs on web requests for python 3.

I've tried a lot but nothing is working. I need to get the SSL fingerprint before communicating.

It's to stop tampering with fiddler right now. I want to ignore the system CA trust chain and just verify the hash of the cert incoming in python myself.

Done lots of googling but I can't seem to find any solutions to this.


RE: Cert Pinning Web Requests - FriendZone - Dec 28, 2018

(Dec 28, 2018 05:06 AM)ʀᴏᴏᴛᴇᴅ Wrote:  Having trouble pinning certs on web requests for python 3.

I've tried a lot but nothing is working. I need to get the SSL fingerprint before communicating.

It's to stop tampering with fiddler right now. I want to ignore the system CA trust chain and just verify the hash of the cert incoming in python myself.

Done lots of googling but I can't seem to find any solutions to this.


If you can use python2.x there is this module which is exactly what you’re looking for

https://pypi.org/project/M2Crypto/

Sadly not supported by python3 and I don’t know a similar module for it. Still possible just no so quick and easy


RE: Cert Pinning Web Requests - 05317832892 - Dec 28, 2018

(Dec 28, 2018 07:32 AM)Hexecutor Wrote:  If you can use python2.x there is this module which is exactly what you’re looking for

https://pypi.org/project/M2Crypto/

Sadly not supported by python3 and I don’t know a similar module for it. Still possible just no so quick and easy

Yeah that look good but I got a solution finally.

Requests has a TrustEnvironment = False thingy and it works perfectly.