Dies ist eine alte Version des Dokuments!

Need to have


  • Active Directory auf seine Konsistenz überprüfen - forward lookup und reverse lookup der Einträge sollten übereinstimmen
  • Getestet auf: Ubuntu 18.04
  • Pakete erforderlich: php , php-ldap , php-mbstring
  • /usr/local/bin/checkDNSEntriesLDAP.php

$server = "ldaps://AD_SERVER:636";
//domain user to connect to LDAP
//user password

//zB: OU=EDV1,OU=Workstations,OU=Ressourcen,OU=VirtualSchool,DC=schule,DC=intern
$dn = array(0=>"DN_NAME_LDAP_PFAD1",1=>"DN_NAME_LDAP_PFAD2");



for ($j=0; $j<count($dn); $j++)
       $r=ldap_bind($ds, $user , $passwd);

	$sr=ldap_search($ds, $dn[$j], $search, array(0=>"dNSHostName",1=>"distinguishedName"));

	$data = ldap_get_entries($ds, $sr);    


	for ($i=0; $i<$data["count"]; $i++) 




		if(mb_strtolower($reverseLookup) != mb_strtolower($data[$i]["dnshostname"][0]) )

			echo "FAIL Hostname: ".$data[$i]["dnshostname"][0]." IP: ".$ip." Reverse: ".$reverseLookup."\n";


		echo "FAIL NO-IP Entry: ".$data[$i]["dnshostname"][0]."\n";

		echo "FAIL NO DNSHostname: ".$data[$i]["distinguishedName"][0]."\n";



echo "Summary:\n";
echo "All Computer objects found: ".$countAll."\n";
echo "All Computer objects ok: ".$okDNS."\n";
echo "Consistency integrity: ";
printf("%.2f \n",(($okDNS/$countAll)*100));
echo "Errors computer count: ".$errDNS."\n";
echo "OU's that i looked for :\n";

echo "\n";



  • Für HPE1950 Serie / damit es möglich wird herauszufinden auf welchem Port und Switch bestimmte MAC Adressen gefunden werden
  • IP_Switch MAC_Address

function bailout
	echo -en "ERROR: $1\n";
	exit 2;

function run_ips

	for i in $SWITCHES_IPS ;
           $0 $i "$1" ;
	   exit_codes=$(($exit_codes + $?))

       exit $exit_codes

function usage 
	echo -en "Usage: $0 ip-address-switch  mac-address e.g. 00:75:2d:ee:5e:11\n";
	echo -en "Usage: export SWITCHES_IPS="ip1 ip2 ip3" then $0 mac-address e.g. 00:75:2d:ee:5e:11\n";
	exit 1;


which cut > /dev/null || bailout "command cut not found!"

which snmpwalk > /dev/null || bailout "command snmpwalk not found! Debian/Ubuntu package: snmp"

which xargs > /dev/null || bailout "command xargs not found!"

which sed > /dev/null || bailout "command sed not found!"

which printf > /dev/null || bailout "command printf not found!"

[[ -n "$SWITCHES_IPS" ]] && [[ $# == 1 ]] && run_ips $1

[[ $# != 2 ]] && usage 


echo $mac | grep -q -P "^([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}$" 

[[ $? != 0 ]] && bailout "Not a correct MAC address format: $mac \n I need two digit  hex mac address  e.g. 00:1f:11:32:7f:1f"

while read line ; 
	mac_found=$(echo $line | cut -d"=" -f 1 | cut -d"." -f 12,13,14,15,16,17 | tr . ' ' | xargs  printf '%02x:' | sed 's/\(.*\):/\1 /')

        echo $mac_found | grep -q -i --fixed-strings $mac

        if [ $? == "0" ]
            interface_found=$(echo $line | cut -d":" -f 2 | tr -d ' ' )
	    number_macs=$(snmpwalk -v 1 -Os -c public "$ip" "$OID_INTERFACE_AND_MAC" | grep -c "^.*INTEGER: $interface_found$")
	    echo "SUCCESS;$ip;$mac;$interface_found;$number_macs"
	    exit 0

done  < <( snmpwalk -v 1 -Os -c public "$ip" "$OID_INTERFACE_AND_MAC" )

echo "ERROR;$ip;$mac;0;0"
exit 1

Roadworker-Start OpenVPN

  • Ich möchte eine Roadworker OpenVPN Datei mit verschlüsseltem Private Key in der XFCE GUI starten nach dem Login
  • XFCE Startup nach dem Einloggen:



chmod 600 $temp_file

zenity --title "Roadworker VPN Password" --password > $temp_file

openvpn --daemon --writepid /tmp/ --config /home/urnilxfgbez/openvpn/roadworker.conf --askpass $temp_file

rm $temp_file

pgrep --pidfile /tmp/

if [ $? == "0" ]

       zenity --info --text="Konnte VPN erfolgreich starten pid: /tmp/"


	zenity --error --text="Konnte VPN nicht erfolgreich starten - passwort?"


exit 0
  • Achtung: bei Debian Buster ist gksudo/gksu nicht mehr in den Repositories vorhanden
  • Openvpn Aufruf als Root :
pkexec --user root openvpn --daemon --writepid /tmp/ --config /home/urnilxfgbez/openvpn/roadworker.conf --askpass $temp_file

Einfache Zeitaufzeichnung

  • Benötigt wird zenity / dateutils
  • KUNDE1 / KUNDE2 .. durch zB: Stammkunden ersetzen
  • Erstellt Einträge unter /PFAD/STUNDEN/KUNDENNÀME_JAHRMONAT mit Datum/Von/Bis/Dauer/Tätigkeitsbeschreibung im CSV Format


function getTime() {

while [[ $ok == 0 ]]  ; do

time=$(zenity --entry --text="$1 im Format hh:mm")

if [[ $time =~ $timePattern ]]; then 


echo $time


function bailout() {

zenity --error --text="$1"

exit 1


function getCustomerName {

customerName=$(zenity --list --editable --column="Kundenname" "KUNDE1" "KUNDE2" "KUNDE3" )

while [[ $customerName  == "" ]] ; do

 customerName=$(zenity --list --editable --column="Kundenname" "KUNDE1" "KUNDE2" "KUNDE3")


echo $customerName


function getActivity {
  activityName=$(zenity --text="Tätigkeitbeschreibung" --entry)

 while [[ $activityName  == "" ]] ; do

 activityName=$(zenity --text="Tätigkeitbeschreibung" --entry)

echo $activityName  


function getDate {


curDate=$(date +%d.%m.%Y)

while [[ $ok == 0 ]]  ; do

datiges=$(zenity --entry --entry-text="$curDate" --text="im Format")

if [[ $datiges =~ $datePattern ]]; then 


echo $datiges


which dateutils.ddiff || (zenity --error --text="dateutils.ddiff not found. Consider installing: sudo apt-get install dateutils" ; exit 1)

beginTime=$(getTime "Beginnzeit")

endTime=$(getTime "Endzeit")

timeDiff=$(dateutils.ddiff $beginTime $endTime -f "%H:%M") 
hours=$(echo $timeDiff | cut -d":" -f 1)
minutes=$(echo $timeDiff | cut -d":" -f 2)
minPercentage=$(echo "scale=2;$minutes/60" | bc -l)

[[ $minPercentage == "0" ]] && minPercentage=".00";




month=$(echo "$entryDate" | grep -o -P "\.[0-9]{1,2}\." ) ; month=$(echo "${month//.}")
year=$(echo "$entryDate" | grep -o -P "\.[0-9]{4}" ) ; year=$(echo "${year//.}")



[[ ! -w "$CURRENT_MONTH" ]] && touch "$CURRENT_MONTH"

[[ ! -w "$CURRENT_MONTH" ]] &&  bailout "Cannot write to: $CURRENT_MONTH" 


echo -n -e  "$entryText" >> $CURRENT_MONTH ||  bailout "Cannot write to: $CURRENT_MONTH CHECK MANUALLY !!!!";

zenity --info --text="SUCCESS: $CURRENT_MONTH : $entryText" 

exit 0

dsniff suite

  • Oldschool
Dsniff suite:

Keywords: layer 2 attacks, arp spoofing, sniffing , man-in-the-middle attack, arpspoof, dsniff 


In summary, the aim of SYN flood is sending lots of SYN packets to the
server and ignoring SYN+ACK packets returned by the server. This causes
the server to use their resources for a configured amount of time for
the possibility of the expected ACK packets arriving.

If an attacker sends enough SYN packets, this will overwhelm the server
because servers are limited in the number of concurrent TCP connections.
If the server reaches its limit, it cannot establish new TCP connections
until the existing connections which are in the SYN-RCVD state timeout.

SYN flood attacks can be performed with hping3.

Simple SYN flood:

    root@kali:~# hping3 -S --flood -V -p TARGET_PORT TARGET_SITE
    using eth0, addr:, MTU: 1500
    HPING TARGET_SITE (eth0 S set, 40 headers + 0 data
    hping in flood mode, no replies will be shown

Advanced SYN flood with random source IP, different data size, and
window size:

    root@kali:~# hping3 -c 20000 -d 120 -S -w 64 -p TARGET_PORT --flood
--rand-source TARGET_SITE
    HPING TARGET_SITE (eth0 S set, 40 headers + 120
data bytes
    hping in flood mode, no replies will be shown

–flood: sent packets as fast as possible
–rand-source: random source address
-c –count: packet count
-d –data: data size
-S –syn: set SYN flag
-w –win: winsize (default 64)
-p –destport: destination port (default 0)

For detailed information see the manual.
UDP Flood

UDP is a protocol which does not need to create a session between two
devices. In other words, no handshake process required.

A UDP flood does not exploit any vulnerability. The aim of UDP floods is
simply creating and sending large amount of UDP datagrams from spoofed
IP’s to the target server. When a server receives this type of traffic,
it is unable to process every request and it consumes its bandwidth with
sending ICMP “destination unreachable” packets.

hping3 can be used for creating UDP floods:

    root@kali:~# hping3 --flood --rand-source --udp -p TARGET_PORT TARGET_IP
    HPING (eth0 udp mode set, 28
headers + 0 data bytes
    hping in flood mode, no replies will be shown

–flood: sent packets as fast as possible
–rand-source: random source address
–udp: UDP mode
-p –destport: destination port (default 0)

For detailed information see the manual.

keywords: Dos , DHCP flooding , vlan attack 


  • Macht nur Sinn wenn die Website über http aufgerufen wurde und https Links enthält
Keywords: man-in-the-middle


  • zB: vim Session wieder herstellen / wenn die SSH Verbindung abbricht / Programm mit PID zum aktuellen terminal „ziehen“
man Auszug
"reptyr  is a utility for taking an existing running program and attach‐ing it to a new terminal"

apt-get install reptyr

reptyr PID


  • Wordlists erstellen unter bestimmten Kriterien
usage: crunch <min-len> <max-len> [charset] [-o wordlist.txt] [-t [FIXED]@@@@] [-s startblock] [-c number]
usage: crunch <min-len> <max-len> [-f <path to charset.lst> charset-name] [-o wordlist.txt] [-t [FIXED]@@@@] [-s startblock] [-c number]

min-len is the minimum length string you want crunch to start at
max-len is the maximum length string you want crunch to end at

[charset] is optional.  You may specify a character set for crunch to use on the command line or if you leave it blank crunch will use abcdefghijklmnopqrstuvwxyz as the character set.  NOTE: If you want to include the space character in your character set you use enclose your character set in quotes i.e. "abc "

[-f <path to charset.lst> <charset-name>] is the alternative to setting the character set on command line.  This parameter allows you to specify a character set from the charset.lst.
NOTE: You may either not specify a charset, you may specify a character set on the command line, or you may specify -f <path to charset.lst> <charset-name>.  You can only do one.

[-t [FIXED]@@@@] is optional and allows you to specify a pattern, eg: @@god@@@@ where the only the @'s will change

[-s startblock] is optional and allows you to specify the starting string, eg: 03god22fs

[-o wordlist.txt] is optional allows you to specify the file to write the output to, eg: wordlist.txt

[-c number] is optional and specifies the number of lines to write to output file, only works if -o START is used, eg: 60  The ouput files will be in the format of starting letter-ending letter for example:
 ./crunch 1 1 -f /pentest/password/crunch/charset.lst
 mixalpha-numeric-all-space -o START -c 60
 will result in 2 files: a-7.txt and 8-\ .txt  The reason for the slash in  the second filename is the ending character is space and ls has to escape it to print it.  Yes you will need to put in the \ when specifing the filename.

./crunch 1 8
crunch will display a wordlist that starts at a and ends at zzzzzzzz

./crunch 1 6 abcdefg
crunch will display a wordlist using the charcterset abcdefg that starts at a and ends at gggggg

./crunch 1 8 -f charset.lst mixalpha-numeric-all-space -o wordlist.txt
crunch will use the mixalpha-numberic-all-space character set from charset.lst and will write the wordlist to a file named wordlist.txt.  The file will start with a and end with "        "

./crunch 8 8 -f charset.lst mixalpha-numeric-all-space -o wordlist.txt -t @@dog@@@ -s cbdogaaa
crunch will generate a 8 character wordlist using the mixalpha-number-all-space characterset from charset.lst and will write the wordlist to a file named wordlist.txt.  The file will start at cbdogaaa and end at "  dog   "

keywords: wordlist-generator, wordlist, gen-wordlist, wordlists


  • Plattentemperatur auslesen
hddtemp /dev/sdx

keywords: harddisk, hddtemp, temperature


  • Sound Formate konvertieren
soundconverter - GNOME application to convert audio files into other formats

Code: [Select]

apt-get install soundconverter

keywords: mp4 convert, convert audio , CONVERT, MP3, mp3 MP4, youtube-videos


  • Video Formate konvertieren
apt-get install transmageddon

keywords: video converter, VideoConverter, converter , Video

iso erstellen

  • Aus Directory heraus:
mkisofs -V Test -r Altaro_Backup/ > altaro_cd.iso
  • oder paket genisoimage
genisoimage -o c23x_intel_raid.iso C23x_INTEL_RAID/

keywords: iso, ISO, iso-erstellen, mkisofs, ISO-mount
Diese Website verwendet Cookies. Durch die Nutzung der Website stimmen Sie dem Speichern von Cookies auf Ihrem Computer zu. Außerdem bestätigen Sie, dass Sie unsere Datenschutzbestimmungen gelesen und verstanden haben. Wenn Sie nicht einverstanden sind, verlassen Sie die Website.Weitere Information
know-how/tools.1612428639.txt.gz · Zuletzt geändert: 2021/02/04 09:50 von cc

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki