17.NSCTF web200

來源:互聯網
上載者:User

標籤:web安全   php   python   

這題不饒,直接編程即可

    650) this.width=650;" src="https://s4.51cto.com/wyfs02/M01/9D/61/wKioL1l_JJ7DEhckAAFY4a6JWTw767.png-wh_500x0-wm_3-wmp_4-s_1506074675.png" title="1.png" alt="wKioL1l_JJ7DEhckAAFY4a6JWTw767.png-wh_50" />

    我直接貼上我的Python代碼

    

#!/usr/bin/python#coding=utf-8import base64#ror13加密函數(密文傳入就是解密,明文傳入就是加密)def rot13(s, OffSet=13):    def encodeCh(ch):        f=lambda x: chr((ord(ch)-x+OffSet) % 26 + x)        return f(97) if ch.islower() else (f(65) if ch.isupper() else ch)    return ‘‘.join(encodeCh(c) for c in s)def decode(strs):    flag = ""#儲存flag    flag_x = ""#擷取flag中的每一個字元        strs = strs[::-1]#反轉字串        strs = base64.b64decode(strs)#base64解碼        for i in strs:#遍曆每一個字元                flag_x = ord(i)-1#每一個字元ascii碼-1        flag_x = chr(flag_x)#轉換位字串        flag = flag+flag_x#字串串連            flag = flag[::-1]#反轉字串    return flag#獲得flagdef main():    strs = "a1zLbgQsCESEIqRLwuQAyMwLyq2L5VwBxqGA3RQAyumZ0tmMvSGM2ZwB4tws"#需要破解的密碼    flag = rot13(strs)#rot13解密    flag = decode(flag)#題目解密    print flag#輸出flagif __name__ == "__main__":    main()

    注意:其中rot13是網上找的代碼

    結果如下:

    650) this.width=650;" src="https://s3.51cto.com/wyfs02/M02/9D/62/wKioL1l_JhyiCL4mAADHoJ4wUuU539.png-wh_500x0-wm_3-wmp_4-s_3269146024.png" title="2.png" alt="wKioL1l_JhyiCL4mAADHoJ4wUuU539.png-wh_50" />

本文出自 “11846238” 部落格,請務必保留此出處http://11856238.blog.51cto.com/11846238/1952480

17.NSCTF web200

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.