Feed on
Posts
Comments

Category Archive for 'Linux'

Named pipes

Trivial to create: [email protected][~]$ mkfifo pipe1 [email protected][~]$ ls -l pipe1 prw-r–r– 1 ahoward ahoward 0 May 19 22:16 pipe1 [email protected][~]$   A bit trickier to use: [email protected][~]$ echo test > pipe1 (hangs…) ^C [email protected][~]$ cat pipe1 (also hangs…)   Any attempt to read or write from the pipe hangs. The problem here is that a […]

Read Full Post »

IPtables and NAT

By default, a linux machine will drop traffic that’s not destined for an IP bound locally. If you’re planning on receiving traffic not ultimately destined for you (ie: you’re behaving as a router along the path to the ultimate destination), then you’ll need to flip a couple flags in /etc/sysctl.conf to allow traffic forwarding: net.ipv4.ip_forward […]

Read Full Post »

Sending mail within bash

If you have a mail server installed it’s pretty easy. Every mail server is going to provide a sendmail binary, so that’s what we’ll use. The bare minimum is as follows: sendmail -t <<EOF To: [email protected] Subject: Test Body . EOF That’s probably not going to reach the destination, however. The problem with this is […]

Read Full Post »

IP blacklist on linux

My last post described in detail the steps to effectively block all network traffic from an attacking IP. Here’s how to block an IP in linux: iptables -A INPUT -s IP-To-Block -j DROP iptables -A INPUT -d IP-To-Block -j DROP Of course, that takes advantage of the built-in linux firewall. We didn’t use the built-in […]

Read Full Post »

Bash hot-keys 1

Granted, some of these are probably SSH or Putty hot-keys. I’m not certain there’s going to be a “Bash hot-keys 2” post, but there are probably plenty of combinations I’ve forgotten or have yet to learn, so we’ll call this post part 1, and there will most likely be more. ctrl+l That’s a lowercase L. […]

Read Full Post »