当前位置:网站首页>cookie加密8
cookie加密8
2022-06-30 01:24:00 【範之度】
參考網址【2021-06-07】JS逆向之同花順cookie(最新v值獲取)_阿J~的博客-CSDN博客_同花順逆向
補充知識點,讀取cookie,參考網址:https://www.jb51.net/article/249192.htm
您還可以為 cookie 添加一個過期時間(以 UTC 或 GMT 時間)。默認情况下,cookie 在瀏覽器關閉時删除:
document.cookie="username=John Doe; expires=Thu, 18 Dec 2043 12:00:00 GMT";您可以使用 path 參數告訴瀏覽器 cookie 的路徑。默認情况下,cookie 屬於當前頁面。
document.cookie="username=John Doe; expires=Thu, 18 Dec 2043 12:00:00 GMT; path=/";補充知識:cookie的生成過程
(1)當客戶端的請求到達服務器端後,服務器端可以將Cookie值寫在響應頭中並返回給客戶端。
(2)者客戶端工具(如瀏覽器)在渲染頁面時,由頁面中的JavaScript代碼生成Cookie值。
將 Cookie 和 JavaScript 結合起來實現反爬蟲。我們之前在學習 JavaScript 時了解到,Location 對象(即window.location對象)可以將瀏覽器重定向到其他頁面,那麼是不是可以利用這個特點呢?如果在 HTML 代碼中引入一個可以將瀏覽器重定向到目標頁面的 JavaScript 文件,並且在這個文件中實現隨機字符串生成和 Cookie 設置的功能,那麼服務器端只需要校驗 Cookie 值的規則即可。
用一個簡單的驗證就是這裏還需要設置一個頁面跳板,當用戶希望請求內容頁時,瀏覽器會先跳轉到跳板頁面,在頁面中執行JavaScript 文件中的代碼,完成 Cookie 值的生成和設置後再將瀏覽器重定向到內容頁。因此有些hook到主網頁,但是cookie加密過程斷不下來。
(3)在 HTML 文件中將 JavaScript文件引入,代碼如下:<script src="fet.js"></script>JavaScript 代碼中生成當前時間的時間戳,將時間戳與隨機字符串拼接後再作為 Cookie 值發起請求。這時候 nginx 不僅需要按規則校驗隨機字符串,還需要獲取服務器的當前時間戳,將 Cookie 值中取出的時間戳與當前時間戳進行差值計算,當時間差值超過一定的時間(如 5
秒),則可以認定Cookie是偽造的。
目標網址:aHR0cDovL3guMTBqcWthLmNvbS5jbi9zdG9ja3BpY2svc2VhcmNoP3R5cGVkPTEmcHJlUGFyYW1zPSZ0cz0xJmY9MSZxcz1yZXN1bHRfcmV3cml0ZSZzZWxmc2VjdHNuPSZxdWVyeXR5cGU9c3RvY2smc2VhcmNoZmlsdGVyPSZ0aWQ9c3RvY2twaWNrJnc9JUU4JThBJUFGJUU3JTg5JTg3JnF1ZXJ5YXJlYT0=
直接用先抓包,發現訪問了兩次,第二次看帶了cookie,v參數


第一次訪問 有兩件事情,第一是重定向了網址,第二個是設置了cookie
直接hookcookie
(function() {
'use strict';
var _cookie = ""; // hook cookie
Object.defineProperty(document, 'cookie', {
set: function(val) {
console.log('cookie set->', new Date().getTime(), val);
debugger;
_cookie = val;
return val;
},
get: function() {
console.log('coookie:'+_cookie);
return _cookie;
}
});
})()
直接追到js,v的加密比特置,後續自己補充:

然後fidder模擬,訪問成功
边栏推荐
- 画画水族馆的应用特色及功能
- Varnish 基础概览3
- MySql函数
- Varnish 基础概览2
- Sfdp 超级表单开发平台 V6.0.4 正式发布
- Seata et les trois plateformes travaillent main dans la main pour programmer Summer, un million de bonus vous attend
- 田口实验法
- Using tsne to visualize the similarity of different sentences
- [mrctf2020]ezpop-1 | PHP serialization
- The Web3 era is coming? Inventory of five Web3 representative projects | footprint analytics
猜你喜欢

Quality management of functional modules of MES management system

数字垃圾是什么?跟随世界第一位AI艺术家,探索元碳艺术

Kwai reached out to the "supply side" to find the "source" of live broadcast e-commerce?

清洁、对话、带娃,扫地机摆脱“人工智障”标签

I, 33 years old, ByteDance test development, unveiled the real income of Beijing "test post"

Newton method (optimization of two variable functions)

Using tsne to visualize the similarity of different sentences

Tetris game based on STM32F103

Ansible ad-hoc temporary command

ctfshow 大赛原题 680-695
随机推荐
[proteus simulation] 8-bit port detection 8 independent keys
MySQL installation steps (detailed)
Unity编辑器随机生成物体,更换场景之后物体丢失问题解决
Machine learning notes: time series decomposition STL
How to build your own blog website by yourself
RubyMine开发工具,重构和意图操作
Statsmodels notes STL
I, 33 years old, ByteDance test development, unveiled the real income of Beijing "test post"
Precautions for postoperative fundus hemorrhage / / must see every day
一文读懂,MES管理系统模块功能
numpy的索引和图片的索引一样吗?
How to seamlessly transition from traditional microservice framework to service grid ASM
Using tsne to visualize the similarity of different sentences
Sentinel source code analysis Chapter 9 - core process - lookprocesschain finding resource processing chain
Reading is the cheapest noble
田口实验法
Cookie加密15 登录加密
快手伸手“供给侧”,找到直播电商的“源头活水”?
Wechat applet - requestsubscribemessage:fail can only be invoked by user tap gesture
2020-12-03