Tuesday, August 31, 2010

ldapsearch usage

For example,
In order to find the home directory for a certain user id.

ldapsearch -H "ldap://ldapserver/" -D -W -vvv -L -x -b 'OU=Users,DC=mycomp,DC=com' -z 0 uid=$1 Home

range(a..z): python generator expression for

In order to generate a..z with generator expression.

import string
for filter in ('uid='+x+'*' for x in string.lowercase):
print(filter)

Thursday, August 26, 2010

Play with TTL value with ping

Router will decrement TTL value within IP packet.
"ping" can be used to simulate how ICMP works in more complex tool such as "mtr", "traceroute". 

Please try increasing ttl-value against any target machine is ICMP is enabled along the route.
  

on unix/linux: ping -t target-ip
on windows: ping -i target-ip

mtr

mtr -n www.microsoft.com

ping test with incremental TTL

Similar like Traceroute (and mtr),
We can conduct an incremental testing with one ICMP packet each time:
ping -t 1  -c 1 www.yahoo.com
ping -t 2  -c 1 www.yahoo.com

...

how to find default IP TTL value of the remote system

TTL value is 1 byte within IP header.
  1. "ping " will show ttl returned by the remote machine.
  2. Find out how many hops between src and remote ip. traceroute/mtr
  3. Add the value from Step 1 and 2 will get the default TTL value of remote system
  4. For the curious, can look up http://www.binbert.com/blog/2009/12/default-time-to-live-ttl-values/ to take a guess what the remote system might be.

Tuesday, August 17, 2010

winpcap 's dlls



There are two dlls with winpcap installation.
  • wpcap.dll implements the libpcap API (plus some extensions) for Win32 systems.
  • packet.dll, and the drivers for various Win32 operating systems, provide a Win32-specific raw link-layer packet