diff options
author | Kr1ss | 2018-09-29 16:37:27 +0200 |
---|---|---|
committer | Kr1ss | 2018-09-29 16:44:45 +0200 |
commit | edf257a1c0dc6d5451d933ae25e8fac47b4e359c (patch) | |
tree | 1ac2d82baf3388045c8bb07e2264e7203d616050 | |
download | aur-edf257a1c0dc6d5451d933ae25e8fac47b4e359c.tar.gz |
initialize the git repository
-rw-r--r-- | .SRCINFO | 16 | ||||
-rw-r--r-- | PKGBUILD | 21 | ||||
-rwxr-xr-x | lbd | 128 | ||||
-rw-r--r-- | lbd.sig | bin | 0 -> 566 bytes |
4 files changed, 165 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..83e006f8048e --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,16 @@ +pkgbase = lbd + pkgdesc = Load Balancer Detector - checks if a given domain uses load balancing + pkgver = 0.4 + pkgrel = 1 + url = https://tools.kali.org/information-gathering/lbd + arch = any + license = GPL2 + provides = lbd + source = lbd + source = lbd.sig + validpgpkeys = 7A194E3F7A8F867BEA8A5339023F078862ACFE50 + sha256sums = 2c908eb74a988766c4bb1caa349ebd0ef2aeaf89447bdcb771bbc75b3fd4c0d2 + sha256sums = SKIP + +pkgname = lbd + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..a96e4c671279 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,21 @@ +# Maintainer: Kr1ss <kr1ss.x@yandex.com> + +pkgname=lbd +pkgver=0.4 +pkgrel=1 +pkgdesc='Load Balancer Detector - checks if a given domain uses load balancing' +arch=('any') +url='https://tools.kali.org/information-gathering/lbd' +license=('GPL2') +provides=('lbd') +options=() +source=("$pkgname" + "${pkgname}.sig") +sha256sums=('2c908eb74a988766c4bb1caa349ebd0ef2aeaf89447bdcb771bbc75b3fd4c0d2' + 'SKIP') +validpgpkeys=('7A194E3F7A8F867BEA8A5339023F078862ACFE50') + +package() { + cd "$srcdir" + install -Dm 755 lbd "$pkgdir/usr/bin/lbd" +} @@ -0,0 +1,128 @@ +#!/bin/bash +# lbd (load balancing detector) detects if a given domain uses +# DNS and/or HTTP Load-Balancing (via Server: and Date: header and diffs between server answers) +# +# License: GPL-v2 +# +# Written by Stefan Behte +# Contact me, if you have any new ideas, bugs/bugfixes, recommondations or questions! +# Please also contact me, if you just like the tool. :) +# +# Stefan dot Behte at gmx dot net +# + +QUERIES=50 +DOMAIN=$1 +METHODS="" + +echo +echo "lbd - load balancing detector 0.1 - Checks if a given domain uses load-balancing." +echo " Written by Stefan Behte (http://ge.mine.nu)" +echo " Proof-of-concept! Might give false positives." + +if [ "$1" = "" ] +then + echo "usage: $0 [domain]" + echo + exit -1 +fi + +echo -e -n "\nChecking for DNS-Loadbalancing:" +NR=`host $DOMAIN | grep -c "has add"` +if [ $NR -gt 1 ] +then + METHODS="DNS" + echo " FOUND" + host $DOMAIN | grep "has add" + echo +else + echo " NOT FOUND" +fi + +echo -e "Checking for HTTP-Loadbalancing ["Server"]: " +for ((i=0 ; i< $QUERIES ; i++)) +do + printf "HEAD / HTTP/1.0\r\n\r\n" | nc $DOMAIN 80 > .nlog + S=`grep -i "Server:" .nlog | awk -F: '{print $2}'` + if ! grep "`echo ${S}| cut -b2-`" .log &>/dev/null + then + echo "${S}" + fi + cat .nlog >> .log +done +NR=`sort .log | uniq | grep -c "Server:"` +if [ $NR -gt 1 ] +then + echo " FOUND" + METHODS="$METHODS HTTP[Server]" +else + echo " NOT FOUND" +fi +echo +rm .nlog .log + + +echo -e -n "Checking for HTTP-Loadbalancing ["Date"]: " +D4= +for ((i=0 ; i<$QUERIES ; i++)) +do + D=`printf "HEAD / HTTP/1.0\r\n\r\n" | nc $DOMAIN 80 | grep "Date:" | awk '{print $6}'` + printf "$D, " + + Df=$(echo " $D" | sed -e 's/:0/:/g' -e 's/ 0/ /g') + D1=$(echo ${Df} | awk -F: '{print $1}') + D2=$(echo ${Df} | awk -F: '{print $2}') + D3=$(echo ${Df} | awk -F: '{print $3}') + if [ "$D4" = "" ]; then D4=0; fi + + if [ $[ $D1 * 3600 + $D2 * 60 + $D3 ] -lt $D4 ] + then + echo "FOUND" + METHODS="$METHODS HTTP[Date]" + break; + fi + + D4="$[ $D1 * 3600 + $D2 * 60 + $D3 ]" + if [ $i -eq $[$QUERIES - 1] ] + then + echo "NOT FOUND" + fi +done + + +echo -e -n "\nChecking for HTTP-Loadbalancing ["Diff"]: " +for ((i=0 ; i<$QUERIES ; i++)) +do + printf "HEAD / HTTP/1.0\r\n\r\n" | nc $DOMAIN 80 | grep -v -e "Date:" -e "Set-Cookie" > .nlog + + if ! cmp .log .nlog &>/dev/null && [ -e .log ] + then + echo "FOUND" + diff .log .nlog | grep -e ">" -e "<" + METHODS="$METHODS HTTP[Diff]" + break; + fi + + cp .nlog .log + + if [ $i -eq $[$QUERIES - 1] ] + then + echo "NOT FOUND" + fi +done + +rm .nlog .log + + +if [ "$METHODS" != "" ] +then + echo + echo $DOMAIN does Load-balancing. Found via Methods: $METHODS + echo +else + echo + echo $DOMAIN does NOT use Load-balancing. + echo +fi + + diff --git a/lbd.sig b/lbd.sig Binary files differnew file mode 100644 index 000000000000..e7e676ca2499 --- /dev/null +++ b/lbd.sig |