Advertisement
perjespersson

check flags

Dec 4th, 2019
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. #Cut the flags to the variable flags
  4. flags=$(dig google.se | grep -o -P '(?<=flags: ).*(?=;)')
  5. if echo $flags | grep -q ra; then
  6. echo "It responds to recursive queries"
  7. else
  8. echo "It doesn't respond to recursive queries"
  9. fi
  10.  
  11. if echo $flags | grep -q aa; then
  12. echo "It responds authoritatively"
  13. else
  14. echo "It doesn't responds authoritatively"
  15. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement