pfSense Gold Subscription

Author Topic: TP-Link Easy Smart Switch security question  (Read 8064 times)

haleakalas and 2 Guests are viewing this topic.

Offline lexxai

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-1
    • View Profile
    • We have what we have. Everything that happens - for the better. [lexxai]
Re: TP-Link Easy Smart Switch security question
« Reply #75 on: November 10, 2017, 07:43:07 pm »
Some analyze information about apply this method to TL-SG1016DE (HW:2)

vlan:777,port: 5tag, name: TESTVVV
777 = 0x0309 (0x09 0x03)
5 =  0x10  (0001 0000) 5 bit.



vlan:777,port: 5untag, name: TESTVVV
777 = 0x0309 (0x09 0x03)
5 =  0x10  (0001 0000) 5 bit.



source: http://lexxai.pp.ua

Offline thuety

  • Newbie
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
    • cellarcinama
Re: TP-Link Easy Smart Switch security question
« Reply #76 on: November 11, 2017, 03:45:45 am »
Here is how you can hack ( un-member ports on vlan1).  I have already tested on the SG108PE (hw version 3) switch and it worked.

Worked on my TL-SG108E 2.0, thanks!
Why didn't I think of this...  ::)

« Last Edit: November 11, 2017, 03:40:02 pm by thuety »

Offline JKnott

  • Hero Member
  • *****
  • Posts: 895
  • Karma: +29/-4
    • View Profile
Re: TP-Link Easy Smart Switch security question
« Reply #77 on: November 11, 2017, 02:28:40 pm »
Quote
Were you able to see the port assignment changed in step# 5?

No, there was very little recognizable text in the hex editor.  I did not see the word "Default", as shown in lexxai's post.

Quote
The only thing I saw strange was that the switch's IP address is a member of all vlans.  If I were to change my PC's IP address to the same subnet of the switch, I could communicate to it on non-native vlan, which is kinda weird.

On managed switches I've worked on, there was a specific management interface, which was assigned an IP address.  I've also set up networks where the management interface was on a separate VLAN.
« Last Edit: November 11, 2017, 02:34:54 pm by JKnott »

Offline thuety

  • Newbie
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
    • cellarcinama
Re: TP-Link Easy Smart Switch security question
« Reply #78 on: November 11, 2017, 03:50:02 pm »

Quote
The only thing I saw strange was that the switch's IP address is a member of all vlans.  If I were to change my PC's IP address to the same subnet of the switch, I could communicate to it on non-native vlan, which is kinda weird.

On managed switches I've worked on, there was a specific management interface, which was assigned an IP address.  I've also set up networks where the management interface was on a separate VLAN.

Even after setting the VLAN 1 membership to port 8 only... I can still connect a client to any switch port, set the IP to the same subnet and then access the switch web login.
So the VLAN 1 has no relevance for web admin access... I guess we can kill all VLAN 1 membership with the HEX hack..!?

Offline stephenw10

  • Administrator
  • Hero Member
  • *****
  • Posts: 11869
  • Karma: +458/-15
    • View Profile
Re: TP-Link Easy Smart Switch security question
« Reply #79 on: November 12, 2017, 08:44:28 am »
Hmm, well this is interesting. Implies it's a gui limitation only.

The exact string Default_VLAN does not appear in the config from a TL-SG1016DE v1. Not quite the same as the v2 either. Some experimentation needed....

Steve

Offline tpham3783

  • Newbie
  • *
  • Posts: 6
  • Karma: +5/-0
    • View Profile
Re: TP-Link Easy Smart Switch security question
« Reply #80 on: November 12, 2017, 09:05:22 am »
Even after setting the VLAN 1 membership to port 8 only... I can still connect a client to any switch port, set the IP to the same subnet and then access the switch web login.
So the VLAN 1 has no relevance for web admin access... I guess we can kill all VLAN 1 membership with the HEX hack..!?

I saw that too.  It looks like the switch (management IP) is a member of all vlans, and that the gui an be accessed from any access-ports.  However, the gui can not be accessed on a trunk port (tagged port), unless you configure another vlan w/ the trunk port configured as untagged port.  Attached is a picture of my improved config where I ended up removing all ports from vlan1. 


Although I can access the swith's management interface on any access-ports (untagged ports), I can not access PCs that belong on another VLAN.  Would you please confirm that's what you're seeing too?  thanks





Offline tpham3783

  • Newbie
  • *
  • Posts: 6
  • Karma: +5/-0
    • View Profile
Re: TP-Link Easy Smart Switch security question
« Reply #81 on: November 12, 2017, 09:23:57 am »
Hmm, well this is interesting. Implies it's a gui limitation only.

The exact string Default_VLAN does not appear in the config from a TL-SG1016DE v1. Not quite the same as the v2 either. Some experimentation needed....

Steve

yeah, keep on working at it.  I'd create one vlan (ie. vlan 2) with all ports as untagged member, save the config.  Then generate a second config with the last port removed from the vlan.  Diff the two files ie:

   hexdump -C config.cfg.original > /tmp/config.cfg.original.hex # vlan2 w/ all ports
   hexdump -C config.cfg > /tmp/config.cfg.hex   # vlan2 w/ all ports but the last port

   diff -urN /tmp/config.cfg.original.hex /tmp/config.cfg.hex

Then you would have a good idea where the vlan config token is set.


Offline ecfx

  • Full Member
  • ***
  • Posts: 221
  • Karma: +28/-11
    • View Profile
Re: TP-Link Easy Smart Switch security question
« Reply #82 on: November 12, 2017, 09:55:34 am »
Sg108E: at least in GUI I deleted default vlan 1.

Offline stephenw10

  • Administrator
  • Hero Member
  • *****
  • Posts: 11869
  • Karma: +458/-15
    • View Profile
Re: TP-Link Easy Smart Switch security question
« Reply #83 on: November 12, 2017, 09:56:15 am »
Seems to have some file validation/checksum that prevents uploading a modified file.... no one else seeing that? I'd be surprised if they actually removed that from the v2.

Steve

Offline ecfx

  • Full Member
  • ***
  • Posts: 221
  • Karma: +28/-11
    • View Profile
Re: TP-Link Easy Smart Switch security question
« Reply #84 on: November 12, 2017, 10:02:22 am »
Tested and NO checksum for:
Firmware Version    1.0.2 Build 20160526 Rel.34615
Hardware Version    TL-SG108E 2.0

Offline stephenw10

  • Administrator
  • Hero Member
  • *****
  • Posts: 11869
  • Karma: +458/-15
    • View Profile
Re: TP-Link Easy Smart Switch security question
« Reply #85 on: November 12, 2017, 10:21:16 am »
Hmm, using:

Quote
Firmware Version    1.0.1 Build 20131023 Rel.33236
Hardware Version    TL-SG1016DE 1.0

Refuses any edited config
Quote
Invalid config file! Please double check!

Yet lexxai seems to be good on his 1016DEv2....

Steve

Offline jahonix

  • Hero Member
  • *****
  • Posts: 2403
  • Karma: +144/-14
  • volunteer since 2006
    • View Profile
Re: TP-Link Easy Smart Switch security question
« Reply #86 on: November 12, 2017, 10:57:26 am »
Check if there's a checksum or such yourself?

a) save config_1
b) change something small like hostname one character from lower to upper case. Don't change length.
c) save config_2
d) diff config_1 and config_2

e) report result.
Chris

The issue with IPv6 jokes is that almost no one understands them and no one is using them yet.

Offline stephenw10

  • Administrator
  • Hero Member
  • *****
  • Posts: 11869
  • Karma: +458/-15
    • View Profile
Re: TP-Link Easy Smart Switch security question
« Reply #87 on: November 12, 2017, 12:19:53 pm »
Speculating....

The things that change other than the config change are the password seems to be re-hashed and stored twice. And at the begging of the file there is a 16bit value that changes. I'd bet that's a 16bit checksum but of what exactly I'm not sure. Or what algorithm... Not found a match so far.

Steve

Offline JKnott

  • Hero Member
  • *****
  • Posts: 895
  • Karma: +29/-4
    • View Profile
Re: TP-Link Easy Smart Switch security question
« Reply #88 on: November 12, 2017, 12:45:32 pm »
Quote
I can not access PCs that belong on another VLAN.  Would you please confirm that's what you're seeing too?

That's how VLANs are supposed to work, as though each VLAN is on a separate switch.  It's the accessing the management from any VLAN that's messed up.  It should be possible to have the management on it's own VLAN, unreachable from any other.

Offline tpham3783

  • Newbie
  • *
  • Posts: 6
  • Karma: +5/-0
    • View Profile
Re: TP-Link Easy Smart Switch security question
« Reply #89 on: November 12, 2017, 05:44:14 pm »
Sg108E: at least in GUI I deleted default vlan 1.

Good find! 

I've always thought they implemented a front-end logic (webpage) for first vlan to be non-editable; hence you must have the first vlan as a place holder!

Thanks!