Skip to content

Instantly share code, notes, and snippets.

@fulicat
Forked from chitanda/postFakeAppleID-Parameter Ver
Last active January 9, 2024 07:05
Show Gist options
  • Save fulicat/24f44fdc032900bc1a4d to your computer and use it in GitHub Desktop.
Save fulicat/24f44fdc032900bc1a4d to your computer and use it in GitHub Desktop.
循环往钓鱼网站库里写虚假帐号和密码。目前自动模式只支持form表格提交的钓鱼网站。使用方法:在钓鱼网站页面打开浏览器开发者工具,将下面的代码复制到`console`中运行即可。自定义效果的话只需要按照函数说明的样式填写四个参数即可。eg loopPost(10,12,2000,2000)
/**
* [loopPost 循环往钓鱼网站库里写虚假帐号和密码。目前自动模式只支持form表格提交的钓鱼网站]
* @param {[type]} min [帐号和密码的最小长度,默认为6]
* @param {[type]} max [帐号和密码的最大长度,默认为12]
* @param {[type]} timeGap [发送数据的时间间隔,单位为ms,不需要填写单位。默认为500]
* @param {[type]} times [一共发送的虚假帐号个数,默认为5000]
* @return {[type]} [description]
*/
function loopPost(min,max,timeGap,times){
if(!timeGap){
timeGap=500;
}
if(!times){
times=5000;
}
var i=0;
var scr = document.createElement('script');
scr.type = 'text/javascript';
scr.src = "//libs.baidu.com/jquery/1.9.0/jquery.min.js";
document.head.appendChild(scr);
scr.onload=function(){
var sh=setInterval(function(){
postFake(min,max);
i++;
if(!(i-times)){
clearInterval(sh);
}
},timeGap)
}
}
/**
* [makeFake 生成一个随机字符串]
* @param {[Number]} minlength [设定字符串最小长度,默认为6]
* @param {[Number]} maxlength [设定字符串最大长度,默认为12]
* @return {[string]} [最终产生的字符串]
*/
function makeFake(minlength,maxlength){
console.log(minlength);
console.log(maxlength);
if(!arguments[0]||!arguments[1]){//不能用length判断,因为会传入undefined做变量
minlength=6;
maxlength=12;
}
var randomLength= Math.floor(Math.random()*(maxlength-minlength))+minlength;
var text = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for( var i=0; i < randomLength; i++ )
text += possible.charAt(Math.floor(Math.random() * possible.length));
return text;
}
function postFake(min,max){
//获取页面上的虚假提交信息,自动构造提交链接和变量名
var submitUrl=$('form').attr('action');
var submitUser=$('input[type=text]:visible').eq(0).attr('name');
var submitPwd=$('input[type=password]').eq(0).attr('name');
//构造虚假的用户名和密码,此处默认为6-12位的帐号和密码
var user=makeFake(min,max)+'@icloud.com';
var pwd=makeFake(min,max);
var data={};
data[submitUser]=user;
data[submitPwd]=pwd;
console.log(data);
$.post (submitUrl, data);
}
//自定义效果的话只需要按照说明的样式填完四个参数即可。eg loopPost(10,12,2000,2000)
loopPost();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment