zoukankan      html  css  js  c++  java
  • linux查看端口

    如果你有权限操作:

    ss  netstat  lsof  fuser  nmap  

    如果没有权限的话:

    nmap  nc  ssh  telnet

    nmap  -sV -p 22  192.168.1.1

    # nmap  -sS -p 8080  localhost
    
    Starting Nmap 6.40 ( http://nmap.org ) at 2020-03-24 04:14 EDT
    Nmap scan report for localhost (127.0.0.1)
    Host is up (0.00016s latency).
    Other addresses for localhost (not scanned): 127.0.0.1
    PORT     STATE SERVICE
    8080/tcp open  http-proxy
    
    Nmap done: 1 IP address (1 host up) scanned in 0.06 seconds

    nc -v -w 1 10.4.7.100 3306

    # nc -v -w 1 10.4.7.100 3306
    Ncat: Version 7.50 ( https://nmap.org/ncat )
    Ncat: Connected to 10.4.7.100:3306.
    J
    5.7.27螆35ÿ냿Vkd'}e}mysql_native_password
    # nc -v -w 1 10.4.7.100 8080

    Ncat: Version 7.50 ( https://nmap.org/ncat )

    Ncat: Connected to 10.4.7.100:8080.
    ^C
    #端口不存活会直接拒绝
    [root@localhost ~]# nc -v -w 1 10.4.7.100 8090

    Ncat: Version 7.50 ( https://nmap.org/ncat )

    Ncat: Connection refused.
     

    ssh -v -p 8080 root@localhost

    # ssh -v -p 8080 root@localhost
    OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: /etc/ssh/ssh_config line 58: Applying options for *
    debug1: Connecting to localhost [::1] port 8080.
    debug1: connect to address ::1 port 8080: Connection refused
    debug1: Connecting to localhost [127.0.0.1] port 8080.
    debug1: Connection established.
  • 相关阅读:
    排序算法
    【转】《分享一下我研究SQLSERVER以来收集的笔记》未整理
    D3.js学习记录
    D3.js学习记录【转】【新】
    JAVA FILE or I/O学习
    JAVA GUI学习
    android一键锁屏
    源文件如何转换到可执行文件
    手动搭建maven项目
    ThinkingInJava----第11章 持有对象
  • 原文地址:https://www.cnblogs.com/littlebylittle/p/12563919.html
Copyright © 2011-2022 走看看