{"id":7586,"date":"2020-11-27T21:25:18","date_gmt":"2020-11-28T04:25:18","guid":{"rendered":"https:\/\/webdev.securin.xyz\/?p=7586"},"modified":"2023-04-05T12:42:39","modified_gmt":"2023-04-05T19:42:39","slug":"how-to-detect-cve-2020-24600","status":"publish","type":"post","link":"https:\/\/webdev.securin.xyz\/articles\/how-to-detect-cve-2020-24600\/","title":{"rendered":"How to Detect CVE- 2020-24600?"},"content":{"rendered":"
A new zero-day vulnerability, CVE-2020-24600<\/strong>, was discovered by Cyber Security Works<\/strong> in Shilpi\u00a0– Capexweb 1.1\u00a0a multiexchange BackOffice Solution for Capital and Derivative Market brokers in India.<\/span><\/span><\/p>\n This vulnerability was discovered in our research lab on July 01, 2020. Our team has also released a script to detect this vulnerability.<\/span><\/span><\/p>\n <\/a>You can use the following script to detect this vulnerability –<\/a><\/span><\/span><\/p>\n <\/p>\n <\/a>import os<\/p>\n <\/a>import sys<\/p>\n <\/a>import urllib<\/p>\n <\/a>from urllib import error<\/p>\n <\/a>from urllib import request<\/p>\n <\/a>import ssl<\/p>\n <\/a>from lxml import html<\/p>\n <\/a><\/a><\/a><\/p>\n <\/a># Ignore SSL certificate errors<\/p>\n <\/a>ctx = ssl.create_default_context()<\/p>\n <\/a>ctx.check_hostname = False<\/p>\n <\/a>ctx.verify_mode = ssl.CERT_NONE<\/p>\n <\/a><\/a><\/a><\/p>\n <\/a>def main():<\/p>\n <\/a>\u00a0\u00a0\u00a0 if(len(sys.argv) <= 1):<\/p>\n <\/a>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 print(“Usage: python capexweb.py <hostname> <port>”)<\/p>\n <\/a>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 return<\/p>\n <\/a>\u00a0\u00a0\u00a0 host = sys.argv[1]<\/p>\n <\/a>\u00a0\u00a0\u00a0 #default port 443<\/p>\n <\/a>\u00a0\u00a0\u00a0 port = “443”<\/p>\n <\/a>\u00a0\u00a0\u00a0 #initializing port<\/p>\n <\/a>\u00a0\u00a0\u00a0 if(sys.argv[2] != “”):<\/p>\n <\/a>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 port = sys.argv[2]<\/p>\n <\/a>\u00a0\u00a0\u00a0\u00a0 #default path<\/p>\n <\/a>\u00a0\u00a0\u00a0 path = “\/capexweb”<\/p>\n <\/a>\u00a0\u00a0\u00a0 URL = “https:\/\/” + host + “:” + port + path<\/p>\n <\/a>\u00a0\u00a0\u00a0 loginformURI = “\/capexweb\/capexmain_middle.htm”<\/p>\n <\/a>\u00a0\u00a0\u00a0 try:<\/p>\n <\/a>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #Request to fetch login form parameters<\/p>\n <\/a>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 response = urllib.request.urlopen(URL + loginformURI, context=ctx)<\/p>\n <\/a>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tree = html.fromstring(response.read())<\/p>\n <\/a>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 form = tree.find(‘.\/\/form’)<\/p>\n <\/a>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 action = form.action<\/p>\n <\/a>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 params = {}<\/p>\n <\/a>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 params[“dfuserid”] = “admin”<\/p>\n <\/a>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 params[“dfpassword”] = “password”<\/p>\n <\/a>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 params[“dfcode”] = tree.find(‘.\/\/input[@name=”dfcode”]’).value<\/p>\n <\/a>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 params[“dfparentdb”] = tree.find(‘.\/\/input[@name=”dfparentdb”]’).value<\/p>\n <\/a>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 params[“dfparentip”] = tree.find(‘.\/\/input[@name=”dfparentip”]’).value<\/p>\n <\/a>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 params[“dfinstaldrive”] = tree.find(‘.\/\/input[@name=”dfinstaldrive”]’).value<\/p>\n <\/a>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 params[“B1″] = tree.find(‘.\/\/input[@name=”B1”]’).value<\/p>\n <\/a><\/a><\/a><\/p>\n <\/a>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #Submission of login request and capturing the session-id<\/p>\n <\/a>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 loginURL = URL + action.replace(“..”,””)<\/p>\n <\/a>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 loginargs = urllib.parse.urlencode(params)<\/p>\n <\/a>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 params = bytes(loginargs, “utf-8”)<\/p>\n <\/a>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 req = urllib.request.Request(loginURL, params)<\/p>\n <\/a>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 response = urllib.request.urlopen(req, context=ctx)<\/p>\n <\/a>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 cookie = response.info()[“Set-Cookie”].split(“;”)[0]<\/p>\n <\/a><\/a><\/a><\/p>\n <\/a>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #Sending request to get forgotpassword mail along with the captured session-id<\/p>\n <\/a>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 forgotURI = “\/servlet\/capexweb.cap_sendMail?dfuserid=admin’&dfpanno=&dfsendmode=EMAIL&x=28&y=14&dfcaller=Actual”<\/p>\n <\/a>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 forgotURL = URL + forgotURI<\/p>\n <\/a>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 req = urllib.request.Request(forgotURL)<\/p>\n <\/a>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 req.add_header(“Cookie”, cookie)<\/p>\n <\/a>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 response = urllib.request.urlopen(req, context=ctx)<\/p>\n <\/a>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 response = str(response.read())<\/p>\n <\/a><\/p>\n <\/a>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if “ORA-01756” in response:<\/p>\n <\/a>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 print(“The {0} is vulnerable”.format(URL))<\/p>\n <\/a>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 else:<\/p>\n <\/a>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 print(“The {0} is not vulnerable”.format(URL))<\/p>\n <\/a>\u00a0\u00a0\u00a0 except urllib.error.URLError as e:<\/p>\n <\/a>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 print(e.reason())<\/p>\n