Ubuntu – Which Process is Using a port?

1- Find what application/process is using the pro, type: sudo netstat -lpn |grep :8080 and press Enter. You will get an output similar to this one tcp6       0      0 :::8080                 :::*                    LISTEN      6782/java 2- I have got the process Id, which is 6782, now this is the process that is using port 8080.  

Heart Bleed – Exploit Example Code

If you need to test your server for the vulnerability, here is a simple Python script… [python] #!/usr/bin/python import sys import struct import socket import time import select import re from optparse import OptionParser options = OptionParser(usage=’%prog server [options]’, description=’Test for SSL heartbeat vulnerability (CVE-2014-0160)’) options.add_option(‘-p’, ‘–port’, type=’int’, default=443, help=’TCP port to test (default: 443)’)[…]

SFTP Only for a user – Debian

Add the user info the sshd_config file in /etc/ssh/sshd_config Ensure the line is uncommented; Subsystem sftp /usr/lib/openssh/sftp-server Match User userbob ForceCommand internal-sftp ChrootDirectory /home/userbob X11Forwarding no AllowTcpForwarding no Ensure the home directory is not group writeable. It should be 755. /etc/init.d/ssh restart service ssh restart Test the login via SSH, the result should display this[…]

Extract Table from SQL Dump – MYSQL

The script below creates individual table exports from a SQL dump.

[code] #!/bin/sh # http://kedar.nitty-witty.com #SPLIT DUMP FILE INTO INDIVIDUAL TABLE DUMPS # Text color variables txtund=$(tput sgr 0 1)    # Underline txtbld=$(tput bold)       # Bold txtred=$(tput setaf 1)    # Red txtgrn=$(tput setaf 2)    # Green txtylw=$(tput setaf 3)    # Yellow txtblu=$(tput setaf 4)   […]