Thursday, June 18, 2015

Qualys SSL labs API - A MultiThreaded python script to scan large number of servers and produce neat results

Hi Security enthusiast,

So if you were following closely on recent developments regarding SSL/TLS security, you might have heard that Qualys SSL labs released an API to automate the testing of internet hosted applications with their awesome hosted testing solution.


If you have not heard about it here is the location to their server testing page - https://www.ssllabs.com/ssltest/

And their API documentation here - https://github.com/ssllabs/ssllabs-scan/blob/master/ssllabs-api-docs.md

So now that the API is released you can automate testing of any number of servers with any language that is able to talk with qualys server via HTTP protocol. My company wanted to test all of our servers with SSL labs, so i thought why can't i automate it with python or something. So here it is, i made a multithreaded python script to test a large number of servers in one go and get results in neat format that my management wanted :-)

The script is intended for python 2.7

You can find the script here - https://github.com/moheshmohan/pyssltest

The script takes a text file as input with the urls to servers that you need test listed line by line and it initites ssl lab tests on each of them (25 threads parallel so 25 tests) and based on the result it generates a CSV file with extended information from the results

Please note that the script currently supports only one endpoint per url, i will enhance it in future to iterate through each endpoints, in case of urls with multiple endpoints.

The results will contain the following items each row

Input_URL - The input URL 
Domain - The domain 
IP - The IP address it resolved to 
returncode - The value returned from Qualys server (READY, ERROR etc) 
Grade - The Grade as per Qualys rating 
Secondary grade - Secondary Grade as per qualys rating 
Now it contains these items per each server. Basically these contain Y (yes) or N (no) values and the headings are self explanatory

Freak
Poodle_TLS 
Insecure renegotiation 
OpenSSL ccs 
Insecure DH
SSL v2 
Poodle_SSL
wrong domain 
cert expired 
self signed cert
No TLS1.2?
SSL v3
RC4
cert chain issue
CRIME
forward secrecy not supported?
weak private key?
weak signature
secure renegotiation
TLS 1.0
TLS 1.1
TLS 1.2 

Running the script

To run the script you can use the following command

python pyssltest.py -i inp.txt -o inp.csv -n

I will explain each switches,

-i <filename> :- A text file with target urls listed line by line 
-o <filename> :- A csv file to which the output will be written 
-n  :- Optional, To always initiate new tests. If this is omitted cached results from qualys is fetched 
Its pretty simple and fast way to run ssl labs against a bunch of servers.

Please provide some feedback about script on comments below.

Thanks for reading

83 comments:

  1. Replies
    1. I am glad that I saw this post. It is informative blog for us and we need this type of blog thanks for share this blog, Keep posting such instructional blogs and I am looking forward for your future posts. Python Projects for Students Data analytics is the study of dissecting crude data so as to make decisions about that data. Data analytics advances and procedures are generally utilized in business ventures to empower associations to settle on progressively Python Training in Chennai educated business choices. In the present worldwide commercial center, it isn't sufficient to assemble data and do the math; you should realize how to apply that data to genuine situations such that will affect conduct. In the program you will initially gain proficiency with the specialized skills, including R and Python dialects most usually utilized in data analytics programming and usage; Python Training in Chennai at that point center around the commonsense application, in view of genuine business issues in a scope of industry segments, for example, wellbeing, promoting and account. Project Center in Chennai

      Delete
  2. Hello team ,

    Thanks for your post, i have used the python script to check SSL certificates for some websites, i got this errors, i have checked for several times without success :/

    ```
    Input_URL,Domain,IP,Common Name,Source,Date Added,Portfolio,sub portfolio,ELT,POC,IT Contact,Status,returncode,Grade,Secondary grade,Expected Remediation Date,Grade After Remediation,Actual Remediation Date,Actual Grade after Remediation,Drown (Experimental),Freak,Logjam,Poodle_TLS,Insecure renegotiation,OpenSSL ccs,Insecure DH,SSL v2,SSLv2 SuitesDisabled,Poodle_SSL,wrong domain,cert expired,Ey issued cert,self signed cert,No TLS1.2?,SSL v3,RC4,rc4Only,cert chain issue,Cert chain incomplete,CRIME,forward secrecy not supported?,weak private key?,weak signature,secure renegotiation,TLS 1.0,TLS 1.1,TLS 1.2,Recommendation to raise score to A,Date Last scanned(Auto),Date Manually validated,Comments,Audit teams Comments(New grade as on *),Thumbprint,common names,alternate names
    ldeb.fr,ldeb.fr,[Errno 2] No such file or directory: 'results/ldeb.fr.txt',READY,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error,Error
    ```

    Could have any suggestions plz

    Regards

    ReplyDelete
  3. Awesome post. I am a normal visitor of your blog and appreciate you taking the time to maintain the excellent site. I’ll be a frequent visitor for a long time.

    ACP Sheet
    ACP Sheet Price
    Aluminium Composite Panel
    ACP Panel
    ACP Sheets

    ReplyDelete
  4. Thanks for sharing informative article. We are one of the reputed removalists Melbourne offer professional home, office and furniture relocation service at affordable service. piano movers Melbourne

    ReplyDelete
  5. I must thank you for posting this blog because the topic is very much in demand today and everyone wants to read about dynamodb. thanks for sharing these type of informative blogs..keep it up!!

    android training in chennai

    android online training in chennai

    android training in bangalore

    android training in hyderabad

    android Training in coimbatore

    android training

    android online training

    ReplyDelete

  6. Firstly talking about the Blog it is providing the great information providing by you . Thanks for that .Hope More articles from you . Next i want to share some information about Salesforce training in Banglore .

    ReplyDelete
  7. this is a cost effective resource for businesses to use for video conferencing from just about any device. I have interviewed with companies via Skype from my cell phone. It is easy, convenient, and just about anyone can have access from just about anywhere. Salesforce interview questions and answers

    ReplyDelete
  8. it is really a great and helpful piece of info. I am glad that you shared this helpful information with us. Please keep us informed like this. Thank you for sharing.
    malaysia visa in Singapore

    ReplyDelete
  9. MyAssignmentHelpNow, who help students globally at all academic level. We work 24*7 so that you don’t need to wait for any certain time, you can reach us any time.For ourassignment help you can directly get into touch with our expert.
    My Assignment Help

    ReplyDelete
  10. Initiating from the data gathering stage, the whole process requires performance indicators or performance evaluation metrics that could measure the steps time to time that will stop the issue at an early stage. data science course syllabus

    ReplyDelete
  11. This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free.
    Website: Satta Matta matka

    ReplyDelete
  12. Play premier league fantasy cricket on India's no.1 App and get a chance to win up to 50 lakhs in every match. Download the app now!

    ReplyDelete
  13. Thanks for the information. You have discussed an interesting topic that everybody should know. Keep posting these kind of posts.
    Website: Imitation jewellery

    ReplyDelete
  14. It's awesome to visit this website and reading the views of all friends on the topic of this article
    Website :- RO service near me in Nagpur

    ReplyDelete
  15. very cool, informative, in the field of safety, and to attract people I use https://soclikes.com/

    ReplyDelete
  16. SAP stands for Systems Applications and Products in Data Processing. SAP, by definition, is also the name of the ERP (Enterprise Resource Planning) software as well as the name of the company.
    tally training in chennai

    hadoop training in chennai

    sap training in chennai

    oracle training in chennai

    angular js training in chennai

    ReplyDelete
  17. This comment has been removed by the author.

    ReplyDelete
  18. This comment has been removed by the author.

    ReplyDelete
  19. This comment has been removed by the author.

    ReplyDelete
  20. This comment has been removed by the author.

    ReplyDelete
  21. Watch movies online sa-movie.com, watch new movies, series Netflix HD 4K, ดูหนังออนไลน์ watch free movies on your mobile phone, Tablet, watch movies on the web.

    SEE4K Watch movies, watch movies, free series, load without interruption, sharp images in HD FullHD 4k, all matters, ดูหนังใหม่ all tastes, see anywhere, anytime, on mobile phones, tablets, computers.

    GangManga read manga, read manga, read manga online for free, fast loading, clear images in HD quality, all titles, อ่านการ์ตูน anywhere, anytime, on mobile, tablet, computer.

    Watch live football live24th, watch football online, ผลบอลสด a link to watch live football, watch football for free.

    ReplyDelete
  22. SamudraBet Situs Judi Online Terbaik, Terpercaya dan Terbesar di Indonesia. Menyediakan permainan :

    Judi bola terbaik

    Judi slot online terpercaya

    Poker online terbaru

    Live casino online

    Judi sabung ayam

    ReplyDelete
  23. This article will outline all the different strategies you should be aware of when it comes to soccer.

    best ias coaching in delhi

    ReplyDelete
  24. https://designingcourses.in/
    Very Informative and useful... Keep it up the great work. I really appreciate your post.

    https://designingcourses.in/graphic-designing-courses-in-bangalore/
    https://designingcourses.in/web-designing-course-in-bangalore/

    ReplyDelete

  25. These include other cannabinoids associated with CBD, as well as aroma molecules called terpenes. Terpenes are responsible for the different flavors of CBD Cannabisand hemp plants.

    ReplyDelete
  26. The largest, including thousands more every day With games that start every second, lovePoker is the only place that collects
    poker online games from many, be it Upoker, Pppoker, PokerBros, Pokerstars, Sharkscope, Siampoker, Dafabet, IDN Poker, or well known Thai people

    ReplyDelete
  27. it is not the most popular on this list, but fans do love its benefits ดูบอลฟรี . One of these is that no sign up is required, but you can sign up for free to get some convenient options. For instance, it provides intelligent content recommendations and a calendar for you to set up reminders. That way, you never miss your favorite live content. If you do miss it, though, you can always pull it up on Duball24hrs.com recordings.

    ReplyDelete
  28. Thanks for spending all your pleasant time to make such a Creative content for us. AWS Training in Chennai

    ReplyDelete
  29. เราคือผู้นำด้านเกมพนันออนไลน์ Major168 เราคือผู้ให้บริการ คาสิโนออนไลน์ ที่ได้รับรองว่าดีที่สุดในประเทศไทย มีค่ายเกมส์ให้เล่นมากมาย Sagaming, Sexy bacarat, Dreamgame, Ebet, Wm casino, Vivo gaming ไม่ผ่านเอเย่นต์ ระบบปลอดภัยมีทีมงานดูแลตลอด 24ชม.

    SAGAME88 แหล่งรวมเกมส์พนันออนไลน์ คาสิโนสด บาคาร่า กำถั่ว คาสิโนออนไลน์ ไฮโล รูเล็ต รับเครดิตฟรีเล่นได้ทุกเกมส์ โบนัสสมาชิกใหม่เพียบ พร้อมระบบฝากถอนออโต้ 10วิ เรามีทุกค่ายเกมส์ให้คุณเลือกเดิมพัน SA Game Sexy bacarat Dreamgame WM Casino VIVO Gaming Ebet เล่นได้ทุกเกมส์

    Our website ufabet provides betting services in the system of Auto Deposit-Withdrawal. Our members are not only in Thailand. Online football betting UEFA Bet market And this makes a guarantee that Ufabet168 is another reliable football betting website

    ufa through the website UFABET1688 a web gambling online , one that integrated all the bets from online casinos , online casino , online , and also have a game a lot more to be chosen to play such games.

    ReplyDelete
  30. With special privileges and services, UEFA BET offers opportunities for small capitalists. Together ufa with the best websites that collect the most games With a minimum deposit starting from just 100 baht, you are ready to enjoy the fun with a complete range of betting that is available within the website

    ufabet , our one another option We are a direct website, not through an agent, where customers can have great confidence without deception The best of online betting sites is that our Ufa will give you the best price

    ReplyDelete
  31. In terms of ufabet betting, there are many forms, but they are hot. And received the most attention In this world, it is all about online football betting, whether it is a series of football betting, favorite football betting, or single ball, or even playing soccer step as well.

    ReplyDelete
  32. Yaeris utilize WhatsApp & LINE to reach your targeted gathering of people through the mass broadcasting strategy. The are providing WhatsApp Impacting & LINE Impacting. We assist you to send expansive amounts sum of WhatsApp & LINE messages within 24 hours. You'll be able to dispatch your campaign by getting to our entrance.

    ReplyDelete
  33. By far the most serious football betting UFABET that's over and above description Find fun, excitement and excitement with slot games, 100 totally free recognition, rapid withdrawal. If you desire to relax slots for cash No requirement to deposit a great deal, with no bare minimum, with no requirement to talk about, waste moment simply because UFABET is actually reduced, paid greatly, a number of great offers are actually waiting for you. Willing to guarantee enjoyable, no matter if it's Joker SlotXo fruit slot, we can telephone call it a web slot site for you personally especially. Prepared to relax Including the support team which is going to facilitate slot formulas along with strategies of enjoying So you will be sure that each minute of exhilaration and fun We will be there for someone to offer the customers of yours the greatest impression and total satisfaction.
    บาคาร่า
    ufa
    ufabet
    แทงบอล
    แทงบอล
    แทงบอล

    ReplyDelete
  34. This is the best blog annualeventpost I ever see. Thanks for sharing information with us.

    ReplyDelete
  35. ได้โดยที่จะทำให้คุณนั้นสามารถสร้างกำไรจากการเล่นเกมส์เดิมพันออนไลน์ได้เราแนะนำเกมส์ชนิดนี้ให้คุณได้รู้จักก็เพราะว่าเชื่อว่าทุกคนนั้นจะต้องรู้วิธีการเล่นและวิธีการเอาชนะเกมม สล็อต าแทบทุกคนเพราะเราเคยเล่นกันมาตั้งแต่เด็กเด็กหาคุณได้เล่นเกมส์คาสิโนออนไลน์ที่คุณนั้นคุ้นเคยหรือจะเป็นสิ่งที่จะทำให้คุณสามารถที่จะได้กำไรจากการเล่นเกมได้มากกว่าที่คุณไปเล่นเกมส์คาสิโนออนไลน์ที่คุณนั้นไม่เคยเล่นมาก่อนและไม่คุ้นเคย เราจึงคิดว่าเกมส์ชนิดนี้เป็นเกมส์ที่น่าสนใจมากๆที่เราอยากจะมาแนะนำให้ทุกคนได้รู้จักและได้ใช้บริการ

    ReplyDelete
  36. with buy real telegram channel members you can increase your channel members in short time! Also you can increase telegram view with adsmember easily! https://adsmember.com/

    ReplyDelete
  37. 與您的醫療保健提供者討論營養問題,尤其是在生病、住院或手術康復時,以管理與疾病相關的肌肉損失。犀利士 // 年輕人患有勃起功能障礙(ED)的原因

    ReplyDelete
  38. 均衡、營養的飲食可以讓世界變得不同。保持健康的體重可以降低或消除與肥胖相關的健康狀況的風險,包括糖尿病、高血壓、心髒病、中風、腎臟疾病和骨關節炎。以水果、蔬菜、穀物、不飽和脂肪和瘦肉為基礎的健康飲食可以顯著降低嚴重健康並發症的風險,並幫助您每天感覺更好。威而鋼 | 中國2塊錢一片威而鋼哪裡買?輝瑞終於降價了?

    ReplyDelete
  39. Great post! I really enjoyed reading it. Keep sharing such articles. Looking forward to learn more from you.Thanks for sharing.
    Reactjs Training in Chennai |
    Best Reactjs Training Institute in Chennai |
    Reactjs course in Chennai

    ReplyDelete
  40. Great article! This is the type of information that are meant to
    be shared across the internet. Thank you for sharing such a useful post. Very Interesting Post! I regularly follow this kind of Blog.
    visit this page

    ReplyDelete
  41. I know this sounds good, but if you choose to use CareCredit, proceed with your eyes wide open. A CareCredit card is a deferred-interest product, but many consumers mistakenly believed that CareCredit is an interest-free credit card. That doesn't mean you shouldn't use it. It just means you need to understand how deferred interest works.
    fishyfacts4u.com
    fishyfacts4u.com
    fishyfacts4u.com
    fishyfacts4u.com
    fishyfacts4u.com
    fishyfacts4u.com
    fishyfacts4u.com
    fishyfacts4u.com
    fishyfacts4u.com
    fishyfacts4u.com

    ReplyDelete
  42. Although there is a 14-day free trial, Lander can become very expensive, as the plans are based on the number of visitors your landing page receives. Lander’s basic plan starts at $16 per month. What are the pros and cons of using Lander?

    emagazinehub.com
    emagazinehub.com
    emagazinehub.com
    emagazinehub.com
    emagazinehub.com
    emagazinehub.com
    emagazinehub.com
    emagazinehub.com
    emagazinehub.com
    emagazinehub.com

    ReplyDelete
  43. Depending on your relationship with SunTrust Bank and how you redeem your rewards, you could get up to 50% more value out of your rewards.

    inewshunter.com
    inewshunter.com
    inewshunter.com
    inewshunter.com
    inewshunter.com
    inewshunter.com
    inewshunter.com
    inewshunter.com
    inewshunter.com
    inewshunter.com

    ReplyDelete
  44. In more severe cases, taxpayers and corporations may be able to negotiate what they owe with the IRS or may need to go through proceedings in a formal tax court setting. But for the typical taxpayer, experts say a worst-case scenario would involve paying a penalty.

    juicyfactor.com
    juicyfactor.com
    juicyfactor.com
    juicyfactor.com
    juicyfactor.com
    juicyfactor.com
    juicyfactor.com
    juicyfactor.com
    juicyfactor.com
    juicyfactor.com

    ReplyDelete
  45. Good blog,

    Digital Marketing, Digital Marketing Online Training, Digital Marketing Training Programs, Women Entrepreneurship, Women Entrepreneurship Training Programs, Digital marketing online video course, Women Entrepreneurship Online Certification Course, Business coaching, Training for Business owners, Business coaching for women, young entrepreneurs training

    https://www.eminentdigitalacademy.com

    ReplyDelete
  46. Thanks For Sharing Such a Wonderful Article this helps me a lot
    Best Software Training Institutes

    ReplyDelete
  47. It's Very informative and helpful. If you are interested in learning JMeter please refer to the link below. Thank you

    JMeter Training in Chennai | JMeter Course in Chennai | JMeter Online Course

    ReplyDelete