def enum_procs_pkgs():
    """
    Enumerate Processes and Packages (enum_procs_pkgs)
    Enumerate all running processes and installed packages

    :return: Dictionary with process and package information
    """

    # Processes and Applications
    print "[*] ENUMERATING PROCESSES AND APPLICATIONS...\n"

    if "debian" in sysinfo["KERNEL"]["results"][0] or "ubuntu" in sysinfo["KERNEL"]["results"][0]:
        getpkgs = "dpkg -l | awk '{$1=$4=\"\"; print $0}'"  # debian
    else:
        getpkgs = "rpm -qa | sort -u"  # RH/other

    pkgsandprocs = {
        "PROCS": {"cmd": "ps waux | awk '{print $1,$2,$9,$10,$11}'", "msg": "Current processes", "results": []},
        "PKGS": {"cmd": getpkgs, "msg": "Installed Packages", "results": []}
    }

    pkgsandprocs = execute_cmd(pkgsandprocs)
    print_results(pkgsandprocs)  # comment to reduce output

    otherapps = {
        "SUDO": {"cmd": "sudo -V | grep version 2>/dev/null", "msg": "Sudo Version (Check out http://www.exploit-db.com/search/?action=search&filter_page=1&filter_description=sudo)", "results": []},
        "APACHE": {"cmd": "apache2 -v; apache2ctl -M; httpd -v; apachectl -l 2>/dev/null", "msg": "Apache Version and Modules", "results": []},
        "APACHECONF": {"cmd": "cat /etc/apache2/apache2.conf 2>/dev/null", "msg": "Apache Config File", "results": []},
        "SSHAGENTS": {"cmd": "for AGENT in $(ls /tmp| egrep 'ssh-.{10}$'); do echo $AGENT $(stat -c '%U' /tmp/$AGENT);export SSH_AUTH_SOCK=/tmp/$AGENT/$(ls /tmp/$AGENT);timeout 10 ssh-add -l 2>/dev/null;done;", "msg": "Checking for Active SSH Agents", "results": []}
    }

    execute_cmd(otherapps)
    print_results(otherapps)

    return pkgsandprocs

    Enumerate Processes and Packages (enum_procs_pkgs)
    Enumerate all running processes and installed packages

    :return: Dictionary with process and package information
    
linuxprivchecker.py