Skip to main content

Posts

Showing posts from December, 2010

25 Best SSH Tricks and Commands Part 2

Another ssh tricks you shoud know are : 11) Port Knocking! knock 3000 4000 5000 && ssh -p user@host && knock 5000 4000 3000 Knock on ports to open a port to a service (ssh for example) and knock again to close the port. You have to install knockd. See example config file below. [options] logfile = /var/log/knockd.log [openSSH] sequence = 3000,4000,5000 seq_timeout = 5 command = /sbin/iptables -A INPUT -i eth0 -s %IP% -p tcp –dport 22 -j ACCEPT tcpflags = syn [closeSSH] sequence = 5000,4000,3000 seq_timeout = 5 command = /sbin/iptables -D INPUT -i eth0 -s %IP% -p tcp –dport 22 -j ACCEPT tcpflags = syn 12) Remove a line in a text file. Useful to fix ssh-keygen -R In this case it’s better do to use the dedicated tool 11) Port Knocking! knock 3000 4000 5000 && ssh -p user@host && knock 5000 4000 3000 Knock on ports to open a port to a service (ssh for example) and knock again to close the port. You have to install knockd. See example config file below. [o

25 Best SSH Tricks and Commands Part 1

OpenSSH is a FREE version of the SSH connectivity tools that technical users of the Internet rely on. Users of telnet, rlogin, and ftp may not realize that their password is transmitted across the Internet unencrypted, but it is. OpenSSH encrypts all traffic (including passwords) to effectively eliminate eavesdropping, connection hijacking, and other attacks. Additionally, OpenSSH provides secure tunneling capabilities and several authentication methods, and supports all SSH protocol versions. SSH is an awesome powerful tool, there are unlimited possibility when it comes to SSH, heres the top Voted SSH commands 1) Copy ssh keys to user@host to enable password-less ssh logins. ssh-copy-id user@host To generate the keys use the command ssh-keygen 2) Start a tunnel from some machine’s port 80 to your local post 2001 ssh -N -L2001:localhost:80 somemachine Now you can acces the website by going to http://localhost:2001/ 3) Output your microphone to a remote computer’s speaker dd if=/dev/dsp

Detect And Block Port Scan Attacks In Real Time

A port scanner (such as nmap) is a piece of software designed to search a network host for open ports. Cracker can use nmap to scan your network before starting attack. You can always see scan patterns by visiting /var/log/messages. But, I recommend the automated tool called psad - the port scan attack detector under Linux which is a collection of lightweight system daemons that run on Linux machines and analyze iptables log messages to detect port scans and other suspicious traffic. psad makes use of Netfilter log messages to detect, alert, and (optionally) block port scans and other suspect traffic. For tcp scans psad analyzes tcp flags to determine the scan type (syn, fin, xmas, etc.) and corresponding command line options that could be supplied to nmap to generate such a scan. In addition, psad makes use of many tcp, udp, and icmp signatures contained within the Snort intrusion detection system. Install psad under Debian / Ubuntu Linux Type the following command to install psad, en

Find Working Directory Of Some Process In Linux

Find Working Directory Of Some Process In Linux If i found that any particular process is causing load while monitoring your Linux server, i would kill the process to get rid of it. Now, i found it is always better to identify the root cause of problem. Find out from which directory this process is running. Then i know that it is very easy to identify the working directory of the process, first of all find out the ID of the process for which you wish to determine the working directory. Run the following comamnd : ps -ef | grep Process-Name where replace Process-Name with the name of the process, just like if you want to find out the process ID for firefox then run the command as: ps -ef | gep firefox Once you have determined the process ID, run the following command to find out its working directory. pwdx processID That’s it, Enjoy!