FirmAE icon indicating copy to clipboard operation
FirmAE copied to clipboard

extractor.py failed- Issue

Open subhalder opened this issue 3 years ago • 6 comments

During checking emulation using command: sudo ./run.sh -r DCS dcs930l_v108_b4.bin, I'm receiving following error:

[*] dcs930l_v108_b4.bin emulation start!!! Traceback (most recent call last): File "./sources/extractor/extractor.py", line 291, in generate_tag cur.execute("SELECT id FROM brand WHERE name=%s", (brand, )) psycopg2.errors.UndefinedTable: relation "brand" does not exist LINE 1: SELECT id FROM brand WHERE name='DCS' ^

Traceback (most recent call last): File "./sources/extractor/extractor.py", line 366, in update_database "' WHERE id=%s", (self.tag, )) psycopg2.errors.UndefinedTable: relation "image" does not exist LINE 1: UPDATE image SET rootfs_extracted='True' WHERE id='dcs930l_v... ^

[-] extractor.py failed!

Please suggest to avoid the above error.

subhalder avatar May 28 '21 10:05 subhalder

Thank you for your interest!

The second argument of the run.sh script is a lowercased <brand> such as dlink, netgear, etc. (Usage)

Can you check again with the sudo ./run.sh -r dlink dcs930l_v108_b4.bin command?

Thank you!

pr0v3rbs avatar Jun 02 '21 00:06 pr0v3rbs

Hi, Thanks for your reply. I'm still facing the same issue with the command you recommended. Here are the details:

ABCD@sh:~/FirmAE$ sudo ./run.sh -c dlink dcs930l_v108_b4.bin [*] dcs930l_v108_b4.bin emulation start!!! Traceback (most recent call last): File "./sources/extractor/extractor.py", line 291, in generate_tag cur.execute("SELECT id FROM brand WHERE name=%s", (brand, )) psycopg2.errors.UndefinedTable: relation "brand" does not exist LINE 1: SELECT id FROM brand WHERE name='dlink' ^

Traceback (most recent call last): File "./sources/extractor/extractor.py", line 366, in update_database "' WHERE id=%s", (self.tag, )) psycopg2.errors.UndefinedTable: relation "image" does not exist LINE 1: UPDATE image SET rootfs_extracted='True' WHERE id='dcs930l_v... ^

[-] extractor.py failed!

By the way, after downloading the FirmAE_dataset.zip, I have extracted the same and kept in the FirmAE folder under root. FirmAE is containing all the files currently. I am following the steps as described in the installation, usage guidelines. I'm stuck in the 3rd step of Usage. Whether I have to keep dcs930l_v108_b4.bin in root folder or firmware folder. Thanks for your help.

subhalder avatar Jun 06 '21 09:06 subhalder

Sorry for my misunderstood.

I think that the database did not create yet (or broken) in your PostgreSQL. Please check this command install.sh.

Thank you!

pr0v3rbs avatar Jun 06 '21 15:06 pr0v3rbs

Thanks for your response. I have checked the command install.sh. Now, it seems that firmware is emulating. Since last 18 hours, I am receiving following:

subir@sh:~/FirmAE$ sudo ./run.sh -r dlink dcs930l_v108_b4.bin [] dcs930l_v108_b4.bin emulation start!!! [] extract done!!! [] get architecture done!!! mke2fs 1.44.1 (24-Mar-2018) e2fsck 1.44.1 (24-Mar-2018) [] infer network start!!!

[IID] 1 [MODE] run [+] Network reachable on 2.65.87.200! [+] Web service on 2.65.87.200 Creating TAP device tap1_0... Set 'tap1_0' persistent and owned by uid 0 Bringing up TAP device... Starting emulation of firmware... 2.65.87.200 true true 9.211072478 76.772226352

Can you please let me know whether emulation is running in correct direction?

subhalder avatar Jun 08 '21 06:06 subhalder

As you can see from the log, the target firmware was successfully emulated and the connectable network is 2.65.87.200.

After running emulated firmware with run mode. Through the 2.65.87.200 on the host, you can access the services of the target firmware.

pr0v3rbs avatar Jun 14 '21 13:06 pr0v3rbs

image

NHPT avatar Mar 04 '24 10:03 NHPT