Code Monkey home page Code Monkey logo

Comments (9)

adi0x90 avatar adi0x90 commented on July 22, 2024

Try service postgressql start

from firmware-analysis-toolkit.

ankushgoel27 avatar ankushgoel27 commented on July 22, 2024

i am getting another error now

nter the name or absolute path of the firmware you want to analyse : /root/Downloads/IOT-tools/exercisefiles/firmware
Enter the brand of the firmware : kkeps.bin
/root/Downloads/IOT-tools/exercisefiles/firmware
Now going to extract the firmware. Hold on..
/root/Downloads/IOT-tools/firmadyne/sources/extractor/extractor.py -b kkeps.bin -sql 127.0.0.1 -np -nk "/root/Downloads/IOT-tools/exercisefiles/firmware" images
test
The database ID is 3
test
The database ID is 4
test
The database ID is 5
test
The database ID is 6
test
The database ID is 1
test
The database ID is 7
test
The database ID is 2
test
The database ID is 8
test
The database ID is 9
test
The database ID is 0
test
The database ID is 1
test
The database ID is 2
Getting image type
Traceback (most recent call last):
File "fat.py", line 113, in
main()
File "fat.py", line 105, in main
get_image_type(image_id)
File "fat.py", line 58, in get_image_type
output = subprocess.check_output(get_image_type_command, shell=True)
File "/usr/lib/python2.7/subprocess.py", line 574, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '/root/Downloads/IOT-tools/firmadyne/scripts/getArch.sh ./images/2.tar.gz' returned non-zero exit status 1

from firmware-analysis-toolkit.

ankushgoel27 avatar ankushgoel27 commented on July 22, 2024

i copied the firmadyne.config file into the firmware-analysis-toolkit folder and this error seems to have gone away. however here are few more errors. it seems like its getting the wrong image id.


root@kali:~/Downloads/IOT-tools/firmware-analysis-toolkit# python fat.py

Welcome to the Firmware Analysis Toolkit - v0.1
Offensive IoT Exploitation Training  - http://offensiveiotexploitation.com
By Attify - https://attify.com  | @attifyme

Enter the name or absolute path of the firmware you want to analyse : /root/Downloads/IOT-tools/exercisefiles/firmware/Dlink_firmware.bin
Enter the brand of the firmware : Dlink
/root/Downloads/IOT-tools/exercisefiles/firmware/Dlink_firmware.bin
Now going to extract the firmware. Hold on..
/root/Downloads/IOT-tools/firmadyne/sources/extractor/extractor.py -b Dlink -sql 127.0.0.1 -np -nk "/root/Downloads/IOT-tools/exercisefiles/firmware/Dlink_firmware.bin" images
test
The database ID is 1
Getting image type
Password for user firmadyne:
Found image type of mipsel
Putting information to database
Traceback (most recent call last):
File "/root/Downloads/IOT-tools/firmadyne/scripts/tar2db.py", line 100, in
main()
File "/root/Downloads/IOT-tools/firmadyne/scripts/tar2db.py", line 97, in main
process(iid, infile)
File "/root/Downloads/IOT-tools/firmadyne/scripts/tar2db.py", line 68, in process
(files, links) = getFileHashes(infile)
File "/root/Downloads/IOT-tools/firmadyne/scripts/tar2db.py", line 11, in getFileHashes
t = tarfile.open(infile)
File "/usr/lib/python2.7/tarfile.py", line 1673, in open
return func(name, "r", fileobj, **kwargs)
File "/usr/lib/python2.7/tarfile.py", line 1738, in gzopen
fileobj = gzip.GzipFile(name, mode, compresslevel, fileobj)
File "/usr/lib/python2.7/gzip.py", line 94, in init
fileobj = self.myfileobj = builtin.open(filename, mode or 'rb')
IOError: [Errno 2] No such file or directory: '/root/Downloads/IOT-tools/firmadyne/images/1.tar.gz'
Already done earlier
Creating Image
Executing command

sudo /root/Downloads/IOT-tools/firmadyne/scripts/makeImage.sh 1
Password for user firmadyne:
Please check the makeImage function
Everything is done for the image id 1
Setting up the network connection
Password for user firmadyne:
qemu-system-mipsel: -drive if=ide,format=raw,file=/root/Downloads/IOT-tools/firmadyne/scratch//1//image.raw: Could not open '/root/Downloads/IOT-tools/firmadyne/scratch//1//image.raw': No such file or directory
Traceback (most recent call last):
File "fat.py", line 113, in
main()
File "fat.py", line 108, in main
network_setup(image_id)
File "fat.py", line 83, in network_setup
output = subprocess.check_output(network_cmd, shell=True)
File "/usr/lib/python2.7/subprocess.py", line 574, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command 'sudo /root/Downloads/IOT-tools/firmadyne/scripts/inferNetwork.sh 1' returned non-zero exit status 1

from firmware-analysis-toolkit.

ankushgoel27 avatar ankushgoel27 commented on July 22, 2024

please close this issue. Didnt realize that the fat.py needs to be inside the firmadyne directory.

from firmware-analysis-toolkit.

ankushgoel27 avatar ankushgoel27 commented on July 22, 2024

the script is working fine now but i am not able to reach the ip address generated for the device.
root@kali:~/Downloads/IOT-tools/firmadyne# python fat.py

Welcome to the Firmware Analysis Toolkit - v0.1
Offensive IoT Exploitation Training  - http://offensiveiotexploitation.com
By Attify - https://attify.com  | @attifyme

Enter the name or absolute path of the firmware you want to analyse : /root/Downloads/IOT-tools/exercisefiles/firmware/kkeps.bin
Enter the brand of the firmware : kkeps
/root/Downloads/IOT-tools/exercisefiles/firmware/kkeps.bin
Now going to extract the firmware. Hold on..
/root/Downloads/IOT-tools/firmadyne/sources/extractor/extractor.py -b kkeps -sql 127.0.0.1 -np -nk "/root/Downloads/IOT-tools/exercisefiles/firmware/kkeps.bin" images
test
The database ID is 4
Getting image type
Password for user firmadyne:
Found image type of mipseb
Putting information to database
Tar2DB
Creating Image
Executing command

sudo /root/Downloads/IOT-tools/firmadyne/scripts/makeImage.sh 4
Password for user firmadyne:
mke2fs 1.43.3 (04-Sep-2016)
mknod: /dev/console: File exists
Please check the makeImage function
Everything is done for the image id 4
Setting up the network connection
Password for user firmadyne:
qemu-system-mips: terminating on signal 2 from pid 1957
Querying database for architecture... mipseb
Running firmware 4: terminating after 60 secs...
Bad SWSTYLE=0x04
Inferring network...
Interfaces: [('eth0', '192.168.1.1'), ('br-lan', '192.168.10.253')]
Done!

Running the firmware finally :

Not able to ping or http to either of the addresses above. Please help

from firmware-analysis-toolkit.

ankushgoel27 avatar ankushgoel27 commented on July 22, 2024

and now i am getting this error. LOL
root@kali:~/Downloads/IOT-tools/firmadyne# python fat.py

Welcome to the Firmware Analysis Toolkit - v0.1
Offensive IoT Exploitation Training  - http://offensiveiotexploitation.com
By Attify - https://attify.com  | @attifyme

Enter the name or absolute path of the firmware you want to analyse : /root/Downloads/IOT-tools/exercisefiles/firmware/WNDR4700-V1.0.0.52.zip
Enter the brand of the firmware : wndr
/root/Downloads/IOT-tools/exercisefiles/firmware/WNDR4700-V1.0.0.52.zip
Now going to extract the firmware. Hold on..
/root/Downloads/IOT-tools/firmadyne/sources/extractor/extractor.py -b wndr -sql 127.0.0.1 -np -nk "/root/Downloads/IOT-tools/exercisefiles/firmware/WNDR4700-V1.0.0.52.zip" images
test
The database ID is 1
Getting image type
Password for user firmadyne:
Found image type of mipsel
Putting information to database
Traceback (most recent call last):
File "/root/Downloads/IOT-tools/firmadyne/scripts/tar2db.py", line 100, in
main()
File "/root/Downloads/IOT-tools/firmadyne/scripts/tar2db.py", line 97, in main
process(iid, infile)
File "/root/Downloads/IOT-tools/firmadyne/scripts/tar2db.py", line 77, in process
insertObjectToImage(iid, file2oid, links, cur)
File "/root/Downloads/IOT-tools/firmadyne/scripts/tar2db.py", line 61, in insertObjectToImage
for x in links])
psycopg2.IntegrityError: duplicate key value violates unique constraint "object_to_image_oid_iid_filename_key"
DETAIL: Key (oid, iid, filename)=(1, 1, /bin/echo) already exists.

Already done earlier
Creating Image
Executing command

sudo /root/Downloads/IOT-tools/firmadyne/scripts/makeImage.sh 1
Password for user firmadyne:
mke2fs 1.43.3 (04-Sep-2016)
Please check the makeImage function
Everything is done for the image id 1
Setting up the network connection
Password for user firmadyne:
qemu-system-mipsel: terminating on signal 2 from pid 1846
Querying database for architecture... mipsel
Running firmware 1: terminating after 60 secs...
Inferring network...
Interfaces: [('br0', '192.168.0.1')]
Done!

Running the firmware finally :

from firmware-analysis-toolkit.

adi0x90 avatar adi0x90 commented on July 22, 2024

The above message indicates that there is a conflicting database entry for the same ID. Run reset.sh to clear the database and run the fat.py again.

from firmware-analysis-toolkit.

ankushgoel27 avatar ankushgoel27 commented on July 22, 2024

i did. but i still cant access that IP in the browser.

from firmware-analysis-toolkit.

ankushgoel27 avatar ankushgoel27 commented on July 22, 2024

i think you can close this issue. This is the same one that you closed earlier for kali linux not emulating the Dlink firmware.

from firmware-analysis-toolkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.