Category Archives: Operating Systems

Linux Serial Console – Grub

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.

GRUB_DEFAULT=0
GRUB_TIMEOUT=1
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,9600n8"

# Uncomment to disable graphical terminal (grub-pc only)
GRUB_TERMINAL=serial
GRUB_SERIAL_COMMAND="serial --speed=9600 --unit=0 --word=8 --parity=no --stop=1"

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

/etc/inittab

T0:2345:respawn:/sbin/getty -L ttyS0 9600 vt100

Subversion Homedir

Preparing the software:

apt-get install subversion libapache2-svn
sudo mkdir  /mnt/var/svn
chown www-data:www-data -R /mnt/var/svn

Apache Config:

<Location /svn>
DAV svn
   SVNParentPath /mnt/var/svn
   <LimitExcept GET PROPFIND OPTIONS REPORT>
      AuthType Basic
      AuthName "Authorization Realm"
      AuthUserFile /mnt/var/svn/svnauthusers.txt
      Require valid-user
   </LimitExcept>
</Location>
sudo htpasswd -c /mnt/var/svn/svnauthusers.txt patrick.preuss 
sudo chown www-data:www-data /mnt/var/svn/svnauthusers.txt
sudo svnadmin create /mnt/var/svn/patrick.preuss
sudo chown www-data:www-data -R /mnt/var/svn/patrick.preuss
svn co http://10.0.12.10/svn/patrick.preuss

BASH inet_aton inet_ntoa

# aton and ntoa
function INET_NTOA() {
  local IFS=. num quad ip e
  num=$1
  for e in 3 2 1; do
    quad=$((256**$e))
    ip[$((3-$e))]=$(($num/$quad))
    num=$((num%quad))
  done
  ip[3]=${num}
  echo "${ip[*]}"
}

function INET_ATON() {
  local IFS=. ip num e
  ip=($1)
  for e in 3 2 1; do
    num=$(($num+${ip[$((3-$e))]}*256**$e))
  done
  num=$(($num+${ip[3]}))
  echo $(($num&0xFFFFFFFF))
}

Windows 7 Packet Caputre

You have several options to capture packets on Windows 7 on is Wireshark the other is

netsh

 

[sourcecode]

C:\Users\rt01>netsh trace show scenarios

Verfügbare Szenarien (18):

AddressAcquisition        : Problembehandlung in Zusammenhang mit der Adressenerfassung
DirectAccess                  : Problembehandlung in Zusammenhang mit DirectAccess
FileSharing                    : Allgemeine Datei- und Druckerfreigabeprobleme behandeln
InternetClient                 : Probleme mit der Webkonnektivität diagnostizieren
InternetServer                : Behandeln von serverseitigen Webkonnektivitätsproblemen
L2SEC                            : Problembehandlung in Zusammenhang mit der Authentifizierung auf der 2. Schicht
LAN                                : Problembehandlung im Zusammenhang mit verkabelten LANs
Layer2                            : Problembehandlung in Zusammenhang mit der Konnektivität auf der 2. Schicht
MBN                               : Problembehandlung in Zusammenhang mit mobilem Breitband
NDIS                              : Problembehandlung in Zusammenhang mit Netzwerkadaptern
NetConnection              : Problembehandlung bei Netzwerkverbindungen
P2P-Grouping               : Peer-zu-Peer-Gruppierungsprobleme behandeln
P2P-PNRP                     : Problembehandlung in Zusammenhang mit dem Peer Name Resolution-Protokoll (PNRP)
RemoteAssistance         : Probleme mit der Windows-Remoteunterstützung behandeln
RPC                               : Probleme mit dem RPC-Framework beheben
WCN                              : Problembehandlung in Zusammenhang mit der Windows-Sofortverbindung
WFP-IPsec                     : Behandeln von Windows-Filterplattformproblemen und IPsec-bezogenen Problemen
WLAN                             : Problembehandlung in Zusammenhang mit drahtlosen LANs
[/sourcecode]

 

[sourcecode]

C:\Windows\system32>netsh trace start scenario=MBN capture=yes report=yes tracefile=c:\trace\trace.etl

Ablaufverfolgungskonfiguration:

Status:             Wird ausgeführt
Ablaufverfolgungsdatei:         C:\trace\trace.etl
Anfügen:             Aus
Kreisförmig:           Ein
Maximale Größe:           250 MB
Bericht:             Ein
[/sourcecode]

 

[sourcecode]

netsh trace stop

[/sourcecode]

 

then you can use the Network Monitor NM

Windows XP Logon and Logoff

Hm wasn das ???

Versuch mich an einem Windows XP Rechner anzumelden und werde dann direkt wieder abgemeldet. *grübel* Naja dann ist es doch besser wenn die Gäste abhauen. Mag mein Linux wieder haben.

Also erstmal XP CD ins Laufwerk und schauen was da Sache ist. XP auf der zweiten Platte installiert und dann ein Paar ungebetene Gäste von der anderen XP installation entfernt.

Die Regestry von der ersten Installation in Regedit geladen und kontolliert ob die Werte für Userinit und Shell noch stimmen.

Das eigentliche Problem war dann das userinit.exe nicht mehr dort war wo es sein sollte, also den Schlingel dann kurz an seinen Platz gebracht und siehe da die Anmeldung funktioniert wieder.

Flickr : , ,

Access-based Enumeration (ABE) and Cisco WAAS

Access-based Enumeration (ABE) is a smart feature to let users see only the folders they have access to.
But if you have Cisco WAAS deployed in your network please be aware you have to add a Dynamic share to the waas configuration so the waas knows about this.

—– EDIT BEGIN —–

2010-09-17 We found out the Hardway you have to add the System to the AD. So i will show the Story in a new Post:-) Stay tuned, guys.

—– EDIT END ——-

Cisco Wide Area Application Services Configuration Guide (Software Version 4.1.7)

Step 1
For creating a dynamic share you have to add a Domain to the Cental Manager eg “Dynamic Shares”

Step 2
Create a entry under the dynamic shares in the global configuration.

On the WAE CLI

ToBe Done

If you feel this helps a bit or may be not ? Please leave a comment.

DMVPN with Linux

I know since i discovered the DMVPN in 2004/5 this is a very intelligent combination of IPsec, GRE and NHRP. Many Thanks to the Guys at Cisco, Christoph, Frederick and all other.

This week i discovered “opennhrp” on sourceforge.

It took me a minute or two to have a VM with debian up and the needed tools installed.

I used VMWare with a bridged ethernet interface for testing, installed debian 4.0 netinstall iso and upgraded to sid / testing, so i got Kernel Version 2.6.26-1-686.

Then downloaded ipsec-tools-0.8-alpha20090126.tar.bz2 from the site. you have to install some libs and tools to build ipsec tools, like kernel headers and so on:-) and done some configure and make stuff.

I went to make opennhrp, well all done with out a problem to here.

Next i configured racoon and ipsec-tools and opennhrp like this:

   /etc/ipsec-tools.conf 
   #!/usr/sbin/setkey -f
   spdflush;
   spdadd 0.0.0.0/0 0.0.0.0/0 gre -P out ipsec esp/transport//require;
   spdadd 0.0.0.0/0 0.0.0.0/0 gre -P in ipsec esp/transport//require;

   /etc/racoon/racoon.conf 
   path pre_shared_key "/etc/racoon/psk.txt";
   remote anonymous {
      exchange_mode main,aggressive;
      lifetime time 24 hour;
      # nat_traversal on;
      script "/etc/opennhrp/racoon-ph1down.sh" phase1_down;
      proposal {
         encryption_algorithm 3des;
         hash_algorithm sha1;
         authentication_method pre_shared_key;
         dh_group 5;
      }
   }
   sainfo anonymous {
      lifetime time 12 hour;
      encryption_algorithm 3des, blowfish 448, rijndael;
      authentication_algorithm hmac_sha1, hmac_md5;
      compression_algorithm deflate;
   }

   /etc/racoon/psk.txt
   10.2.0.90 1234

   /etc/opennhrp/opennhrp.conf
   interface gre1
      map 172.255.255.1/24 10.2.0.90 register cisco
      cisco-authentication 1234
      shortcut

No get the Tunnel UP:

   ip tunnel add gre1 mode gre key 1234 ttl 64
   ip addr add 172.255.255.2/24 dev gre1
   ip tunnel change gre1 local 10.0.81.115
   ip link set gre1 up

Now its time to get on the other side.

We are using a Cisco 1812 with c181x-advsecurityk9-mz.124-15.T7.bin running.

   crypto isakmp policy 10
      encr 3des
      authentication pre-share
      group 5
   !
   crypto isakmp key 1234 address 0.0.0.0 0.0.0.0
   !
   crypto ipsec transform-set TRANSFORMSET_3 esp-3des esp-sha-hmac
      mode transport
   !
   crypto ipsec profile Profile3
      set transform-set TRANSFORMSET_3
   !
   interface Tunnel888
      ip address 172.255.255.1 255.255.255.0
      no ip redirects
      no ip unreachables
      no ip proxy-arp
      ip mtu 1400
      ip flow ingress
      ip nhrp authentication 1234
      ip nhrp map multicast dynamic
      ip nhrp network-id 10064
      ip nhrp holdtime 360
      ip nhrp max-send 200 every 10
      ip route-cache same-interface
      ip tcp adjust-mss 1350
      load-interval 30
      tunnel source 10.2.0.90
      tunnel mode gre multipoint
      tunnel key 1234
      tunnel protection ipsec profile Profile3

and viola

   Router# sh dmvpn interface tunnel 888
   Load for five secs: 8%/3%; one minute: 9%; five minutes: 10%
   Time source is NTP, 22:14:22.148 CET Sat Feb 14 2009
   Legend: Attrb --> S - Static, D - Dynamic, I - Incompletea
   N - NATed, L - Local, X - No Socket
   # Ent --> Number of NHRP entries with same NBMA peer
   Tunnel888, Type:Hub, NHRP Peers:1,
   # Ent Peer NBMA Addr Peer Tunnel Add State UpDn Tm Attrb
   ----- --------------- --------------- ----- -------- -----
   1 10.0.81.115 172.255.255.2 UP never D
   Router# ping 172.255.255.2
   Type escape sequence to abort.
   Sending 5, 100-byte ICMP Echos to 172.255.255.2, timeout is 2 seconds:
   !!!!!
   Success rate is 100 percent (5/5), round-trip min/avg/max = 4/4/8 ms

this looks great:-)
Many thanks Timo for doing such a impressiv work. I like the cisco for they impressiv boxes and i also like opensource software.

— edit February 15, 2009 at 12:09 am —

I found after a while no packets traveling, the nhrp registration had gone on the cisco side may be holdtimers differ so added “holding-time 360” to the opennhrp.conf , a opennhrpctl purge fixed the problem.

Sony Ericson W960i oder doch Nokia N95

Gestern hab ich mal mein Nokia N95 gegen das Sony Ericsson W960i von meinem Kollegen getauscht. Dank iSync war das eine Sache von ein paar Minuten alle Daten (Kalendar, Addressen) zu sichern, die Photos sind durch das Nokia Multimedia Transfer Tool schon in iPhoto gesichert, hier wäre es noch cool wenn die auch bei einem normalen Sync mit iSync abgeholt werden.

Standard mässig wird das W960i nicht von iSync erkannt, aber man findet im Internet ein freies Plugin für das Handy, kurz das Plugin nach “/Library/PhonePlugins” und viola iSync kann auch mit dem W960i syncen.

Hm werd das wohl erstmal bis nach Neujahr behalten, damit ich das richtig Testen kann.

Sony Ericsson W960i Plugin