• Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
AnonyViet - English Version
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
No Result
View All Result
AnonyViet - English Version
No Result
View All Result

Writeup about Dumping Router Firmware room on Tryhackme

AnonyViet by AnonyViet
January 25, 2023
in Security
0

In this article, I will guide you step by step, i.e. from downloading the sample firmware and then analyzing it to find the answer. You can follow along and answer questions here.

Join the channel Telegram of the AnonyViet 👉 Link 👈

A little writeup about Dumping Router Firmware room on Tryhackme

Prepare

The first and foremost thing is to find a router firmware that needs to be analyzed. In this case, we have been provided with the target, so we will download the firmware to the Linux machine.

We need to download the Linksys WRT1900ACS V2 firmware. You can download this firmware here.

Writeup about Dumping Router Firmware room on Tryhackme 22

Once downloaded, you can run the ‘file’ command to search for basic information about the file.

Writeup about Dumping Router Firmware room on Tryhackme 23

We can see that this is ‘u-boot legacy uImage’ and is the firmware of Linksys WRT1900ACS Router based on Linux/ARM.

Now that we’ve finished gathering the basics, we’re ready to go – Authorization. firmware investigation.

Start the investigation

An important tool here is the ‘string’ command. It gives us all the basic (English-accredited) string information it can find in the file’s binary. Run the command and see what we can find.

There are a huge number of strings to be found here, you need to save them to a text file for easier analysis.

Writeup about Dumping Router Firmware room on Tryhackme 24

Use the less command to view the first few lines of the file.

Writeup about Dumping Router Firmware room on Tryhackme 25

The first line needs attention because it gives us information about this firmware and the router on which it was created. Now we will find the operating system. We can print the whole file and search with the ‘grep’ command.

Writeup about Dumping Router Firmware room on Tryhackme 26

Based on the above results, we are definitely Linux operating system. We can see in the image above there are several folders listed.

Writeup about Dumping Router Firmware room on Tryhackme 27

Now we have an overview. We need to unzip the firmware. To extract the firmware, I will use “BinWalk”.

Writeup about Dumping Router Firmware room on Tryhackme 28

We get an error and binwalk cannot extract the file system. This is because binwalk does not support JFFS2. First we need to set it up. Execute the following commands:

sudo pip install cstruct
git clone https://github.com/sviehb/jefferson cd jefferson
python setup.py install

After successful installation let’s run binwalk again and now we can see that binwalk has identified the file system as JFFS2.

Writeup about Dumping Router Firmware room on Tryhackme 29

Now we have a lot of information regarding firmware. Title size, image size, CRC check, last created date, OS details, CPU it runs on, etc.

Binwalk creates a separate directory for the data it extracts.

Writeup about Dumping Router Firmware room on Tryhackme 30

We can see that there is a file showing the JFFS2 filesystem and the other a gzip file. Running the file will output 6870 and no other data. This means that binwalk has misinterpreted the data, we can rerun binwalk on the file to look for other possibilities to try and extract the data in the correct format.

Writeup about Dumping Router Firmware room on Tryhackme 31

We can see that this file contains a copy of a real Linux kernel; binwalk also shows us the version on which this kernel works. We can also see some LZMA compressed data and some cpio cached data.

The next step is to mount the firmware to further analyze this part.

Mounting

First, we need to create a “Block Device”. It can be done using the command:

mknod /dev/mtdblock0 b 31 0

Then we need to create a directory to push our filesystem to with the command:

mkdir /mnt/jffs2_file/

Firmware requires some kernel modules. So we need to load them all to make sure that the filesystem is working properly. You can use the following commands:

modprobe jffs2
modprobe mtdram
modprobe mtdblock

Now we need to write the image to “Block Device” and it can be done with the command:

dd if=/root/Router/600000.jffs2 of=/dev/mtdblock0

Next, we need to mount the filesystem with the command:

mount -t jffs2 /dev/mtdblock0 /mnt/jffs2_file/

Finally, we will access the mounted filesystem with the command:

cd /mnt/jffs2_file/

Once all is done, execute the ls command to display the directories. We just mounted this firmware to local :v.

Writeup about Dumping Router Firmware room on Tryhackme 32

When listing all the files, we can see that some files are being symlinked to other locations. In essence, some files have ‘shortcuts’ to others elsewhere on the file system.

Writeup about Dumping Router Firmware room on Tryhackme 33

In addition, we can see that there are three parent directories associated with the /tmp/ directory. We can also see the /www/ directory, this is where the web application data will be stored.

Take a look in the bin directory:

Writeup about Dumping Router Firmware room on Tryhackme 34

We can see that the database is “sqlite3”.

Now let’s see what’s inside the etc folder.

Writeup about Dumping Router Firmware room on Tryhackme 35

There are a lot of configuration files here, along with a lot of data. Take a look at the thebuilddate. I wonder what this file can do???

Writeup about Dumping Router Firmware room on Tryhackme 36

There are also RSA keys here and we can see that the SSH server being used here is “dropbear”.

Interestingly, there are intermediate server data also displayed here. Further inspection shows that this is from Cisco.

Writeup about Dumping Router Firmware room on Tryhackme 37

Take a look at the other service files for more information regarding the protocols used and their assigned port numbers.

Writeup about Dumping Router Firmware room on Tryhackme 38

There is another file called “system_defaults” which contains all the default settings for the router.

Writeup about Dumping Router Firmware room on Tryhackme 39

There is a file containing the firmware version.

Writeup about Dumping Router Firmware room on Tryhackme 40

There is a folder called JNAP that contains lua scripts. These scripts are used to control the network.

Writeup about Dumping Router Firmware room on Tryhackme 41

This is a very quick summary of router firmware analysis. In addition, you can also see more rooms to practice hacking on tryhackme here.

The article achieved: 5/5 – (100 votes)

Tags: DumpingFirmwareroomRouterTryhackmeWriteup
Previous Post

Lesson 259: Table Styles in Excel

Next Post

Instructions to create a free Windows 11 VPS to experience

AnonyViet

AnonyViet

Related Posts

How to use hackers use Splitfus to execute PowerShell malicious code
Security

How to use hackers use Splitfus to execute PowerShell malicious code

July 20, 2025
How to implement Shellcode Injection attack technique with Autoit
Security

How to implement Shellcode Injection attack technique with Autoit

March 14, 2025
How to exploit the holy hole of Hijacking on Windows
Security

How to exploit the holy hole of Hijacking on Windows

March 8, 2025
Hamamal: Shellcode execution technique from afar to overcome Antivirus's discovery
Security

Hamamal: Shellcode execution technique from afar to overcome Antivirus's discovery

February 10, 2025
Snov.io Email Finder: Search emails with only company name/domain name/LinkedIn profile
Security

Snov.io Email Finder: Search emails with only company name/domain name/LinkedIn profile

December 14, 2024
Capsolver: Automatic solution solution for business
Security

Capsolver: Automatic solution solution for business

December 12, 2024
Next Post
Instructions to create a free Windows 11 VPS to experience

Instructions to create a free Windows 11 VPS to experience

0 0 votes
Article Rating
Subscribe
Login
Notify of
guest

guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

Recent News

Online driving exam preparation: Support theory and practice

Online driving exam preparation: Support theory and practice

August 15, 2025
How to add application to your favorite bar

How to add application to your favorite bar

August 14, 2025
Wowhay.com – The door opens the world of modern knowledge and network culture

Wowhay.com – The door opens the world of modern knowledge and network culture

August 13, 2025
Instructions on how to fix Screen Time Limited Reached on RoBlox

Instructions on how to fix Screen Time Limited Reached on RoBlox

August 13, 2025
Online driving exam preparation: Support theory and practice

Online driving exam preparation: Support theory and practice

August 15, 2025
How to add application to your favorite bar

How to add application to your favorite bar

August 14, 2025
Wowhay.com – The door opens the world of modern knowledge and network culture

Wowhay.com – The door opens the world of modern knowledge and network culture

August 13, 2025
AnonyViet - English Version

AnonyViet

AnonyViet is a website share knowledge that you have never learned in school!

We are ready to welcome your comments, as well as your articles sent to AnonyViet.

Follow Us

Contact:

Email: anonyviet.com[@]gmail.com

Main Website: https://anonyviet.com

Recent News

Online driving exam preparation: Support theory and practice

Online driving exam preparation: Support theory and practice

August 15, 2025
How to add application to your favorite bar

How to add application to your favorite bar

August 14, 2025
  • Home
  • Home 2
  • Home 3
  • Home 4
  • Home 5
  • Home 6
  • Next Dest Page
  • Sample Page

©2024 AnonyVietFor Knowledge kqxs hôm nay xem phim miễn phí mm88 8XBET mm88 trang chủ new88

No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office

©2024 AnonyVietFor Knowledge kqxs hôm nay xem phim miễn phí mm88 8XBET mm88 trang chủ new88

wpDiscuz
0
0
Would love your thoughts, please comment.x
()
x
| Reply