Archive for the 'Kernel' Category

Page 2 of 2

Upgrade Debian lenny to squeeze

Debian Logo

This upgrade from lenny to squeeze is not more complexer then the update from etch to lenny.
If you read everything carefully your server will run after upgrade too:)

Before you go on please read the official Debian release notes:

Recording your session:

1
script -t 2>~/upgrade-squeezestep.time -a ~/upgrade-squeezestep.script

First you should update your running system:

1
aptitude update && aptitude dist-upgrade

Check the package state:

1
dpkg --audit

It will show any packages which have a status of Half-Installed or Failed-Config, and those with any error status.

If you had a kernel upgrade please reboot. After successfully updates replace the sources from lenny to squeeze:
Continue reading ‘Upgrade Debian lenny to squeeze’

TCPDUMP – and the power of it

Tcpdump is one of the best network analysis-tools ever for information security professionals. Tcpdump is for everyone for hackers and people who have less of TCP/IP understanding. Many prefer to use higher-level analysis tools such Wireshark, but I believe it is a mistake. With tcpdump you can decode layers 2-7 of OSI model. The first layer represent only electrical signals and 000-zeros and 111-ones.

Options

Below are some tcpdump options (with useful examples) that will help you working with the tool. They’re very easy to forget and/or confuse with other types of filters, i.e. ethereal, so hopefully this article can serve as a reference for you, as it does me:)

The first of these is -n, which requests that names are not resolved, resulting in the IPs themselves.
The second is -X, which displays both hex and ascii content within the packet.
The final one is -S, which changes the display of sequence numbers to absolute rather than relative.

-i any : Listen on all interfaces just to see if you’re seeing any traffic.
-n : Don’t resolve hostnames.
-nn : Don’t resolve hostnames or port names.
-X : Show the packet’s contents in both hex and ASCII.
-XX : Same as -X, but also shows the ethernet header.
-v, -vv, -vvv : Increase the amount of packet information you get back.
-c : Only get x number of packets and then stop.
-S : Print absolute sequence numbers.
-e : Get the ethernet header as well.
-q : Show less protocol information.
-E : Decrypt IPSEC traffic by providing an encryption key.
-s : Set the snaplength, i.e. the amount of data that is being captured in bytes
-c : Only capture x number of packets, e.g. ‘tcpdump -c 3′



1. Basic communication // see the basics without many options

1
tcpdump -nS

2. Basic communication (very verbose) // see a good amount of traffic, with verbosity and no name help

1
tcpdump -nnvvS

3. A deeper look at the traffic // adds -X for payload but doesn’t grab any more of the packet

1
tcpdump -nnvvXS

4. Heavy packet viewing // the final “s” increases the snaplength, grabbing the whole packet

1
tcpdump -nnvvXSs 1514


Expressions
* host // look for traffic based on IP address (also works with hostname if you’re not using -n)

1
tcpdump host 192.168.1.1

* src, dst // find traffic from only a source or destination (eliminates one side of a host conversation)

1
2
tcpdump src 192.168.1.1
tcpdump dst 10.1.100.3

* net // capture an entire network using CIDR notation

1
tcpdump net 1.2.3.0/24

* proto // works for tcp, udp, and icmp. Note that you don’t have to type proto

1
tcpdump icmp

* port // see only traffic to or from a certain port

1
tcpdump port 3389

* src, dst port // filter based on the source or destination port

1
2
tcpdump src port 1025
tcpdump dst port 389

* src/dst, port, protocol // combine all three

1
2
tcpdump src port 1025 and tcp
tcpdump udp and src port 53

* Port Ranges // see traffic to any port in a range

1
tcpdump portrange 21-23

* Packet Size Filter // only see packets below or above a certain size (in bytes)

1
2
tcpdump less 32
tcpdump greater 128

[ You can use the symbols for less than, greater than, and less than or equal / greater than or equal signs as well. ]
// filtering for size using symbols

1
2
tcpdump > 32
tcpdump <= 128


Writing to a File
Capture all Port 80 traffic to a file:

1
tcpdump -i eth1 port 80 -w http_traffic

Read Captured Traffic back into tcpdump:

1
tcpdump -r http_traffic

You can use it for “screen” and later for graphical wireshark analyzes.


Getting Creative

Expressions are very nice, but the real magic of tcpdump comes from the ability to combine them in creative ways in order to isolate exactly what you’re looking for. There are three ways to do combination:

1. AND
and or &&
2. OR
or or ||
3. EXCEPT
not or !

Traffic that’s from 192.168.1.1 AND destined for ports 3389 or 22

1
tcpdump 'src 192.168.1.1 and (dst port 3389 or 22)'



Advanced
Show me all URG packets:

1
tcpdump 'tcp[13] & 32 != 0'

Show me all ACK packets:

1
tcpdump 'tcp[13] & 16 != 0'

Show me all PSH packets:

1
tcpdump 'tcp[13] & 8 != 0'

Show me all RST packets:

1
tcpdump 'tcp[13] & 4 != 0'

Show me all SYN packets:

1
tcpdump 'tcp[13] & 2 != 0'

Show me all FIN packets:

1
tcpdump 'tcp[13] & 1 != 0'

Show me all SYN-ACK packets:

1
tcpdump 'tcp[13] = 18'

Show all traffic with both SYN and RST flags set: (that should never happen)

1
tcpdump 'tcp[13] = 6'

Show all traffic with the “evil bit” set:

1
tcpdump 'ip[6] & 128 != 0'

Display all IPv6 Traffic:

1
tcpdump ip6

Nokia N900 IPv6 Support

1. Launch the X-Terminal application
2. Type in the command: “sudo gainroot”
3. Type in “apt-get install kernel-power-flasher” to launch the request to install the IPv6-enabled kernel available at Extras-Testing repository
4. Accept ll confirmations
5. After finishing the download, the new kernel will be flashed automatically to your N900 device. Now turn of the device and then turn on the device to reboot.

Now you are able to use ipv6 module

To add very simple ipv6 address install “IPROUTE” to use “ip” command.

1
ip -6 a a 2001:470:1f0b:1514::100/64 dev wlan0

Kernel modules

It’s sometimes useful to prevent some kernel modules from loading. This howto will show you how to do this. This is really easy to do, so if you want you can just skip to the end to see some examples.

Load manualy kernel modules:

1
modprobe ip_conntrack_ftp

List all loaded modules:

1
lsmod

This option remove loaded module:

1
modprobe -r pcspkr

Creating a blacklist:

1
2
cat /etc/modprobe.d/blacklist-custom
blacklist pcspkr