Category Archives: LPIC-101

tcpdump


title: “tcpdump”
date: 2018-05-11T13:42:39
slug: tcpdump


sudo tcpdump -i any -A -s 0 host 10.76.1.65 -n

Use the option -U in combination with -w so that tcpdump writes packets immediately.

Security / Sicherheit


title: “Security / Sicherheit”
date: 2015-04-06T20:19:50
slug: security-sicherheit


Hardening init

vi /etc/inittab

and add the line:
ss:S:respawn:/bin/sulogin

Hardening GRUB (Debian 7)
1 – Type the command: grub-mkpasswd-pbkdf2
2 – Enter the desired password

It will generate a long password encrypted like this: grub.pbkdf2.sha512.10000.FC58373BCA15A797C418C1EA7FFB007BF5A5

3 – Copy the complete generated code.
4 – Edit the file: /etc/grub.d/40_custom
5 – At the end of the file add the following commands:

set superusers=”username”
password_pbkdf2 username password

Obviously you should replace the words “username” with your desired user name, and the word password for the encrypted password generated in the previous step.
For example, if your desired username is John, and the password is grub.pbkdf2.sha512.10000.FC58373BCA15A797C418C1EA7FFB007BF5A5 your full code will look like this:

set superusers=”John”
password_pbkdf2 John grub.pbkdf2.sha512.10000.FC58373BCA15A797C418C1EA7FFB007BF5A5

6 – Save the file and exit.
7 – Finally, type the command: update-grub

DNS Konfiguration (client)


title: “DNS Konfiguration (client)”
date: 2015-04-06T20:05:36
slug: dns-konfiguration-client


/etc/nsswitch.conf

Beispielzeile:
hosts: dns [NOTFOUND=return] files

Zuerst Abrage des DNS Servers. Wenn der DNS Server angefragt werden kann, aber die Zone nicht auflösen kann,
gibt die Abfrage einen Fehler zurück. Das local file (/etc/hosts) wird nur abgefragt wenn der DNS Server nicht erreichbar ist.

Sample /etc/resolv.conf
search example.com
nameserver 192.168.1.254
nameserver 24.215.7.126
options timeout:2

netstat


title: “netstat”
date: 2015-04-06T19:42:13
slug: netstat


Zeigt Ports an auf denen ein Dienst läuft

netstat -ant

Interface mit Statistik anzeigen (RX-OK RX-ERR RX-DRP RX-OVR,…)

netstat -i

Aktive Ethernetverbindungen anzeigen (State: ESTABLISHED):

netstat -t

Aktive UDP Endpunkte anzeigen

netstat -u

Routing


title: “Routing”
date: 2015-04-06T19:24:58
slug: routing


Das Netzwerk 10.0.0.0 über eth1 und über das Gateway 192.168.1.108 routen.

route add -net 10.0.0.0 gw 192.168.1.108 dev eth1

Ein Defaultgateway hinzufügen

route add default gw 192.168.1.1 eth0