Check open TCP/UDP ports with SNMP - tcp

I need to find an OID that can be used with "snmpwalk" that describes which TCP/UDP ports that are open and available on my machine (localhost)
A similar post(here) about this was to use:
snmpwalk -v2c -c public localhost tcpConnState
snmpwalk -v2c -c public localhost udpLocalAddress
But as i understand it this only show open connections right now?
Anyhow my lab was corrected wrong for using these ones.
Is there any other OID that can show available TCP/UDP ports?
(I am using terminal in Ubuntu)

Here you go!
snmpwalk -v2c -c public localhost tcpConnLocalPort
snmpwalk -v2c -c public localhost1.3.6.1.2.1.6.13.1.3
snmpwalk -v2c -c public localhost udpLocalPort
snmpwalk -v2c -c public localhost 1.3.6.1.2.1.7.5.1.2

Related

How to configure the bridge connection in linux

Can someone help me how to configure bridge connection in linux and what are the command that being use.
I do really appreciate your help!
I am new Debian Linux user. I want to setup Bridge for virtualised environments (KVM) running on Debian Linux.
By default, a private network bridge created when using Kernel-based Virtual Machine(KVM). You need to set up interfaces manually, avoiding conflicts with, network manager.If you want to assign IP addresses to your virtual machines and make them accessible from your LAN you need to setup network bridge.
The procedure to configure network bridge on Debian Linux is as follows:
Just use the ip command:
$ ip -f inet a s
$ cat /etc/network/interfaces
$ sudo vi /etc/network/interfaces.d/br0
$ sudo systemctl restart network-manager
$ ip a s
$ ip r
$ ping -c 2 cyberciti.biz
$ brctl show
$ bridge link

windows 10 bash tcpdump: socket: Invalid argument

I am using windows 10 bash to use tcpdump
From tutorial i found that to listen to a interface command is:
tcpdump -i eth0 //eth0 is ethernet interface
tcpdump -i any // to listen to any interface
In both cases I am getting tcpdump: socket: Invalid argument error.
NOTE:
tcpdump -D
does not print anything on console.
Based on https://github.com/Microsoft/WSL/issues/69, this is a limitation of the current Windows Subsystem for Linux. The Fall Creators update added a lot of functionality, but tcpdump still does not work.
Try nmap. It will output a page of errors but eventually works.
sudo nmap -sP 192.168.1.0/24
WSL, while utilizing Linux, is not a "true" Linux based operating system yet.

Need to Run batch script in UNIX server and display the output through vbscript

I am currently developing the new VBScript to execute the Shell (through Putty software) in UNIX server,
Set shell = WScript.CreateObject("WScript.Shell")
shell.Exec D:\Putty.exe hostname -l username -pw password 1.sh
I am getting connection refused error.
when I run the below command without my script (1.sh)
shell.Exec D:\Putty.exe hostname -l username -pw password
Connection is getting established without any issues.
Also, I just wanted to extract the output, once extracted, the session should get closed automatically.
This doesn't work in putty.exe. Putty has however a dedicated program to do these kind of things, it's called plink.exe - there you can pass commands and read the output just as you would expect, and your example should work just like you specified it.
PuTTY Link: command-line connection utility
Release 0.63
Usage: plink [options] [user#]host [command]
("host" can also be a PuTTY saved session name)
Options:
-V print version information and exit
-pgpfp print PGP key fingerprints and exit
-v show verbose messages
-load sessname Load settings from saved session
-ssh -telnet -rlogin -raw -serial
force use of a particular protocol
-P port connect to specified port
-l user connect with specified username
-batch disable all interactive prompts
The following options only apply to SSH connections:
-pw passw login with specified password
-D [listen-IP:]listen-port
Dynamic SOCKS-based port forwarding
-L [listen-IP:]listen-port:host:port
Forward local port to remote address
-R [listen-IP:]listen-port:host:port
Forward remote port to local address
-X -x enable / disable X11 forwarding
-A -a enable / disable agent forwarding
-t -T enable / disable pty allocation
-1 -2 force use of particular protocol version
-4 -6 force use of IPv4 or IPv6
-C enable compression
-i key private key file for authentication
-noagent disable use of Pageant
-agent enable use of Pageant
-m file read remote command(s) from file
-s remote command is an SSH subsystem (SSH-2 only)
-N don't start a shell/command (SSH-2 only)
-nc host:port
open tunnel in place of session (SSH-2 only)
-sercfg configuration-string (e.g. 19200,8,n,1,X)
Specify the serial configuration (serial only)

snmpwalk doesnt work on net-snmp altho snmpget works

I am trying to monitor a system with net-snmp, and I am using my own MIB.
i added the needed files in the path and snmpget works
snmpget -v 2c -c public IP MY-MIB::myField.0
the thing is that when i run snmpwalk it doesnt show the results in the output.
I tried:
snmpwalk -v 2c -c public IP -m MY-MIB
Of course i run it with the IP of the machine i want to probe
i also tried adding MY-MIB to MIBS and then export it.
but it still doesnt appear in the log.
thanks in advance.

There are no interfaces on which a capture can be done.[wireshark]

I'm trying to use wireshark, my OS is debian, but when i want to have a capture it doesn't work , and i get this message: There are no interfaces on which a capture can be done.
NB: ~ I do have connected interfaces.
~If I try to run wireshark using a shell as root i get: No protocol specified
(wireshark:4515): Gtk-WARNING **: cannot open display: :0
So what's the problem?
thanks for yur replies
my OS is debian
sudo dpkg-reconfigure wireshark-common
sudo usermod -a -G wireshark $USER
and then log out and log back in again.

Resources