netstat.py 文件源码

python
阅读 42 收藏 0 点赞 0 评论 0

项目:infraview 作者: a-dekker 项目源码 文件源码
def packet_socket():
    '''
    Function to return a list of pids and process names utilizing packet sockets.
    '''

    packetcontent = _packetload()
    packetresult = []
    for line in packetcontent:
        line_array = _remove_empty(line.split(' '))
        inode = line_array[8].rstrip()
        pid = _get_pid_of_inode(inode)
        try:
            exe = os.readlink('/proc/' + pid + '/exe')
        except BaseException:
            exe = None

        nline = [pid, exe]
        packetresult.append(nline)
    return packetresult
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号