Advertisement
phieulang1993

crypt5

Sep 7th, 2015
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.79 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. from selenium import webdriver
  4.  
  5. cipher = "00 0c 3a 1e 52 02 53 02 51 0c 5d 56 51 5a 5f 5f 5a 51 00 05 53 56 0a 5e 00 52 05 03 51 50 55 03 04 52 04 0f 0f 54 52 57 03 52 04 4e"
  6.  
  7. profile=webdriver.FirefoxProfile()
  8. driver=webdriver.Firefox(profile)
  9.  
  10. charsets = "}abcdef1234567890"
  11. s1 = "<h1>Smart Cipher System</h1>"
  12. driver.get('http://bow.chal.mmactf.link/~scs/crypt5.cgi')
  13.  
  14. flag = "MMA{"
  15. while 1:
  16.     for c in charsets:
  17.         name = driver.find_element_by_name('s')
  18.         name.clear()
  19.         name.send_keys(flag+c)
  20.         name.submit()
  21.         source = driver.page_source
  22.         hex_text = source[353:353-1+3*len(flag)] # 353 la vi tri tai hex thu 2 tro di trong source
  23.         if hex_text == cipher[:len(hex_text)]:
  24.             flag = flag+c
  25.             if c == "}":
  26.                 print flag
  27.                 exit(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement