博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Detecting HTTP Load Balancers using Halberd
阅读量:2435 次
发布时间:2019-05-10

本文共 4883 字,大约阅读时间需要 16 分钟。

We covered Load Balancing Detection using LBD in a previous video. In this one, we will cover a more advanced and stable tool called . Halberd detects HTTP based Load Balancing by using a host  of techniques - differences in HTTP response headers, timestamps, cookies and a couple other techniques. We will run Halberd on Msn.com and see how it is able to figure out that there are actually 15 servers behind the load balancer running various versions of the IIS web server.

I would highly recommend that you and try it out. This tool is a must have when pentesting SaaS based installations.

 

Download:

 

2.

Finding Subdomains using Goorecon

In the Information Gathering stage of a pentest, we are interested in finding out the various sub-domains of our target domain. As we have seen in previous videos, querying DNS servers using zone transfer requests or trying to retrieve entries using a dictionary / brute-forcing attack, is a good start, but fails in most cases. Another alternate technique to figure out sub-domains is to query google and check if it has found any sub-domains during it's web mining exercise on the target. is just the tool we need in order to do this.

In this video, we will find the various publicly available sub-domains of Cnn.com using Goorecon. Goorecon is included in Backtrack 4.

 

3.Load Balancing has becoming an important part of the network architecture, especially for companies which host applications accessed by millions around the world. Good examples of such companies would be Google, Facebook, MSN, YouTube etc. In most cases, Load Balancing for web applications in particular, happens using a DNS based balancer which cycles through the different IPs in the server farm in a round robin fashion, or using a HTTP Load Balancer device which multiplexes incoming connections to one of the servers in the farm.

As one can imagine from a pentest perspective, detection of load balancers is an important step in the information gathering stage. In this video we will look at a simple load balancing detector tool called , which uses both DNS and HTTP based techniques to detect load balancers. During the tests, we find that the DNS detection works perfectly, however the HTTP based detection techniques, does give false positives at times (which the tool author acknowledges). LBD is included in the Backtrack 4 iso.

 

 

4.evilgrade

 

 

#!/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

转载地址:http://uwqmb.baihongyu.com/

你可能感兴趣的文章
测试应该怎么做?(1)
查看>>
在不清楚数据表字段数据分布的情况下,应该创建什么类型的索引?
查看>>
当你的思路与高管有分歧时,而你又无法说服他们接受你的建议时,你该怎么办?...
查看>>
Daily Stand-up Meeting的反馈
查看>>
Ceph:一个 Linux PB 级分布式文件系统
查看>>
项目(Explore)总结之项目范围管理
查看>>
如何杀掉Teradata的session
查看>>
Oracle字符集 ZHS16GBK VS WE8ISO8859P1
查看>>
[原创]沟通案例之多头领导、沟通不到位
查看>>
项目管理随笔
查看>>
Oracle vs PostgreSQL,研发注意事项(2)-DDL语句与事务
查看>>
如何实现单机版DataBase:概览
查看>>
让业务实现回归数据库
查看>>
Oracle vs PostgreSQL,研发注意事项(3)- 事务回滚之UPDATE操作解析
查看>>
Oracle vs PostgreSQL,研发注意事项(1)-查询锁表
查看>>
PostgreSQL Page页结构解析(2)- 页头和行数据指针
查看>>
PostgreSQL Page页结构解析(1)-基础
查看>>
I am back.
查看>>
ORA-21561: OID generation failed
查看>>
Mongodb3.0:终于具备压缩功能了
查看>>