cisco

C# - How to chceck if external firewall is enabled?

好久不见. 提交于 2019-11-29 12:32:01
We want to use Cisco NAC and need to check if client Desktop has a firewall installed. This may be not the default Windows Firewall. Is there some Windows registry key that can be checked? For non-Windows firewalls, you can use WMI API to detect the presence of a firewall if it's registered with Windows. Namespace = "Root\SecurityCenter2" (might be "Root\SecurityCenter" on pre-vista) Query = "SELECT * From FirewallProduct" And you can use this little gem to detect if it's actually on or off. For Windows Firewall detection, it's INetFwMgr and friends. Maybe just check if you can establish

Persistent ssh session to Cisco router

蹲街弑〆低调 提交于 2019-11-29 09:24:10
问题 I have search on this site and multiple other locations but I have been unable to resolve my problem of connecting and maintaining ssh session after one command. Below is my current code: #!/opt/local/bin/python import os import pexpect import paramiko import hashlib import StringIO while True: cisco_cmd = raw_input("Enter cisco router cmd:") ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect('192.168.221.235', username='nuts', password='cisco',

Connecting to a VPN without installation of client software

两盒软妹~` 提交于 2019-11-28 20:48:15
I must sometimes write software to establish a socket with a particular server residing within a Cisco VPN. I simply write my software as if there were no VPN (making use of the standard sockets library). When it is time to run this program, I manually connect to the VPN using the client software installed on my computer, then run the program itself. However, it would be desirable to write the software to take advantage of a specialized socket library capable of communicating over the VPN directly, without the use of any installed client software. Here is some Java code illustrating the

Paramiko session times out, but i need to execute a lot of commands

我怕爱的太早我们不能终老 提交于 2019-11-28 12:39:35
问题 I'm working on a script (python 2.7) that is wotking with a remote device running Cisco IOS, so I need to execute a lot of commands through ssh. Few commands have no output and some of them have, and I want to recieve the output. It goes something like this: import paramiko ssh=paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect(self._ip, port=22, username=username, password=password stdin, stdout, stderr = ssh.exec_command('command with no output')

C# - How to chceck if external firewall is enabled?

我怕爱的太早我们不能终老 提交于 2019-11-28 06:19:26
问题 We want to use Cisco NAC and need to check if client Desktop has a firewall installed. This may be not the default Windows Firewall. Is there some Windows registry key that can be checked? 回答1: For non-Windows firewalls, you can use WMI API to detect the presence of a firewall if it's registered with Windows. Namespace = "Root\SecurityCenter2" (might be "Root\SecurityCenter" on pre-vista) Query = "SELECT * From FirewallProduct" And you can use this little gem to detect if it's actually on or

Providing input/subcommands to command executed over SSH with JSch

末鹿安然 提交于 2019-11-26 15:33:12
I'm trying to manage router via Java application using Jcraft Jsch library. I'm trying to send Router Config via TFTP server. The problem is in my Java code because this works with PuTTY. This my Java code: int port=22; String name ="R1"; String ip ="192.168.18.100"; String password ="root"; JSch jsch = new JSch(); Session session = jsch.getSession(name, ip, port); session.setPassword(password); session.setConfig("StrictHostKeyChecking", "no"); System.out.println("Establishing Connection..."); session.connect(); System.out.println("Connection established."); ChannelExec channelExec =

ssl.SSLError: tlsv1 alert protocol version

99封情书 提交于 2019-11-26 14:39:09
I'm using the REST API for a Cisco CMX device , and trying to write Python code which makes a GET request to the API for information. The code is as follows and is the same as that in the file except with the necessary information changed. from http.client import HTTPSConnection from base64 import b64encode # Create HTTPS connection c = HTTPSConnection("0.0.0.0") # encode as Base64 # decode to ascii (python3 stores as byte string, need to pass as ascii value for auth) username_password = b64encode(b"admin:password").decode("ascii") headers = {'Authorization': 'Basic {0}'.format(username

Providing input/subcommands to command executed over SSH with JSch

别等时光非礼了梦想. 提交于 2019-11-26 04:28:19
问题 I\'m trying to manage router via Java application using Jcraft Jsch library. I\'m trying to send Router Config via TFTP server. The problem is in my Java code because this works with PuTTY. This my Java code: int port=22; String name =\"R1\"; String ip =\"192.168.18.100\"; String password =\"root\"; JSch jsch = new JSch(); Session session = jsch.getSession(name, ip, port); session.setPassword(password); session.setConfig(\"StrictHostKeyChecking\", \"no\"); System.out.println(\"Establishing

ssl.SSLError: tlsv1 alert protocol version

 ̄綄美尐妖づ 提交于 2019-11-26 03:43:58
问题 I\'m using the REST API for a Cisco CMX device, and trying to write Python code which makes a GET request to the API for information. The code is as follows and is the same as that in the file except with the necessary information changed. from http.client import HTTPSConnection from base64 import b64encode # Create HTTPS connection c = HTTPSConnection(\"0.0.0.0\") # encode as Base64 # decode to ascii (python3 stores as byte string, need to pass as ascii value for auth) username_password =