Git Product home page Git Product logo

prosafelinux's Introduction

If your interface is not eth0 please specify it, when you call psl.py.

Examples

Gives an overview of all available options

./psl.py --help

Discover all ProSafe switches on the local network

./psl.py --interface eth1 discover

Set 802.1Q VLAN VID for port 4 to 1

./psl-cli.py  set --passwd "password" --mac B0:B9:8A:57:F6:56 --vlan_pvid 4 1

Query all ports for their 802.1Q VLAN port VID

./psl-cli.py query --mac B0:B9:8A:57:F6:56 vlan_pvid

Help wanted

Im sorry I am not active at this project anymore. It is open-source so perhabs you could find soneone who can help you.

I have found a security problem with this switch and was very disapointed in the answer from netgear. They need more than 6 Month to fix it and want the ethernet adress of it

Because of this, I do not use this switch anymore.

If you can read german, please read this two articles:

http://www.linux-magazin.de/Blogs/Insecurity-Bulletin/Gastbeitrag-Security-by-Obscurity-bei-Netgear-Switches http://www.linux-magazin.de/Ausgaben/2012/10/Switch � Please feel free to fork the code and do any push request.

Please contact me if you like to do the new maintainer of the projekt Sven Anders <[email protected]>

Other similar projects

https://github.com/Z3po/Netgearizer (We are merging code together.)

Authors

  • Asbjørn Sloth Tønnesen
  • Lars Dennis Renneberg Andersen
  • Svenne Krap
  • Shane Kerr
  • Sven Anders

See also: http://git.asbjorn.biz/?p=gs105e.git;a=summary

It would be nice if you pay attribution to this project if you use this code.

If you like the projekt, you may Flattr this git repo

prosafelinux's People

Contributors

danielg avatar hamarituc avatar linas avatar sdegeorgio avatar shane-kerr avatar svanheule avatar svennek avatar tabacha avatar z3po avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

prosafelinux's Issues

Inventory of "set" Commands?

Hi,

maybe I am overseeing it, but is there a psl-cli.py somewhere an option where I can see all possible set commands I can use?

/psl-cli.py --interface enp1s0 query  --mac 22:22:22:22:22:22 vlan_pvid

Query Values..

Vlan_pvid                     Port VLAN_ID
                                 1       1
                                 2       1
                                 3       1
                                 4       1
                                 5       1


works so far so good, but I am very curious about all other configuration options, like IGMP and so on.

Thanks a lot

Cheers

4920441

Timeout too short to discover switches

By default the timeout of 0.005 is too short for my laptop to talk to the switch (GS105E) even when directly connected (i.e. with no other network device between the laptop and the switch):

 % ./psl-cli.py discover
Searching for ProSafe Plus Switches ...

Traceback (most recent call last):
  File "./psl-cli.py", line 191, in <module>
    main()
  File "./psl-cli.py", line 187, in main
    cmd_funcs[args.operation](args, switch)
  File "./psl-cli.py", line 16, in discover
    data = switch.discover()
  File "/home/laurence/Projects/ProSafeLinux/psl_class.py", line 383, in discover
    self.mac_cache[message[self.CMD_MAC]] = message[self.CMD_IP]
TypeError: 'bool' object has no attribute '__getitem__'

Changing the timeout to 0.05 by default, in recv_all, fixes the problem:

 % git diff
diff --git a/psl_class.py b/psl_class.py
index d041630..5157b6a 100644
--- a/psl_class.py
+++ b/psl_class.py
@@ -206,7 +206,7 @@ class ProSafeLinux:
             print("recv=" + message_hex)
         return (message, address)

-    def recv_all(self, maxlen=8192, timeout=0.005):
+    def recv_all(self, maxlen=8192, timeout=0.05):
         "receive all pending packets"
         while True:
             (message, address) = self.recv(maxlen, timeout)

and now:

 % ./psl-cli.py discover
Searching for ProSafe Plus Switches ...

MAC: 28:c6:8e:fb:1d:a4

ip: 192.168.0.105

dhcp: on

name: 

model: GS105E                                  

Could you add an option to specify the timeout as a command line argument? e.g. '--timeout 0.05'?

Many thanks,

Laurence

psl file missing?

Hi

looking into readme

./psl.py --help

where is the file psl.py?

thanks T

Discover Bug

Running the discover command I got this error:
Searching for ProSafe Plus Switches ...

Traceback (most recent call last):
File "./psl-cli.py", line 191, in
main()
File "./psl-cli.py", line 187, in main
cmd_funcs[args.operation](args, switch)
File "./psl-cli.py", line 16, in discover
data = switch.discover()
File "/home/ianm/Downloads/ProSafeLinux-master/psl_class.py", line 383, in discover
self.mac_cache[message[self.CMD_MAC]] = message[self.CMD_IP]
TypeError: 'bool' object has no attribute 'getitem'

I'm using Python 2.7.3 and Fedora 18. This might be user error on my part.

vlan802_id does not work

./psl.py --debug --interface eth1 set --mac e0:46:9a:25:35:9d --passwd password --vlan802_id 15 7 2
Changing Values..

send to ip 255.255.255.255 data = 010100000000000000163e19e1e1e0469a25359d0000021f4e534450000000000004000000060000ffff0000
recv=010200000000000000163e19e1e1e0469a25359d0000021f4e5344500000000000040006e0469a25359d00060004c0a80b74ffff0000
cmd= 4 len= 6 data= e0469a25359d
cmd= 6 len= 4 data= c0a80b74
cmd= 65535 len= 0 data=
Store MAC, IP: e0:46:9a:25:35:9d 192.168.11.116
send to ip 192.168.11.116 data = 010300000000000000163e19e1e1e0469a25359d000002204e53445000000000000a000870617373776f726428000004000f0240ffff0000
recv=010400000000000000163e19e1e1e0469a25359d000002204e53445000000000ffff0000
cmd= 65535 len= 0 data=
{<psl_typ.PslTypEnd instance at 0xd84758>: None,
'ctype': 260,
'flags': 0,
'mymac': '00163e19e1e1',
'seq': 544,
'theirmac': 'e0469a25359d'}
success
sven@xen-sunray:~/ProSafeLinux$ ./psl.py --debug --interface eth1 query --mac e0:46:9a:25:35:9d --passwd password vlan802_id
Query Values..

send to ip 255.255.255.255 data = 010100000000000000163e19e1e1e0469a25359d0000024c4e534450000000000004000000060000ffff0000
recv=010200000000000000163e19e1e1e0469a25359d0000024c4e5344500000000000040006e0469a25359d00060004c0a80b74ffff0000
cmd= 4 len= 6 data= e0469a25359d
cmd= 6 len= 4 data= c0a80b74
cmd= 65535 len= 0 data=
Store MAC, IP: e0:46:9a:25:35:9d 192.168.11.116
send to ip 192.168.11.116 data = 010300000000000000163e19e1e1e0469a25359d0000024d4e53445000000000000a000870617373776f7264ffff0000
recv=010400000000000000163e19e1e1e0469a25359d0000024d4e53445000000000ffff0000
cmd= 65535 len= 0 data=
{<psl_typ.PslTypEnd instance at 0x108a758>: None,
'ctype': 260,
'flags': 0,
'mymac': '00163e19e1e1',
'seq': 589,
'theirmac': 'e0469a25359d'}
success
send to ip 192.168.11.116 data = 010100000000000000163e19e1e1e0469a25359d0000024e4e5344500000000028000000ffff0000
recv=010200000000000000163e19e1e1e0469a25359d0000024e4e53445000000000280000040001e000280000040009000028000004002a00002800000400080100280000040004100028000004000508002800000400060400280000040007020028000004000a00ff28000004000b00ff28000004000f00ffffff0000
cmd= 10240 len= 4 data= 0001e000
cmd= 10240 len= 4 data= 00090000
cmd= 10240 len= 4 data= 002a0000
cmd= 10240 len= 4 data= 00080100
cmd= 10240 len= 4 data= 00041000
cmd= 10240 len= 4 data= 00050800
cmd= 10240 len= 4 data= 00060400
cmd= 10240 len= 4 data= 00070200
cmd= 10240 len= 4 data= 000a00ff
cmd= 10240 len= 4 data= 000b00ff
cmd= 10240 len= 4 data= 000f00ff
cmd= 65535 len= 0 data=
{<psl_typ.PslTypVlan802Id instance at 0x108a1b8>: [{'taged_ports': [1, 2, 3],
'untaged_ports': [],
'vlan_id': 1},
{'taged_ports': [],
'untaged_ports': [],
'vlan_id': 9},
{'taged_ports': [],
'untaged_ports': [],
'vlan_id': 42},
{'taged_ports': [8],
'untaged_ports': [],
'vlan_id': 8},
{'taged_ports': [4],
'untaged_ports': [],
'vlan_id': 4},
{'taged_ports': [5],
'untaged_ports': [],
'vlan_id': 5},
{'taged_ports': [6],
'untaged_ports': [],
'vlan_id': 6},
{'taged_ports': [7],
'untaged_ports': [],
'vlan_id': 7},
{'taged_ports': [],
'untaged_ports': [1,
2,
3,
4,
5,
6,
7,
8],
'vlan_id': 10},
{'taged_ports': [],
'untaged_ports': [1,
2,
3,
4,
5,
6,
7,
8],
'vlan_id': 11},
{'taged_ports': [],
'untaged_ports': [1,
2,
3,
4,
5,
6,
7,
8],
'vlan_id': 15}],
<psl_typ.PslTypEnd instance at 0x108a758>: None,
'ctype': 258,
'flags': 0,
'mymac': '00163e19e1e1',
'seq': 590,
'theirmac': 'e0469a25359d'}
Flags: success
-seq 590
-mymac 00163e19e1e1
-ctype 258
-flags 0
Vlan802_id VLAN_ID Taged-Ports Untaged-Ports
1 1,2,3
9
42
8 8
4 4
5 5
6 6
7 7
10 1,2,3,4,5,6,7,8
11 1,2,3,4,5,6,7,8
15 1,2,3,4,5,6,7,8
-theirmac e0469a25359d

Setting any option fails with "FAILED: Error with password"

Hi,

Using the current ProSafeLinux master branch, I could not set any options on my GS108Ev3 switch. Authentication always failed with the following string:

Changing Values..
using password hack on firmware: 20008
FAILED: Error with password

Digging into the code I found the problem was easily fixed: The incorrect variable “_password” is being used instead of “_plainpass” on line 363 of psl_class.py. This meant an empty password was being used to authenticate with the switch instead of the password passed as a parameter on the command line.

Can someone update the repo? Or provide me access so I can push the update?

Regards,
Stephan.

posibility to set more than one (recuring) option at at time

./psl.py --debug --interface eth1 set --mac e0:46:9a:25:35:9d --passwd password --vlan802_id 1 1,3 2 --vlan802_id 4 4 2 --vlan802_id 5 5 2 --vlan802_id 6 6 2 --vlan802_id 7 7 2 --vlan802_id 8 8 2
Changing Values..

send to ip 255.255.255.255 data = 010100000000000000163e19e1e1e0469a25359d0000042f4e534450000000000004000000060000ffff0000
recv=010200000000000000163e19e1e1e0469a25359d0000042f4e5344500000000000040006e0469a25359d00060004c0a80b74ffff0000
cmd= 4 len= 6 data= e0469a25359d
cmd= 6 len= 4 data= c0a80b74
cmd= 65535 len= 0 data=
Store MAC, IP: e0:46:9a:25:35:9d 192.168.11.116
send to ip 192.168.11.116 data = 010300000000000000163e19e1e1e0469a25359d000004304e53445000000000000a000870617373776f72642800000400080140ffff0000
recv=010400000000000000163e19e1e1e0469a25359d000004304e53445000000000ffff0000
cmd= 65535 len= 0 data=
{<psl_typ.PslTypEnd instance at 0x24967a0>: None,
'ctype': 260,
'flags': 0,
'mymac': '00163e19e1e1',
'seq': 1072,
'theirmac': 'e0469a25359d'}
success

only one switch discovered

if I do a ./psl-cli.py discover only one switch is discovered in a network with multiple GS108Ev2 switches.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.