int0x76

Scan your network for vulnerable OpenSSL TLS Heartbleed

Jun 2nd, 2014
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. yum install golang
  2.  
  3. export GOPATH=~/go
  4. export GOBIN=$GOPATH
  5. mkdir $GOPATH
  6. cd $GOPATH
  7. go get github.com/FiloSottile/Heartbleed
  8.  
  9. # ls -l
  10. total 6268
  11. -rwxr-xr-x 1 root root 6409872 Apr 8 15:52 Heartbleed
  12. drwxr-xr-x 3 root root 4096 Apr 8 15:52 pkg
  13. drwxr-xr-x 3 root root 4096 Apr 8 15:52 src
  14. Check if Heartbleed executable works:
  15.  
  16. ./Heartbleed tumblr.com:443
  17. 2014/04/08 15:55:44 tumblr.com:443 - SAFE
  18.  
  19. Now scan your network (eg. 10.11.12.0/24) for open HTTPS:
  20.  
  21. nmap -PN -p 443 --open -oG - 10.11.12.0/24 | awk '$NF~/https/{print $2}'
  22. You should ha ve a list of IP like the following:
  23.  
  24. 10.11.12.1
  25. 10.11.12.3
  26. 10.11.12.4
  27. 10.11.12.5
  28. 10.11.12.6
  29. 10.11.12.13
  30. 10.11.12.14
  31. ...
  32. Copy & paste this list in a file (eg. list_443.txt), in the same path of the Heartbleed executable (in my example: ~/go/list_443.txt).
  33.  
  34. Now you may launch the Heartbleed checker in a while loop as follows:
  35.  
  36. # while read LIST ; do ./Heartbleed ${LIST}:443 ; done < list_443.txt
  37. Example output:
  38.  
  39. 2014/04/08 16:01:31 10.11.12.1:443 - SAFE
  40. 2014/04/08 16:01:34 10.11.12.3:443 - SAFE
  41. 2014/04/08 16:04:52 ([]uint8) {
  42. 00000000 02 00 79 68 65 61 72 74 62 6c 65 65 64 2e 66 69 |..yheartbleed.fi|
  43. 00000010 6c 69 70 70 6f 2e 69 6f 59 45 4c 4c 4f 57 20 53 |lippo.ioYELLOW S|
  44. 00000020 55 42 4d 41 52 49 4e 45 76 d7 6e 8a 38 30 59 03 |UBMARINEv.n.80Y.|
  45. 00000030 2c 73 be a2 1e 73 d5 af 19 37 8d 77 03 03 03 03 |,s…s…7.w….|
  46. 00000040 72 60 d9 30 ca 7a d1 18 7f bd 5f f4 18 0f 6c d6 |r`.0.z…._…l.|
  47. 00000050 c5 6d 06 4e 1e cf 7d 3d d0 1b d8 70 16 7f 51 b2 |.m.N..}=…p..Q.|
  48. 00000060 91 dd db 85 2c d3 7c 50 40 46 04 ee d2 dd 13 14 |….,.|P@F……|
  49. 00000070 73 3f e2 bc cf ce 77 40 1f 28 da dc 82 f6 57 62 |s?….w@.(….Wb|
  50. 00000080 2b ac e8 01 59 9a 18 2a 7d e3 be d4 |+…Y..*}…|
  51. }
  52. 2014/04/08 16:04:52 10.11.12.4:8443 - VULNERABLE
Advertisement
Add Comment
Please, Sign In to add comment