Linux

nmap scanning and printers

When you plan to nmap scan a network which contains printers, avoid scanning the JetDirect port, port 9100. Newer versions of nmap skips TCP port 9100 because some printers simply print anything sent to that port, leading to dozens of pages of HTTP get requests, binary SSL session requests, etc. This behavior can be changed […]

Read More
Web

Left and Right align text on the same line

It can sometimes be useful to have some text be aligned to the left and some text be aligned to the right on the same line, eg in a footer. Here is how this can be done in HTML: <div id=”footer”> <p class=”leftalign”>Text on the left.</p> <p class=”rightalign”>Text on the right.</p> </div> If you were […]

Read More
Web

Using multiple CSS classes

Let’s say you need six different 100px square boxes with different characteristics: Red with Border Blue with Border Green with Border Red without Border Blue without Border Green without Border You COULD create a unique class for each of these: .redwithborder { width: 100px; height: 100px; margin: 10px; float: left; background-color: red; border: 3px solid […]

Read More
Linux

Making /tmp non-executable

Many simple exploits that are used against machines, (via vulnerable PHP applications or local users, etc), rely upon being able to execute commands in /tmp. If this is a seperate partition or file system you can gain some protection by marking it non-executable. The common problem with this is that apt-get fails to work with […]

Read More
Linux

How to restore Grub from a Ubuntu Live CD

This will restore grub if you already had it installed but lost it due to a Windows install or some other accident that erased/changed your master boot record (MBR) so that grub no longer appears at startup or it returns an error. Boot into the Ubuntu Live CD. This can be the Live installer CD […]

Read More