`

how to find out which ports are open?

阅读更多

run this command as root:

 

netstat -tulpn

 

t - tcp

u - udp

l - listenning

p - programs

n - dont resolve names

 

 

exmaple output:

 

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address          Foreign Address     State         PID/Program name  
tcp        0       0           0.0.0.0:805                 0.0.0.0:*             LISTEN      4439/rpc.statd     
tcp        0       0           0.0.0.0:111                 0.0.0.0:*             LISTEN      4400/portmap       
tcp        0       0           :::8098                     :::*                        LISTEN      2960/java          
tcp        0       0           :::8009                     :::*                        LISTEN      2960/java          
tcp        0       0           :::1099                     :::*                        LISTEN      2960/java          
tcp        0       0           :::8080                     :::*                        LISTEN      2960/java          
tcp        0       0           :::8083                     :::*                        LISTEN      2960/java          
tcp        0       0           :::22                         :::*                        LISTEN      4698/sshd

 

...


udp        0      0            0.0.0.0:32768        0.0.0.0:*                                  4868/avahi-daemon: 
udp        0      0            0.0.0.0:799            0.0.0.0:*                                  4439/rpc.statd     
udp        0      0            0.0.0.0:802            0.0.0.0:*                                  4439/rpc.statd     
udp        0      0            0.0.0.0:5353          0.0.0.0:*                                  4868/avahi-daemon: 
...

 
udp        0      0            :::123                      :::*                                          4734/ntpd 

 

 ---------------------------

on Windows, try this command: (option o: the owningg process ID associated with the connection)

 

netstat -anto | findstr 4848

 

example output:

c:\>netstat -anto | findstr 4848
  TCP    0.0.0.0:4848           0.0.0.0:0              LISTENING       3652     InHost
  TCP    127.0.0.1:4848         127.0.0.1:58533        ESTABLISHED     3652     InHost
  TCP    127.0.0.1:4848         127.0.0.1:58536        ESTABLISHED     3652     InHost
  TCP    127.0.0.1:58533        127.0.0.1:4848         ESTABLISHED     3280     InHost
  TCP    127.0.0.1:58536        127.0.0.1:4848         ESTABLISHED     3280     InHost

 

 

------------- find a windows process

tasklist /v | findstr java

 

Image Name                     PID Session Name        Session#    Mem Usage Status          User Name                                              CPU Time Window Title

========================= ======== ================ =========== ============ =============== ================================================== ============ ========================================================================

idea64.exe                    3408 Console                    2    567,476 K Running         FSNI\John.Wang                                   0:06:07 fsnz-scheduling-tms-service [C:\work-java\fsnz-scheduling-tms-service] -

 

------------- kill a Windows process

c:\>taskkill /F /PID 3652
SUCCESS: The process with PID 3652 has been terminated.

分享到:
评论

相关推荐

    HOW TO DETECT OPEN PORTS, PROTOCOLS AND SERVICES.docx

    【如何检测开放端口、协议和服务】 在信息技术领域,服务依赖于特定的端口来接收和传输信息。因此,组织必须了解其IT环境中哪些端口是开放的,这些端口的功能以及它们关联的服务是什么,这一点至关重要。...

    Bluetooth Framework VCL v5.2.2 (完整源码)

    Framework is a VCL and ActiveX components library, which allows you to add Bluetooth?, IrDA?, Serial and ActiveSync? support into your applications. The Bluetooth? Framework is not an end-user ...

    Ports_open_串口异步通信_

    表示串行端口资源,提供异步的读、写支持(方法 Open、Close 和 Send 都具有异步特性)。

    Network Scanning Cookbook

    Nessus and Nmap are among the top tools that enable you to scan your network for vulnerabilities and open ports, which can be used as back doors into a network. Network Scanning Cookbook contains ...

    find_unused_open_ports

    本文将深入探讨如何找到未被使用的开放端口,这正是"find_unused_open_ports"项目的核心所在。 在Linux或Unix系统中,`nc`(Netcat)和`netstat`命令通常被用来检查端口的状态。`netstat -tuln`可以显示所有监听( ...

    Active Ports

    Active Ports maps ports to the owning application so you can watch which process has opened which port. It also displays a local and remote IP address for each connection and allows you to ...

    Amazon Fire Phone The Missing Manual

    THE FIRST TIME YOU hold the Fire phone, you’ll want to put it ... You’ll want to know where all its buttons, keys, and ports are located, for example—not to mention how to get to your Home screen.

    cisco_ios_access_lists.pdf

    access lists are built, and give examples of how to apply those access lists in different situations. Along the way, there are a number of sidebars and notes about concepts and information important...

    虚拟串口破解版

    modem cable using special driver, which can be easily included in your own software providing simple and comfortable way to create and configure virtual serial ports directly from your application....

    a project model for the FreeBSD Project.7z

    Often used more narrowly in reference to an external deliverable, which is a deliverable that is subject to approval by the project sponsor or customer” by [PMI, 2000]. Examples of outcomes are a ...

    使用System.IO.Ports读取COM口数据

    使用System.IO.Ports命名空间可以轻松地实现串口通信。 在C#中,System.IO.Ports命名空间提供了SerialPort类,该类用于控制和管理串行通信端口。SerialPort类提供了多种属性和方法,用于配置串口、发送和接收数据。...

    Window 7版Acrive Ports - Guard Ports

    Window 7版Acrive Ports : Guard Ports - MFC 2012,v1.0.0.2, 北京师范大学 AlexZhang 开发版本,此版本能够兼容XP、2000、win7、win8、win10系统,能够很容易地判断出某个端口被什么程序给占用了。能够发现windows...

    Sixnet交换机

    Up to 32 Ethernet ports are offered including 8 Gigabit ports, 8 PoE ports and up to 20 fiber optic ports. The rugged and compact 1U packaging allows them to fit into standard EIA, WECO and ETSI ...

    The I2C-bus and how to use it (including specifications)

    I2C总线是一种由飞利浦半导体(现恩智浦半导体)于1982年发明的双向两线串行总线标准,主要用于连接微控制器和其他外围设备,如液晶驱动器(LCD Driver)、远程输入/输出端口(Remote I/O Ports)、随机存取存储器...

    Serial Programming Guide for POSIX Operating Systems

    The Serial Programming Guide for POSIX Operating Systems will teach you how to successfully, efficiently, and portably program the serial ports on your UNIX?workstation or PC. Each chapter provides ...

    glibc-ports-2.12.1.tar.gz

    《glibc-ports-2.12.1.tar.gz:glibc版本升级的关键步骤与相关知识详解》 在Linux系统中,glibc(GNU C Library)是核心的库组件之一,它提供了C语言编程所需的接口,包括标准I/O、字符串处理、内存管理等多个功能...

    Active Ports.rar

    《Active Ports:网络端口管理与安全探索》 在当今数字化时代,网络安全成为了我们日常生活中不可或缺的一部分。了解和管理计算机的网络端口是确保系统安全的重要环节。"Active Ports"是一款备受推崇的网络端口查看...

    电脑虚拟串口和超好用调试工具.zip

    在C#中,我们可以利用System.IO.Ports命名空间提供的SerialPort类来实现串口通信。通过设置波特率、数据位、停止位、校验位等参数,创建一个SerialPort对象,并监听或发送数据。 PLC(可编程逻辑控制器)是工业控制...

    FreeBSD Chinese HowTo

    - 本文档为《FreeBSD Chinese HowTo》的一部分,由《中国FreeBSD文档项目》版权持有。 - 本指南可能会随着FreeBSD版本更新而有所变化,请确保使用最新版本的文档。 - 如果在使用过程中遇到问题,可以联系项目组成员...

Global site tag (gtag.js) - Google Analytics