Guest User

Untitled

a guest
Mar 22nd, 2017
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.99 KB | None | 0 0
  1. #!bin/bash
  2.  
  3. # make GET request, save the resulting page in out.txt and get
  4. # the string with two numbers
  5. string=`curl -s --header "X-0x0ACE-Key: rqpRWeogGbrv69RMpWzEdLeNjPam0XkJYe3lo1OJKqYZQ285y4nwAVkxDbalPn5K" http://5.9.247.121/d34dc0d3 | tee out.txt | grep "</span><br /><br /><br />"`
  6. echo end curl
  7.  
  8. # Finish of parsing of interesting numbers
  9. first=`echo $string | awk '{print $1}' | cut -d'[' -f2 | cut -d',' -f1`
  10. second=`echo $string | awk '{print $3}' | cut -d']' -f1`
  11.  
  12. # Estimate mid prime
  13. echo prime
  14. mid_prime=`./prime_all $first $second`
  15. echo end prime
  16.  
  17. # Compose resulting list of numbers
  18. solution=${mid_prime::-1}
  19.  
  20. # Parse the same GET request result to obtain the "verification"
  21. # string
  22. verification=`cat out.txt | grep hidden | awk '{print $4}' | cut -d'"' -f2`
  23.  
  24. echo sending
  25. curl -v -i -H "Expect:" --header "X-0x0ACE-Key: rqpRWeogGbrv69RMpWzEdLeNjPam0XkJYe3lo1OJKqYZQ285y4nwAVkxDbalPn5K" http://5.9.247.121/d34dc0d3 --data "verification=$verification&solution=$solution"
Advertisement
Add Comment
Please, Sign In to add comment