Fortify Your MikroTik Router against Hackers with Effective Hardening Techniques

Sdílet
Vložit
  • čas přidán 9. 07. 2024
  • In this video, we're going to show you how to protect your MikroTik router from hackers with device hardening. Device hardening is a great way to protect your router against unauthorized access and attacks.
    By hardening your router, you'll make it difficult for hackers to access your router and steal your data. We'll show you how to do device hardening on your MikroTik router and give you some tips on how to protect your router from Hackers. Be sure to check out this video to learn ways to keep your router safe from hackers!
    👊Thanks for taking time to watch my video. If you could, pressing LIKE and SUBSCRIBING helps more people discover my videos. Feel free to leave a comment for any other topics you would like to see me cover or what your general opinion is of the video.
    🕘Timestamps🕘
    📕00:00 - Introduction
    📕00:29 - Disabling Default Admin account
    📕02:39 - Using Firewall Rules
    📕10:31 - Disable unsecure ports
    📕11:32 - Changing admin ports
    📕14:00 - SSH RSA Keypair
    📕18:12 - Configure a VPN
    📕18:53 - Update Firmware
    Support the Channel:
    ⭐Become a Patreon: / thenetworkberg
    ⭐Become a CZcams Member: / @thenetworkberg
    Social Media:
    🌏 / thenetworkberg
    🌏 / bergnetwork
    🌏 / the-network-berg-39451...
    MTCRE Playlist:
    • Free MTCRE RoSv6
    MTCNA Playlist:
    • Free MTCNA RoSv6
    Credits:
    Thumbnail: Created on Canva
    Intro: Created on Canva
    Music by Alumo
    Songs used:
    Dioitic
    Outland 85
    Music by Bensound.com/free-music-for-videos
    • Bensound: "The Elevato...
    Thanks again for watching

Komentáře • 96

  • @TheNetworkBerg
    @TheNetworkBerg  Před rokem +14

    Hey Guys,
    Are there any other things that you think a person should do that would be considered "Best Practice" when securing your MikroTik device? Feel free to let me know. Below is a list of reference material that you can use with this video to better understand certain topics:
    MT Getting Started:
    czcams.com/video/rwjtRLQjMjA/video.html
    MT Firewall Chains:
    czcams.com/video/NXvHdZbAuTI/video.html
    MT IP Services:
    czcams.com/video/4ukLECgehzY/video.html
    MT RSA Keys:
    czcams.com/video/8tt7fSvdFRM/video.html
    MT VPN Options:
    czcams.com/video/BABdoECvP1I/video.html
    MT Wireguard:
    czcams.com/video/P6f8Qc4EItc/video.html
    MT Zerotier:
    czcams.com/video/eFI59jJ2MM8/video.html

    • @tonygoddard4977
      @tonygoddard4977 Před rokem +2

      For us novices would you be able to do a video that works on the default firewall rules that you get and builds on that?

    • @TheNetworkBerg
      @TheNetworkBerg  Před rokem +2

      @@tonygoddard4977 that's a great idea Tony, I'll add that to my list of videos that I want to make.

  • @patriklindahl4991
    @patriklindahl4991 Před rokem +26

    I have a script that converts firehol level 1 and 2 IP block lists into Mikrotik IP lists. They are automatically updated each night. Then I use those lists to block from WAN. I have also segmented my network into different VLANs depending on what the users/servers/devices they serve. The router have explicit allow rules for the usage each VLAN requires, blocking the rest. My management network is only accessible physically from the locked server room or by a VPN tunnel from selected VLANs. Password manager for passwords. Always password protect keys. Each month I have a reminder to go thru and update the software/firmware on relevant devices.

  • @davidwood1641
    @davidwood1641 Před rokem +1

    Awesome! Super helpful for home users on a budget...

  • @n56241
    @n56241 Před rokem

    Nice vid thanks Mate

  • @maurabbit
    @maurabbit Před rokem +1

    Thanks again buddy, thanks to you i discover version 7, unreal man, thanks very much for all your tips.

  • @Fozzie-Bear
    @Fozzie-Bear Před měsícem

    Thanks for the many videos, certainly making my adventure into Mikrotik a lot easier.

  • @constantin286
    @constantin286 Před rokem +4

    Thank you, as always for another good tutorial. Re: Hardening, you could also consider setting up progressively longer timeouts for failed SSH connection attempts (see mikrotik blog - basically compile failed connection attempt IPs and ban them for longer and longer). That reduces opportunities for brute-forcing. The blog over at Mikrotik also suggests turning off Winbox in production environments, presumably because SSH is a more secure way to administer the gateway. If using the web interface is desirable, then upgrading that to HTTPS and turning off the HTTP option is pretty much a must.

  • @dirkcoduplessis8351
    @dirkcoduplessis8351 Před rokem +15

    As a general rule, use REJECT when you want the other end to know the port is unreachable' use DROP for connections to hosts you don't want people to see.
    Usually, all rules for connections inside your LAN should use REJECT. For the Internet, with the exception of ident on certain servers, connections from the Internet are usually DROPPED.
    Using DROP makes the connection appear to be to an unoccupied IP address. Scanners may choose not to continue scanning addresses which appear unoccupied.

    • @xenonbart5526
      @xenonbart5526 Před 11 měsíci

      while true, scanners being automated may also choose to keep trying, which essential can turn into a DoS attack or DDoS if multiple scanners keep trying.

    • @AlexanderNecheff
      @AlexanderNecheff Před 6 měsíci

      I also like to use DROP on Internet facing firewalls because there is a noticeable performance impact otherwise.

  • @technik4486
    @technik4486 Před rokem

    You are great. Thanks

  • @mrd4233
    @mrd4233 Před rokem +1

    Awesome demo and tips! Your channel and your presentation skills about networking stuff rocks man! Thanks!

    • @TheNetworkBerg
      @TheNetworkBerg  Před rokem +1

      I really appreciate that, thanks for the nice feedback :D!

  • @marjoni
    @marjoni Před rokem +1

    Good job

  • @muhitshalgimbaev6602
    @muhitshalgimbaev6602 Před rokem +1

    Greetings from Kazakhstan👍

  • @w0ble
    @w0ble Před rokem +2

    Good rule of thumb is block everything and allow explicitly only what you need. That way it's visible what has access to what.

  • @pierpaolocarone5783
    @pierpaolocarone5783 Před měsícem +1

    Grazie.

  • @thefixitgal
    @thefixitgal Před rokem +5

    Thank you

    • @TheNetworkBerg
      @TheNetworkBerg  Před rokem +2

      Your MikroTik content is also great Sarah you do a lot more cool "Hands-On" labs and I actually love seeing you do teardowns of the hardware and going through what's ticking inside. But thank you for the nice compliment

    • @drumaddict89
      @drumaddict89 Před rokem

      haha definitely TNB just rocks with his MT videos.

    • @thefixitgal
      @thefixitgal Před rokem

      @@TheNetworkBerg Im no longer posting on Facebook. I hope you can fill the void & start posting your tutorials in the wisp, Fisp groups. There's a lot of new wisp operators lacking understanding. They need someone like you! I just cant operate on there anymore. Its not healthy for me.

    • @TheNetworkBerg
      @TheNetworkBerg  Před rokem

      ​@@thefixitgal I'm not active on any facebook or reddit groups either. I only post on my own page now. What I found when using groups was that my posts would either not get approved or just be seen as spam and receive the most random messages critiquing stuff like my accent.

  • @watangi
    @watangi Před 9 měsíci +1

    Duplicate mac address "phones" for mikrotik active What is the solution, please?

  • @toxmaster1
    @toxmaster1 Před rokem +1

    Nice video, you should make some comments about default mikrotik firewall rules.

  • @cgolebio
    @cgolebio Před rokem +2

    Good video. Have a question… how about physical port security-like if you have security cameras or other fixed hardware you don’t want someone to just unplug a port and plug into just anywhere. Generally I’ve seen MAC binding as something basic even though it can be spoofed it’s at least something… if there are other more secure suggestions that’d be cool to go over as well.

  • @trexx_media
    @trexx_media Před rokem +1

    love from India.....

  • @superworstje
    @superworstje Před rokem

    Hi, Nice video. Can you make a video about further securing your router with management vrf and dedicated management interface? Lot's of bigger mikrotik's have a dedicated management port but are part of the same vrf.

  • @kuroizora8600
    @kuroizora8600 Před rokem

    thank you for your easy explanation.
    may I ask ? if I want to put ids/ips such as pfsense/opnsense should I put it infront of the mikrotik or after the mikrotik? thanks

  • @navigk4404
    @navigk4404 Před 2 měsíci +1

    Thanks!

  • @cybervlado
    @cybervlado Před rokem

    Thank you for all this information that you share. I appreciate this! Can you show how to upgrade packages automatically with some script?

  • @JaZzDeOliveira
    @JaZzDeOliveira Před rokem +1

    Tend to add port knock security to my device for management logins

  • @thenanook
    @thenanook Před 10 měsíci

    awesome video, very easy to follow, thanks

  • @user-bf1cm2jm5h
    @user-bf1cm2jm5h Před 4 měsíci +1

    Good review
    Only one comment - I generally drop the packet, because a reject gives a response which is information.

  • @drumaddict89
    @drumaddict89 Před rokem +1

    very well explained - as always! got to share it to two friends to get a basic grasp of security on MTs
    thanks for the curl tip btw! much appreciated
    PS: could you make an updated video on VRRP on rOS7 maybe?

    • @TheNetworkBerg
      @TheNetworkBerg  Před rokem

      Much appreciated! Will probably revisit VRRP as well :D

    • @drumaddict89
      @drumaddict89 Před rokem

      @@TheNetworkBerg yeah i would love to do it myself but i cannot seem to get eve-ng to run properly. nodes are not starting or when they start they turn off after ~1s

  • @oliverrichardblancofernand5651

    como puedo hacer para q funcione el hotspot con esta configuracion en mikrotik no puedo hacerlo funcionar amigo me sale red no disponible en la señal wifi

  • @MOOOS-REWFEWETRGTEerTGTRGRHRHR

    You can also accept all input from the IPs of MGMT-range, then set another rule to finally drop all remaining packets, without designating any in/out interface.

  • @asarkhan1933
    @asarkhan1933 Před 6 měsíci

    Hlo, I was wondering if you could help me to understand what is split tunneling and how to configure it. Please create one video. I really like your video. And it is very easy for me to understand. Your explaining is very unique.

  • @bartomiejsikora910
    @bartomiejsikora910 Před rokem +1

    We want how to firewall in details. Ty for awesome vids

    • @TheNetworkBerg
      @TheNetworkBerg  Před rokem +4

      I will definitely deep dive specifically more into the Firewall itself and other security features we have available on MikroTik.

  • @perryuploads776
    @perryuploads776 Před rokem +2

    Great video, I have a question though about the firewall rules. in Pfsense you make outbound and inbound rules like RouterOS, but for ICMP you need to make a inbound ICMP rule (for response of echo). On the video you only made a outbound ACL, but the client received a inbound ICMP. how is this possible? only TCP connections are connection oriented, so that would be a statefull firewall, UDP and ICMP doesn't keep track of a connection, it just shoots packets and hope something returns back . For that packet to come back a inbound rule for the ICMP should be made right ? Or is all inbound traffic for ICMP default allowed on Mikrotik ? Thanks again.

    • @TheNetworkBerg
      @TheNetworkBerg  Před rokem +5

      The MikroTik is a stateful firewall, the ICMP Out rule was for traffic leaving from the LAN to the internet which is how I was able to make pings stop and also make them work because the return traffic is automatically being allowed. The Deny rule I added is for traffic from the outside like the internet trying to initiate a connection to the MikroTik on it's "WAN" port.

  • @antoniocerasuolo757
    @antoniocerasuolo757 Před 5 měsíci

    I can understand when you say management range 172.16.0.0/24 which is your LAN is yuour management network but what does it mean when you say management network 192.168.149.0/24 ? does this mean that if you aree also sitting on this network you will be able to access the router? which is probabaly the WAN interface IP LAN?

  • @n56241
    @n56241 Před rokem

    Nice tip for reject ICMP, how to enable ping from Mikrotik, now this rulle ist only allowed to ping from Lan > to internet, but Mikrotik router not allowed to ping from terminal?

  • @johndutt1436
    @johndutt1436 Před rokem +1

    Great video - I disabled all IP Service except Winbox 8291. I allowed only internal LANs to access. However, after doing an NMAP scan externally, I noticed that port 8291 is open externally. Is there a way to shut this off externally but have it accessible internally for Inbox admin? Thanks.

    • @TheNetworkBerg
      @TheNetworkBerg  Před rokem +2

      You could use an input firewall filter rule to drop port 8291 traffic on the incoming WAN port

    • @johndutt1436
      @johndutt1436 Před rokem

      @@TheNetworkBerg Thanks!!!

  • @IG2296
    @IG2296 Před rokem +1

    Like

  • @teacher_bernie
    @teacher_bernie Před 10 měsíci

    just works with ROS 7 ??? NOT FOR PREVIOUS VERSIONS?

  • @didzisuzulins2092
    @didzisuzulins2092 Před 8 měsíci

    There are 2 better ways to copy your ssh public key to remote host.
    1. A Linux command "ssh-copy-id". I haven't tested it with Mikrotik, but it's the correct way to install ssh key to remote hosts ~/.ssh/authorized_keys file.
    2. A Linux command "scp" what is also bundled with "ssh" command on every Linux distro. It works the same way as "ssh" command (most parameters match the parameters of "ssh" command), so you won't have to expose your password on videos.

  • @yuralatala9520
    @yuralatala9520 Před rokem

    Great video as always 🙂
    Just one small problem I'm no savvy when it comes to computers.
    so excuse my lack of knowledge in resolving this problem, I just got the Mikro tik a few days ago and I have a few updates but when I watch and try to apply the updates as you explain it come up with this message (Couldn't perform action - not permitted (9) .
    How do I remove this message so I can update my rooter/WIFI.
    awesome

    • @TheNetworkBerg
      @TheNetworkBerg  Před rokem

      It sounds like the account you use to administrate the device doesn't have sufficient admin privileges, is your account a read/write admin?

    • @yuralatala9520
      @yuralatala9520 Před rokem

      @@TheNetworkBerg Hi Mr. Berg 😁 I have Administrative access only.
      yip I guess I cant really do much, but I do see that there is upgrades available for my Rooter that has not automatically upgraded as of yet.
      Not sure how to change this know.
      Keep up with the awesome job you doing

  • @walden_
    @walden_ Před rokem +1

    Did you cover how to disable any sort of ssh login if the keys don't match? You mentioned that as a possibility, but I don't think it was covered. I love using keys so I don't have to type my password, but keeping people out who don't have the keys would be nice.

    • @TheNetworkBerg
      @TheNetworkBerg  Před rokem

      The method I demonstrated should do this automatically. If anyone without the SSH key tries to SSH onto the router they will not be able to connect. They can type in the username & password (Even with it being correct) and access will be denied.

    • @walden_
      @walden_ Před rokem

      @@TheNetworkBerg Oh ok cool. I'll test it out. Thanks.

  • @Jorvs
    @Jorvs Před rokem

    Do you have a video on dual isp?
    Load balancing, sperate gaming, browsing and downloading?

    • @TheNetworkBerg
      @TheNetworkBerg  Před rokem +1

      I have multi-wan videos, however, I don't think I explicitly have it setup in a way where gaming traffic uses one link and all other normal traffic uses another link. Will add this to my todo list :)!

    • @Jorvs
      @Jorvs Před rokem

      @@TheNetworkBerg Thank you ^_^

  • @DenverRoot
    @DenverRoot Před 10 měsíci

    So many mentions in this video of "in the pinned comment", except there are no pinned comments. ☹
    By sorting the comments by date and then scrolling all the way to the bottom I found the intended comment... could you pin it for easier access? ♥

    • @TheNetworkBerg
      @TheNetworkBerg  Před 10 měsíci +1

      Was sure I did pin the comment, might have unpinned it by accident will definitely update it

  • @FunnyTukums
    @FunnyTukums Před 6 měsíci +1

    Since MTik deplyed Back-To-Home feature (based on Wireguard) there is no reasonable option use another secure access to your Mikrotik

    • @FunnyTukums
      @FunnyTukums Před 6 měsíci

      Wireguard is absolute secure VPN for remote access to the MTik

    • @TheNetworkBerg
      @TheNetworkBerg  Před 6 měsíci +1

      If you plan on creating an access list with wireguard(BTH) being a part of that management list it makes sense to restrict access based off of that it makes complete sense, it does however not invalidate many of the best practices described in this video like upgrading your firmware etc.

    • @FunnyTukums
      @FunnyTukums Před 6 měsíci

      Hackers need to discover IP address and they do not have peer Public Key. And WG presence is not scanable until public key being sent to the peer....

  • @pheaktravlog149
    @pheaktravlog149 Před 7 měsíci

    My Mikrotik has been hacked by someone, they create new user and put my user to read only. They disable all reset. Do you know how to solve.?

    • @TheNetworkBerg
      @TheNetworkBerg  Před 7 měsíci

      Either factory reset by holding down the reset button physically on your MikroTik or use the netinstall tool to completely reload ROS with the default configuration. You will have to reconfigure everything...

  • @warpdag
    @warpdag Před rokem

    Decent start but you left out all the tools still enabled by default, like bandwidth server. Also, stuff like neighbor discovery, it needs to be killed. Or even mac-server, kill it, much cleaner to dedicate one interface to management and bind the associated subnet under services for https-only access (and for that, you need to show how to create a certificate). And so on…
    Security is only as strong as the weakest link

  • @rodrigoroaduterte9415
    @rodrigoroaduterte9415 Před 8 měsíci

    What the sense of creating a new account and disabling the old one when you may just RENAME it?

    • @TheNetworkBerg
      @TheNetworkBerg  Před 8 měsíci

      I guess you could do that, I just prefer having a separate object ID for a user should something weird happen in the event of a firmware upgrade/downgrade.

  • @kevinmiole
    @kevinmiole Před rokem

    Nice tutorial. Then a wifi user shares the wifi password with a QR code. How do we stop that?

  • @9mk
    @9mk Před rokem

    Hello.. How can I know the PIN WPS code of Mikrotik router please

  • @oleksiistri8429
    @oleksiistri8429 Před 5 měsíci

    "legacy IP" sounds funny, considering that 99.9% of internet is still ipv4

  • @jasperwilliams5729
    @jasperwilliams5729 Před 10 měsíci +2

    Excuse me sir, wine is not an emulator 😂

  • @anthonyverwey9684
    @anthonyverwey9684 Před 2 měsíci

    Are you South African by any chance?

    • @TheNetworkBerg
      @TheNetworkBerg  Před 2 měsíci +1

      Yes I'm South African

    • @anthonyverwey9684
      @anthonyverwey9684 Před 2 měsíci

      @@TheNetworkBerg Mooi man! Thought I couldn’t miss the accent. Great channel, btw. 👍🏻 I’ve just started getting into Mikrotik devices and found your content easy to understand, very helpful, thanks.

  • @beyondearth6418
    @beyondearth6418 Před 2 dny

    The most stupid attack vector is to have the Mikrotik webfig username already filled out with "admin". :facepalm: :facepalm: :facepalm: :facepalm: :facepalm: How on earth haven't they removed that by now .... ffs

  • @Anavllama
    @Anavllama Před rokem +1

    I reject (pun intended) your approach on the input chain. Why add the confusion of negative symbol. The best advice, especially for new users, is to state adopt most of the default rules, they are good for many reasons, then add the traffic that should be allowed ( easy to discern ) and then drop all else. So in this case,
    add chain=input action=accept src-address-list=Management where the firewall address list could be comprised of admin IP on any subnet desired, admin IP for the devices on the lans used, could be desktop, laptop, ipad and finally admin IPs for any VPN remote warrior connections coming in. Thus only the admin has full access to the router, heck one could even limit that just to the winbox port........ As for the rest of the lan users ( interface-list=LAN) they need normally simply DNS services (tcp,udp) and perhaps NTP and the last rule should block all else. SImple clean neat, easy conceptually. So forget about complex negatives ( and the use of the ! symbol is not trivial and can have unintended consequences ). I should add if applicable one also adds the ability for any incoming vpn connections to connect to the router services coming in from the WAN side.

  • @webkazan2007
    @webkazan2007 Před rokem

    Ерунда!

    • @TheNetworkBerg
      @TheNetworkBerg  Před rokem

      No? These are pretty much industry standard things to do whenever it comes to security, in most cases the human element is the main culprit :)

  • @qfina
    @qfina Před rokem

    A network router is pronounced roo-ter, not row-ter, thats a woodworking tool.

    • @TheNetworkBerg
      @TheNetworkBerg  Před rokem

      Rooter, rowter, same shit different pronunciations:^) I actually pronounce it both ways depending on my audience, which for the most part on CZcams are based in the US.

    • @chuy8549
      @chuy8549 Před 11 měsíci

      A horse trained for distance races is also called a "roo-ter" you piece of $***!

  • @Anavllama
    @Anavllama Před rokem

    I am not sure I understand the concept or context of what you are doing for forward chain firewall rules. FIrst I dont like any rules that dont have a clear ( from where and going to where ). Ambiguity is NOT a good thing. It also tends to mix up purposes and intent so that the reader is left in the dark and the originator may not understand consequences of open ended rules.
    For example your intent to only allow 80, 443 and 53 makes sense For 80,443 ( LAN TO WAN ) and for 53 ( WHY). THis in effect allows users to use the DNS server of their choice and in terms of security in hardening, its much better to provide that FOR them etc... be it on router services, set in DHCP servers, redirect etc.. DNS is a whole other topic anyway.
    Finally, you have effectively blocked email and telephone services by restricting to the above ports..........
    Once again a clear consistent easy to follow approach leads to good security and understanding of the config. keep the good default rules, add user required traffic, drop all else.
    Nothing wrong with attempting to limit what ports are used outbound but one has to really know what they are doing. Also your open ended rules block users from accessing any servers on other local subnets for example.........

  • @VoklavTube
    @VoklavTube Před rokem +2

    From the change log of ver 7.7:
    ssh - added support for Ed25519 key exchange;
    :O

    • @TheNetworkBerg
      @TheNetworkBerg  Před rokem

      Need to test it out, but would be great if it works.