Koozali.org: home of the SME Server

3306 open?

Offline jameswilson

  • *
  • 833
  • +0/-0
    • Security Warehouse, professional security equipment
3306 open?
« on: March 22, 2026, 07:10:07 PM »
Was just doing some random tests on my 11 b and noticed port 3306 appears to be open. Have i done something wrong?

Offline sages

  • *
  • 194
  • +0/-0
    • http://www.sages.com.au
Re: 3306 open?
« Reply #1 on: March 24, 2026, 02:13:51 AM »
tcp and/or udp?  3306 used by mysql (or mariadb)
open to where? internet, private network?
server only, server gateway?
we don't know what you have or haven't done
more clues could narrow the hunt for answers
« Last Edit: March 24, 2026, 02:16:30 AM by sages »
...

Offline Gary Douglas

  • ****
  • 83
  • +1/-0
Re: 3306 open?
« Reply #2 on: March 24, 2026, 10:09:29 AM »

Offline jameswilson

  • *
  • 833
  • +0/-0
    • Security Warehouse, professional security equipment
Re: 3306 open?
« Reply #3 on: March 25, 2026, 06:09:55 PM »
tcp and/or udp?  3306 used by mysql (or mariadb)
open to where? internet, private network?
server only, server gateway?
we don't know what you have or haven't done
more clues could narrow the hunt for answers
I havnt chnaged the localnetworking option or added any other mysqls.
Server gateway open on tcp on the internet

Discovered ip and port:

81.143.33.107 (25, 80, 143, 443, 465, 556, 587, 993, 3306)



Offline ReetP

  • *
  • 4,049
  • +6/-0
Re: 3306 open?
« Reply #4 on: March 26, 2026, 12:00:08 AM »
Pretty sure it shouldn't be open by default.

Setting LocalNetworking is only to use a local port instead of a socket.

It shouldn't enable it publicly.

What does this show?

Code: [Select]
config show mariadb
Also

Code: [Select]
grep 3306 /etc/rc.d/init.d/masq
Also what is 556 and why is it open?
« Last Edit: March 26, 2026, 12:02:29 AM by ReetP »
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline ReetP

  • *
  • 4,049
  • +6/-0
Re: 3306 open?
« Reply #5 on: March 26, 2026, 12:27:34 AM »
FWIW I just tested on my v11 box in s/g

nmap -p 3306 www.myserver.com

Starting Nmap 7.92 ( https://nmap.org ) at 2026-03-26 00:23
CET
Nmap scan report for www.reetspetit.com (212.83.164.72)
Host is up (0.035s latency).

PORT     STATE    SERVICE
3306/tcp filtered mysql

Nmap done: 1 IP address (1 host up) scanned in 1.40 seconds

So it is closed my default.

Need to see the previously requested data.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline jameswilson

  • *
  • 833
  • +0/-0
    • Security Warehouse, professional security equipment
Re: 3306 open?
« Reply #6 on: March 26, 2026, 06:56:36 PM »
Hi Reetp
Pretty sure it shouldn't be open by default.

Setting LocalNetworking is only to use a local port instead of a socket.

It shouldn't enable it publicly.

What does this show?

Code: [Select]
config show mariadb
Also

Code: [Select]
grep 3306 /etc/rc.d/init.d/masq
Also what is 556 and why is it open?
Code: [Select]
[root@smebox ~]# config show mariadb
mariadb=service
    LocalNetworkingOnly=no
    TCPPort=3306
    access=public
    status=enabled
[root@smebox ~]#

556 is an rtsp port forward to allow my home assitant to see work cameras at home

Code: [Select]
[root@smebox ~]# grep 3306 /etc/rc.d/init.d/masq
    # mariadb: TCPPorts: 3306, AllowHosts: 0.0.0.0/0, DenyHosts:
    /sbin/iptables -A $NEW_InboundTCP --proto tcp --dport 3306 \
[root@smebox ~]#



Offline jameswilson

  • *
  • 833
  • +0/-0
    • Security Warehouse, professional security equipment
Re: 3306 open?
« Reply #7 on: March 26, 2026, 06:59:45 PM »
I can see that public access is turned on. Im guessing this is what needs to be turned off?

I have added phpmyadmin but dont need access to the database on a port number for anything iirc

Offline ReetP

  • *
  • 4,049
  • +6/-0
Re: 3306 open?
« Reply #8 on: March 26, 2026, 07:32:03 PM »
I can see that public access is turned on. Im guessing this is what needs to be turned off?

Absolutely. Immediately. That is non standard and self-inflicted.

...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline jameswilson

  • *
  • 833
  • +0/-0
    • Security Warehouse, professional security equipment
Re: 3306 open?
« Reply #9 on: March 27, 2026, 02:42:28 PM »
Absolutely. Immediately. That is non standard and self-inflicted.

I wonder if this was restored from the backup / restore and i enabled this on the previous server without understanding what i was doing back then?

Is the command needed this

Code: [Select]
config set mariadb service access private status enabled TCPPort 3306

Offline ReetP

  • *
  • 4,049
  • +6/-0
Re: 3306 open?
« Reply #10 on: March 27, 2026, 04:36:44 PM »
I wonder if this was restored from the backup / restore and i enabled this on the previous server without understanding what i was doing back then?

Sounds about right  :lol:

Just this either - set it private or remove the key altogether. If the firewall template sees it public it will open a port.

Code: [Select]
config setprop mariadb access private

or

Code: [Select]
config delprop mariadb access

And then

Code: [Select]
signal-event remoteaccess-update

Argument to be had that it should have a TCPPort property, and need both 'public' AND 'port' correctly set to be open - some may have an obscure reason for doing so.
« Last Edit: March 27, 2026, 08:22:13 PM by ReetP »
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline jameswilson

  • *
  • 833
  • +0/-0
    • Security Warehouse, professional security equipment
Re: 3306 open?
« Reply #11 on: March 27, 2026, 07:47:57 PM »
Super Thankyou very Much!

Offline ReetP

  • *
  • 4,049
  • +6/-0
Re: 3306 open?
« Reply #12 on: March 27, 2026, 08:23:24 PM »
Super Thankyou very Much!

NP - note the slight modification I made above. Remove the incorrect word 'service'

Don't do it again ;-)
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline Jean-Philippe Pialasse

  • *
  • 2,978
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: 3306 open?
« Reply #13 on: March 28, 2026, 07:04:01 PM »
default is no network port is used.
default is TCPPort empty
default is access empty meaning localhost only

 
so default is only localhost unix socket used.
so you both enabled usage of port and set public access at one point. 

config delprop mariadb TCPPort access

unless you know you have something only able to access with tcp port to mysql and unable to access to unix socket, you should also do

config setprop mariadb LocalNetworkingOnly yes

the
signal-event smeserver-mysql-update

Offline jameswilson

  • *
  • 833
  • +0/-0
    • Security Warehouse, professional security equipment
Re: 3306 open?
« Reply #14 on: March 30, 2026, 07:25:26 PM »
I obviously did it on the old server and that setting was restored from the backup

Is there any way to check if any settings are different from default?

Offline Jean-Philippe Pialasse

  • *
  • 2,978
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: 3306 open?
« Reply #15 on: April 10, 2026, 06:43:56 AM »
no easy way. 
but it would be a nice nfr for audittools

Offline jameswilson

  • *
  • 833
  • +0/-0
    • Security Warehouse, professional security equipment
Re: 3306 open?
« Reply #16 on: April 13, 2026, 06:35:38 PM »
ok thanks

Offline ReetP

  • *
  • 4,049
  • +6/-0
Re: 3306 open?
« Reply #17 on: April 13, 2026, 06:42:53 PM »
no easy way. 
but it would be a nice nfr for audittools

ok thanks

You can open one..... :-)
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation