Jump to content
  • Entries

    16114
  • Comments

    7952
  • Views

    86370074

Contributors to this blog

  • HireHackking 16114

About this blog

Hacking techniques include penetration testing, network security, reverse cracking, malware analysis, vulnerability exploitation, encryption cracking, social engineering, etc., used to identify and fix security flaws in systems.

In this article, we will take a look at Openwrt based on Raspberry Pi 4B. Openwrt is a famous router management system. It is used by many manufacturers due to its open source and third-party compilation advantages.

I happened to have a Raspberry Pi 4B on hand, and I flashed Openwrt to do soft routing. At the same time, try to add various plugins to it.2drq4d2gxpx4244.jpg

Accessories Preparation

Raspberry Pi 4B development board 32G memory card one network cable

Select firmware

Here I am using Lean's Raspberry Pi openwrt firmware.

Author's project address: https://github.com/coolsnowwolf/openwrt

Flash firmware

Open the tool win32, select the firmware and disk location as follows, click Write x2eqnhrnnme4248.jpg

After the write is successful, insert the card into the Raspberry Pi. Start the Raspberry Pi.

Login the background

Connect the Raspberry Pi's network port to your computer with a network cable, and then enter 192.168.1.1 in the browser. If the connection is fine, it will jump directly to the openwrt background interface.

Default username: root

Default login password: password t20bvllht4z4250.jpg

Add interface

Add a wan port, the protocol is DHCP client, check the Ethernet adapter eth0 in the physical settings xfhvqcdeem44251.png

The Advantages of Openwrt

The difference between openwrt and other firmware is that it can install many plug-ins. Such as advertising blocking, cloud disk download acceleration, etc.4y4u3o0efda4253.jpg

Network storage vw41hsqqy3n4254.jpg

Of course, we can also use Nginx and PHP environments on the router. In other words, we can build the router into a small server.

Configure ssh

Why can’t you log in to ssh for your own things? Many router firmware cannot be logged in with ssh, while openwrt is very simple.

Configure ssh vcvwa21xcmi4259.png

Log in ssh izsr5jbjjez4260.png

Build a blog

Modify nginx configuration file

user root root;

worker_processes 1;

pid /var/run/nginx_kodexplorer.pid;

events {

worker_connections 1024;

}

http {

include /etc/nginx/mime.types;

sendfile on;

keepalive_timeout 65;

server {

listen 8081;

server_name localhost;

location/{

root /mnt/www/;

index index.html index.htm index.php;

}

error_page 500 502 503 504 /50x.html;

location=/50x.html {

root html;

}

location ~ \.php$ {

root /mnt/www/;

try_files $uri=404; # PHP file does not exist and returns 404

fastcgi_pass unix:/var/run/php7-fpm.sock; # Execute PHP through Unix sockets

fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # Fix Nginx fastcgi vulnerability

include /etc/nginx/fastcgi_params;

}

}

}

Test probe file

wbftwgkdp304261.png

Installing typecho

In this way, an inconspicuous router is built into a server.