web_snmpv3_remote_engineId_add_post_remote_ip
web_snmpv3_remote_engineId_add_post_remote_ip
During my internship at Qi An Xin Tiangong Lab, I discovered a stack overflow vulnerability in the Planet router.
By analyzing the dispatcher file in the bin directory, I found that the function web_snmpv3_remote_engineId_add_post contains a stack overflow vulnerability.
The stack overflow can be triggered by remote_ip value, which leads to a memcpy stack overflow.
In the main function, there is an account authentication detection. We create a cookie_0 in the tmp directory, with the content of “20 0 0”, and its function is to create a cookie with sufficient permissions to access this route.
1 |
|
Through IDA, it can be seen that the stack space is 0x178
The content of the poc.py file is as follows:
1 |
|
Through the above image, we can see that we have overflowed to 0x260 and successfully hijacked the control flow. If necessary, more can be overflowed.