当前位置:网站首页>Cookie encryption 8
Cookie encryption 8
2022-06-30 01:25:00 【Fan zhidu】
Refer to the website 【2021-06-07】JS Reverse flush cookie( newest v Values obtained )_ o J~ The blog of -CSDN Blog _ Flush reverse
Supplementary information , Read cookie, Refer to the website :https://www.jb51.net/article/249192.htm
You can also for cookie Add an expiration time ( With UTC or GMT Time ). By default ,cookie Delete... When browser is closed :
document.cookie="username=John Doe; expires=Thu, 18 Dec 2043 12:00:00 GMT";You can use path Parameters tell the browser cookie The path of . By default ,cookie Belongs to the current page .
document.cookie="username=John Doe; expires=Thu, 18 Dec 2043 12:00:00 GMT; path=/";Supplementary knowledge :cookie Generation process of
(1) When the client's request arrives at the server , On the server side, you can Cookie The value is written in the response header and returned to the client .
(2) Client side tools ( Such as browser ) When rendering a page , By in the page JavaScript Code generation Cookie value .
take Cookie and JavaScript Combined to achieve anti - crawler . We were studying JavaScript I learned that ,Location object ( namely window.location object ) You can redirect your browser to another page , Can we take advantage of this feature ? If in HTML The code introduces a that redirects the browser to the target page JavaScript file , And in this file to achieve random string generation and Cookie Set function , Then the server side only needs to verify Cookie The rule of value .
A simple verification is that a page springboard needs to be set here , When a user wants to request a content page , The browser will jump to the springboard page first , Execute... On the page JavaScript Code in file , complete Cookie Values are generated and set before redirecting the browser to the content page . So there are some hook Go to the main page , however cookie The encryption process cannot be disconnected .
(3) stay HTML file JavaScript The file import , The code is as follows :<script src="fet.js"></script>JavaScript The code generates a timestamp of the current time , The timestamp is spliced with a random string and then used as Cookie Value to initiate the request . Now nginx Not only do you need to verify random strings according to rules , You also need to get the current timestamp of the server , take Cookie Value and the current timestamp , When the time difference exceeds a certain time ( Such as 5
second ), It can be concluded that Cookie It's a forgery .
Target website :aHR0cDovL3guMTBqcWthLmNvbS5jbi9zdG9ja3BpY2svc2VhcmNoP3R5cGVkPTEmcHJlUGFyYW1zPSZ0cz0xJmY9MSZxcz1yZXN1bHRfcmV3cml0ZSZzZWxmc2VjdHNuPSZxdWVyeXR5cGU9c3RvY2smc2VhcmNoZmlsdGVyPSZ0aWQ9c3RvY2twaWNrJnc9JUU4JThBJUFGJUU3JTg5JTg3JnF1ZXJ5YXJlYT0=
Grab the bag directly , I found that I visited twice , For the second time, I took cookie,v Parameters


First visit There are two things , The first is to redirect the URL , The second is to set cookie
direct 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;
}
});
})()
Direct pursuit js,v Encrypted location , Follow up on your own :

then fidder simulation , Successful visit
边栏推荐
- ctfshow 大赛原题 680-695
- I, 33 years old, ByteDance test development, unveiled the real income of Beijing "test post"
- [recommended] how to quickly locate a bug during testing
- Is the course of digging money reliable and safe to open an account?
- The Web3 era is coming? Inventory of five Web3 representative projects | footprint analytics
- MySql函数
- Can mango hypermedia, which "braves the wind and waves", go ashore?
- 2022-06-29: x = {a, B, C, D}, y = {e, F, G, H}, the length of the two small arrays X and Y is 4. If yes: a + e = B + F = C + G = D + H
- What are the top ten securities companies? In addition, is it safe to open a mobile account?
- [three.js] Web3D first experience
猜你喜欢

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

Cookie加密12

MySQL installation steps (detailed)

第八届“互联网+”大赛 | 云原生赛道邀你来挑战

Seata 与三大平台携手编程之夏,百万奖金等你来拿

【机器学习Q&A】数据抽样和模型验证方法、超参数调优以及过拟合和欠拟合问题

【PyTorch实战】生成对抗网络GAN:生成动漫人物头像

Seata and the three platforms are working together in the summer of programming. Millions of bonuses are waiting for you

I learned database at station B (V): DQL exercise

【推荐系统】基于用户的协同过滤简明原理与代码实现
随机推荐
Unity编辑器随机生成物体,更换场景之后物体丢失问题解决
关于c语言main函数中int argc,char **argv的理解
Difference between test plan and test plan
3-6sql injection website instance step 5: break through the background to obtain web administrator permissions
How to view the size of all files in a folder?
post请求出现WebKitFormBoundaryk的解决办法
Ansible ad-hoc temporary command
VIM editor common instructions
【机器学习Q&A】余弦相似度、余弦距离、欧式距离以及机器学习中距离的含义
城市规划馆在设计制作上需要注意什么
英伟达Jetson Nano的初步了解
Internal class usage scenarios, syntax and principle explanations
Pytroch Learning Notes 6: NN network layer convolution layer
Quick pow: how to quickly find power
阅读,是最廉价的高贵
MySQL function
postman 之接口关联
Cookie加密15 登录加密
ES6 one line code for array de duplication
眼底出血术后需注意事项//每天必看