Closed kxynos closed 4 years ago
of coz, without the multithread it will fail,
ur script seems ok, u migh wanna playaround with mmap_start = 0x7ffee000 - 0x800000
Is the problem with the current version of the Qiling framework or something else ? Cause I see you have many examples of router firmware running in Qiling framework on youtube, but I am unable to get any of them to work. I am getting the same issue with all of them.
"unicorn.unicorn.UcError: Invalid memory write (UC_ERR_WRITE_UNMAPPED)"
I changed to root (i.e., sudo su) and the webserver by Netgear is not crashing.
that is a generic error msg, you need to find out what is the issue.
This is the same issue as #194 #175 #164
actually is not. but please disasm and you will be able to see more details
Hi again,
I look thru your github repo and found this
https://github.com/qilingframework/qiling/issues/223
I used your link and downloaded the firmware. And this is what happen,
You can see, most of the needed folder are missing, and most of it hide under /usr. what you need to do is some tweak.
so it will be more or less like this
![image](https://user-images.githubusercontent.com/463553/79179948-5a37d480-7e3b-11ea-98e2-c398afbbcb60.png)
Then once you start the run the scipt agaim, you will get the 404, that means the server is up and file missing.
Now you need to check why it sent missing.
Its kind of clear lots of file is missing.
I will not be able to make a details tutorial based on all router or even this R6220. It seems all these router change everytime they push a new version
Spend some time to debug, you will be able to get there.
@kxynos it looks like an opportunity for you to contribute to the Qiling project. This would be a good example to have as part of our examples collection.
As long as we know that it is not a framework issue, that is great. Then we can start tracing the applications to see why they are causing a crash.
I have managed to document, in a detailed post, of how to get mini_http from Netgear R6220 (V1.1.0.86) up and running. Details can be found here: https://github.com/kxynos/embedded_hacking/blob/master/firmware/Netgear-R6220.md
nice! should not be that hard to get it working. either some cgi issue or some missing link
So, disable debug from your script, you can see setup.cgi should be in /setup.cgi from here you need to debug setup.cgi.
or run setup.cgi and not mini_http to find out the issue.
By moving the print statement in execve, in my PR, it is now showing in the logs. :-)
execve(www/setup.cgi, [www/setup.cgi], [PATH=./, LD_LIBRARY_PATH=/lib:/usr/local/lib:/usr/lib, SERVER_SOFTWARE=, SERVER_NAME=ql_vm, GATEWAY_INTERFACE=CGI/1.1, SERVER_PROTOCOL=HTTP/1.0, SERVER_PORT=80, REQUEST_METHOD=GET, SCRIPT_NAME=/setup.cgi, REMOTE_ADDR=1.0.0.127, HTTP_USER_AGENT=Mozilla/5.0, HTTP_ACCEPT_LANGUAGE=en-US,en;q=0.5, HOST=127.0.0.1, LOGIN_IP=, NEED_AUTH=1])
I downloaded the most recent Netgear R6220 firmware (V1.1.0.86) and attempted to replicate example netgear_6220_mips32el_linux.py. Note: I had the same issues with version V1.0.0.14.
I only tweaked the paths in netgear_6220_mips32el_linux.py and copied some files around to get it to load correctly.
The script I used:
When I execute the python script I get the following crash and trace, when I visit the page http://127.0.0.1:8080:
N.B.: If you execute the script without setting multithreading to True then you will get the following error.