파충류 해독 안주 객 등 사이트 정보 글꼴 암호 화

11470 단어 파충
파충류 해독 안주 객 등 사이트 정보 글꼴 암호 화 fanchan - secret
안주 객 사 이 트 를 예 로 들 면 우리 가 기어 오 르 는 집 값 과 다른 많은 숫자 는 모두 어 지 러 운 것 이다.
오른쪽 단 추 를 누 르 면 요 소 를 검사 하면 정상 적 인 숫자 로 보이 지만 html 코드 에 서 는 난해 하 다 는 것 을 알 수 있 습 니 다.network - doc 에 대응 하 는 response 를 보면 사용자 정의 글꼴 함수 내용 을 찾 을 수 있 습 니 다. js 에서 생 성 된 fangchan - secret 사용자 정의 글꼴 입 니 다.
!function(w,d){if(!w.ActiveXObject||d.documentMode>8){d.write("<style>@font-face{font-family:'fangchan-secret';src:url('data:application/font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwR1NVQiCLJXoAAAE4AAAAVE9TLzL4XQjtAAABjAAAAFZjbWFwq8N/ZAAAAhAAAAIuZ2x5ZuWIN0cAAARYAAADdGhlYWQWNO3tAAAA4AAAADZoaGVhCtADIwAAALwAAAAkaG10eC7qAAAAAAHkAAAALGxvY2ED7gSyAAAEQAAAABhtYXhwARgANgAAARgAAAAgbmFtZTd6VP8AAAfMAAACanBvc3QFRAYqAAAKOAAAAEUAAQAABmb+ZgAABLEAAAAABGgAAQAAAAAAAAAAAAAAAAAAAAsAAQAAAAEAAOZ1vbJfDzz1AAsIAAAAAADZVtFuAAAAANlW0W4AAP/mBGgGLgAAAAgAAgAAAAAAAAABAAAACwAqAAMAAAAAAAIAAAAKAAoAAAD/AAAAAAAAAAEAAAAKADAAPgACREZMVAAObGF0bgAaAAQAAAAAAAAAAQAAAAQAAAAAAAAAAQAAAAFsaWdhAAgAAAABAAAAAQAEAAQAAAABAAgAAQAGAAAAAQAAAAEERAGQAAUAAAUTBZkAAAEeBRMFmQAAA9cAZAIQAAACAAUDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFBmRWQAQJR2n6UGZv5mALgGZgGaAAAAAQAAAAA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ECQADAB4AuAADAAEECQAEAB4A1gADAAEECQAFABYA9AADAAEECQAGAB4BCgADAAEECQAKAFYBKAADAAEECQALACYBfmZhbmdjaGFuLXNlY3JldFJlZ3VsYXJmYW5nY2hhbi1zZWNyZXRmYW5nY2hhbi1zZWNyZXRWZXJzaW9uIDEuMGZhbmdjaGFuLXNlY3JldEdlbmVyYXRlZCBieSBzdmcydHRmIGZyb20gRm9udGVsbG8gcHJvamVjdC5odHRwOi8vZm9udGVsbG8uY29tAGYAYQBuAGcAYwBoAGEAbgAtAHMAZQBjAHIAZQB0AFIAZQBnAHUAbABhAHIAZgBhAG4AZwBjAGgAYQBuAC0AcwBlAGMAcgBlAHQAZgBhAG4AZwBjAGgAYQBuAC0AcwBlAGMAcgBlAHQAVgBlAHIAcwBpAG8AbgAgADEALgAwAGYAYQBuAGcAYwBoAGEAbgAtAHMAZQBjAHIAZQB0AEcAZQBuAGUAcgBhAHQAZQBkACAAYgB5ACAAcwB2AGcAMgB0AHQAZgAgAGYAcgBvAG0AIABGAG8AbgB0AGUAbABsAG8AIABwAHIAbwBqAGUAYwB0AC4AaAB0AHQAcAA6AC8ALwBmAG8AbgB0AGUAbABsAG8ALgBjAG8AbQAAAAIAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwECAQMBBAEFAQYBBwEIAQkBCgELAQwAAAAAAAAAAAAAAAAAAAAA') format('truetype')}.strongbox{font-family:'fangchan-secret','Hiragino Sans GB','Microsoft yahei',Arial,sans-serif,'  '!important}</style>")}else{d.write("<style>@font-face{font-family:'fangchan-secret';src:url('//fangfe.58.com/sfont/7d1795d340200956d4b63cf15703675c.eot')}.strongbox{font-family:'fangchan-secret','Hiragino Sans GB','Microsoft yahei',Arial,sans-serif,'  '!important}.strongbox{visibility:hidden}</style>");var i=d.createElement('img');i.onerror=function(){setTimeout(function(){var s=document.createElement('style'),n=document.getElementsByTagName('script')[0];s.type='text/css';s.styleSheet.cssText='.strongbox{visibility:visible!important}';n.parentNode.insertBefore(s,n);},1300)};i.src='//fangfe.58.com/sfont/7d1795d340200956d4b63cf15703675c.eot';}}(window,document);

그리고 사 이 트 는 몇 초 마다 (사이트 마다 다 르 게) fangchan - secret 의 key 를 바 꿉 니 다. 바로 그 긴 꼬치 AAAAALAIAAAAwar1N... AAA 입 니 다.그래서 우 리 는 간단하게 사전 대응 관 계 를 쓸 수 없다. 그러나 반복 적 으로 비교 한 후에 이것 은 무 작위 로 문 자 를 바 꾸 는 것 임 을 알 게 되 었 다.
glyphdict = {
    'glyph00001': '0',
    'glyph00002': '1',
    'glyph00003': '2',
    'glyph00004': '3',
    'glyph00005': '4',
    'glyph00006': '5',
    'glyph00007': '6',
    'glyph00008': '7',
    'glyph00009': '8',
    'glyph00010': '9'
}

그래서 우 리 는 인터넷 주소 에서 얻 은 fangchan - secret 의 key 에 따라 디 코딩 할 수 있 습 니 다. 구체 적 인 코드 는 다음 과 같 습 니 다. 그 중에서 bs 64str 는 웹 페이지 의 내용 이 정규 적 으로 일치 하 는 key 입 니 다.
bs64_str = re.findall("charset=utf-8;base64,(.*?)'\)", html_str)[0]
import base64
import re
from io import BytesIO
from fontTools.ttLib import TTFont

def get_page_show_ret(mystr, bs64_str):
    '''
    :param mystr:        
    :param bs64_str:      
    :return:        
    '''
    font = TTFont(BytesIO(base64.decodebytes(bs64_str.encode())))
    c = font['cmap'].tables[0].ttFont.tables['cmap'].tables[0].cmap
    ret_list = []
    for char in mystr:
        decode_num = ord(char)
        if decode_num in c:
            num = c[decode_num]
            num = int(num[-2:]) - 1
            ret_list.append(num)
        else:
            ret_list.append(char)
    ret_str_show = ''
    for num in ret_list:
        ret_str_show += str(num)
    return ret_str_show

좋은 웹페이지 즐겨찾기