篇對xici.net 西祠衚衕自動發帖的總結

NO IMAGE

對於登陸, 上篇博文已經說過了。對於發帖,沒有想到還是有點蹊蹺,也出現了類似登陸時候的一個code,這個隱藏域的name是h,它的值是引用了2個js,對這個title和content進行了一些處理。我通過對js的下載分析,然後一起把這個程式碼那給大家,一看就可以用了。如果這個h值錯誤的話,會報給你“你發的速度太快了,坐下來休息一會。。如此的錯誤”

post的引數如下,亂碼是gbk的編碼在firebug下看到亂碼:

隱藏域:OpType 
隱藏域:doc_type 0
隱藏域:doctext 
puttype 1
refType 
城市:成都 doc_topic 3é??
內容:doc_text 3é??1úì??y°2??óú3¤?3??£???ó-?úà′?a·??a?§£??a?ú°ìàí?à1?ê?D?£?è?2??a·??£
標題:doc_title 3é??1úì??y°2?ú?ú?a?§

h 0C8F44197CE3F340E90183795EF0EB37
keyCode 1313590238277

標題:sTitle 3é??1úì??y°2?ú?ú?a?§
驗證碼:verifyimg 1???

 

 

主要是這個h的獲取,我直接把函式貼上來,這個地方的h2函式和上次的不一樣:

function P(in_str) {
var s = in_str.replace(new RegExp('(<[^>]*>)|([ \f\n\r\t]*)', 'g'), '');
for (i = 0; i < 32; i  ) s = s.replace(new RegExp('&#'   i   ';', 'g'), String.fromCharCode(i));
var he = new Array("AElig", 198, "Aacute", 193, "Acirc", 194, "Agrave", 192, "Alpha", 913, "Aring", 197, "Atilde", 195, "Auml", 196, "Beta", 914, "Ccedil", 199, "Chi", 935, "Dagger", 8225, "Delta", 916, "ETH", 208, "Eacute", 201, "Ecirc", 202, "Egrave", 200, "Epsilon", 917, "Eta", 919, "Euml", 203, "Gamma", 915, "Iacute", 205, "Icirc", 206, "Igrave", 204, "Iota", 921, "Iuml", 207, "Kappa", 922, "Lambda", 923, "Mu", 924, "Ntilde", 209, "Nu", 925, "OElig", 338, "Oacute", 211, "Ocirc", 212, "Ograve", 210, "Omega", 937, "Omicron", 927, "Oslash", 216, "Otilde", 213, "Ouml", 214, "Phi", 934, "Pi", 928, "Prime", 8243, "Psi", 936, "Rho", 929, "Scaron", 352, "Sigma", 931, "THORN", 222, "Tau", 932, "Theta", 920, "Uacute", 218, "Ucirc", 219, "Ugrave", 217, "Upsilon", 933, "Uuml", 220, "Xi", 926, "Yacute", 221, "Yuml", 376, "Zeta", 918, "aacute", 225, "acirc", 226, "acute", 180, "aelig", 230, "agrave", 224, "alefsym", 8501, "alpha", 945, "and", 8869, "ang", 8736, "aring", 229, "asymp", 8773, "atilde", 227, "auml", 228, "bdquo", 8222, "beta", 946, "brvbar", 166, "bull", 8226, "cap", 8745, "ccedil", 231, "cedil", 184, "cent", 162, "chi", 967, "circ", 710, "clubs", 9827, "cong", 8773, "copy", 169, "crarr", 8629, "cup", 8746, "curren", 164, "dArr", 8659, "dagger", 8224, "darr", 8595, "deg", 176, "delta", 948, "diams", 9830, "divide", 247, "eacute", 233, "ecirc", 234, "egrave", 232, "empty", 8709, "emsp", 8195, "ensp", 8194, "epsilon", 949, "equiv", 8801, "eta", 951, "eth", 240, "euml", 235, "euro", 8364, "exist", 8707, "fnof", 402, "forall", 8704, "frac12", 189, "frac14", 188, "frac34", 190, "frasl", 8260, "gamma", 947, "ge", 8805, "gt", 62, "hArr", 8660, "harr", 8596, "hearts", 9829, "hellip", 8230, "iacute", 237, "icirc", 238, "iexcl", 161, "igrave", 236, "image", 8465, "infin", 8734, "int", 8747, "iota", 953, "iquest", 191, "isin", 8712, "iuml", 239, "kappa", 954, "lArr", 8656, "lambda", 955, "lang", 9001, "laquo", 171, "larr", 8592, "lceil", 8968, "ldquo", 8220, "le", 8804, "lfloor", 8970, "lowast", 8727, "loz", 9674, "lrm", 8206, "lsaquo", 8249, "lsquo", 8216, "lt", 60, "macr", 175, "mdash", 8212, "micro", 181, "middot", 183, "minus", 8722, "mu", 956, "nabla", 8711, "nbsp", 160, "ndash", 8211, "ne", 8800, "ni", 8715, "not", 172, "notin", 8713, "nsub", 8836, "ntilde", 241, "nu", 957, "oacute", 243, "ocirc", 244, "oelig", 339, "ograve", 242, "oline", 8254, "omega", 969, "omicron", 959, "oplus", 8853, "or", 8870, "ordf", 170, "ordm", 186, "oslash", 248, "otilde", 245, "otimes", 8855, "ouml", 246, "para", 182, "part", 8706, "permil", 8240, "perp", 8869, "phi", 966, "pi", 960, "piv", 982, "plusmn", 177, "pound", 163, "prime", 8242, "prod", 8719, "prop", 8733, "psi", 968, "quot", 34, "rArr", 8658, "radic", 8730, "rang", 9002, "raquo", 187, "rarr", 8594, "rceil", 8969, "rdquo", 8221, "real", 8476, "reg", 174, "rfloor", 8971, "rho", 961, "rlm", 8207, "rsaquo", 8250, "rsquo", 8217, "sbquo", 8218, "scaron", 353, "sdot", 8901, "sect", 167, "shy", 173, "sigma", 963, "sigmaf", 962, "sim", 8764, "spades", 9824, "sub", 8834, "sube", 8838, "sum", 8722, "sup", 8835, "sup1", 185, "sup2", 178, "sup3", 179, "supe", 8839, "szlig", 223, "tau", 964, "there4", 8756, "theta", 952, "thetasym", 977, "thinsp", 8201, "thorn", 254, "tilde", 732, "times", 215, "trade", 8482, "uArr", 8657, "uacute", 250, "uarr", 8593, "ucirc", 251, "ugrave", 249, "uml", 168, "upsih", 978, "upsilon", 965, "uuml", 252, "weierp", 8472, "xi", 958, "yacute", 253, "yen", 165, "yuml", 255, "zeta", 950, "zwj", 8205, "zwnj", 8204, "amp", 38);
for (i = 0; i < he.length / 2; i  ) s = s.replace(new RegExp('&'   he[i * 2]   ';', 'g'), String.fromCharCode(he[i * 2   1]));
s = s.replace(new RegExp('[^A-Za-z0-9_\u4e00-\u9fa5]', 'g'), '');
return s;
}
function C(x, l) {
function B(n, c) {
return (n << c) | (n >>> (32 - c));
}
function S(x, y) {
var l = (x & 0xFFFF)   (y & 0xFFFF);
var w = (x >> 16)   (y >> 16)   (l >> 16);
return (w << 16) | (l & 0xFFFF);
}
function M(q, a, b, x, s, t) {
return S(B(S(S(a, q), S(x, t)), s), b);
}
function F(a, b, c, d, x, s, t) {
return M((b & c) | ((~b) & d), a, b, x, s, t);
}
function G(a, b, c, d, x, s, t) {
return M((b & d) | (c & (~d)), a, b, x, s, t);
}
function H(a, b, c, d, x, s, t) {
return M(b ^ c ^ d, a, b, x, s, t);
}
function I(a, b, c, d, x, s, t) {
return M(c ^ (b | (~d)), a, b, x, s, t);
}
function BH(b) {
var h = "0123456789ABCDEF";
var s = "";
for (var i = 0; i < b.length * 4; i  ) {
s  = h.charAt((b[i >> 2] >> ((i % 4) * 8   4)) & 0xF)   h.charAt((b[i >> 2] >> ((i % 4) * 8)) & 0xF);
}
return s;
}
x[l >> 5] |= 0x80 << ((l) % 32);
x[(((l   64) >>> 9) << 4)   14] = l;
var a = 1732584193;
var b = -271733879;
var c = -1732584194;
var d = 271733878;
for (var i = 0; i < x.length; i  = 16) {
var oa = a;
var ob = b;
var oc = c;
var od = d;
a = F(a, b, c, d, x[i   0], 7, -680876936);
d = F(d, a, b, c, x[i   1], 12, -389564586);
c = F(c, d, a, b, x[i   2], 17, 606105819);
b = F(b, c, d, a, x[i   3], 22, -1044525330);
a = F(a, b, c, d, x[i   4], 7, -176418897);
d = F(d, a, b, c, x[i   5], 12, 1200080426);
c = F(c, d, a, b, x[i   6], 17, -1473231341);
b = F(b, c, d, a, x[i   7], 22, -45705983);
a = F(a, b, c, d, x[i   8], 7, 1770035416);
d = F(d, a, b, c, x[i   9], 12, -1958414417);
c = F(c, d, a, b, x[i   10], 17, -42063);
b = F(b, c, d, a, x[i   11], 22, -1990404162);
a = F(a, b, c, d, x[i   12], 7, 1804603682);
d = F(d, a, b, c, x[i   13], 12, -40341101);
c = F(c, d, a, b, x[i   14], 17, -1502002290);
b = F(b, c, d, a, x[i   15], 22, 1236535329);
a = G(a, b, c, d, x[i   1], 5, -165796510);
d = G(d, a, b, c, x[i   6], 9, -1069501632);
c = G(c, d, a, b, x[i   11], 14, 643717713);
b = G(b, c, d, a, x[i   0], 20, -373897302);
a = G(a, b, c, d, x[i   5], 5, -701558691);
d = G(d, a, b, c, x[i   10], 9, 38016083);
c = G(c, d, a, b, x[i   15], 14, -660478335);
b = G(b, c, d, a, x[i   4], 20, -405537848);
a = G(a, b, c, d, x[i   9], 5, 568446438);
d = G(d, a, b, c, x[i   14], 9, -1019803690);
c = G(c, d, a, b, x[i   3], 14, -187363961);
b = G(b, c, d, a, x[i   8], 20, 1163531501);
a = G(a, b, c, d, x[i   13], 5, -1444681467);
d = G(d, a, b, c, x[i   2], 9, -51403784);
c = G(c, d, a, b, x[i   7], 14, 1735328473);
b = G(b, c, d, a, x[i   12], 20, -1926607734);
a = H(a, b, c, d, x[i   5], 4, -378558);
d = H(d, a, b, c, x[i   8], 11, -2022574463);
c = H(c, d, a, b, x[i   11], 16, 1839030562);
b = H(b, c, d, a, x[i   14], 23, -35309556);
a = H(a, b, c, d, x[i   1], 4, -1530992060);
d = H(d, a, b, c, x[i   4], 11, 1272893353);
c = H(c, d, a, b, x[i   7], 16, -155497632);
b = H(b, c, d, a, x[i   10], 23, -1094730640);
a = H(a, b, c, d, x[i   13], 4, 681279174);
d = H(d, a, b, c, x[i   0], 11, -358537222);
c = H(c, d, a, b, x[i   3], 16, -722521979);
b = H(b, c, d, a, x[i   6], 23, 76029189);
a = H(a, b, c, d, x[i   9], 4, -640364487);
d = H(d, a, b, c, x[i   12], 11, -421815835);
c = H(c, d, a, b, x[i   15], 16, 530742520);
b = H(b, c, d, a, x[i   2], 23, -995338651);
a = I(a, b, c, d, x[i   0], 6, -198630844);
d = I(d, a, b, c, x[i   7], 10, 1126891415);
c = I(c, d, a, b, x[i   14], 15, -1416354905);
b = I(b, c, d, a, x[i   5], 21, -57434055);
a = I(a, b, c, d, x[i   12], 6, 1700485571);
d = I(d, a, b, c, x[i   3], 10, -1894986606);
c = I(c, d, a, b, x[i   10], 15, -1051523);
b = I(b, c, d, a, x[i   1], 21, -2054922799);
a = I(a, b, c, d, x[i   8], 6, 1873313359);
d = I(d, a, b, c, x[i   15], 10, -30611744);
c = I(c, d, a, b, x[i   6], 15, -1560198380);
b = I(b, c, d, a, x[i   13], 21, 1309151649);
a = I(a, b, c, d, x[i   4], 6, -145523070);
d = I(d, a, b, c, x[i   11], 10, -1120210379);
c = I(c, d, a, b, x[i   2], 15, 718787259);
b = I(b, c, d, a, x[i   9], 21, -343485551);
a = S(a, oa);
b = S(b, ob);
c = S(c, oc);
d = S(d, od);
}
return BH(Array(a, b, c, d));
}
function H2(s, sessionId, z) {
function SB(s) {
var b = Array();
var m = (1 << z) - 1;
for (var i = 0; i < s.length * z; i  = z) b[i >> 5] |= (s.charCodeAt(i / z) & m) << (i % 32);
return b;
}
if (!z) z = 16;
Z = C(SB(s), s.length * z)   "-"   sessionId;
return C(SB(Z), Z.length * z);
}
function GetCode(title, content, sessionId)
{
title = title.replace(new RegExp('[^A-Za-z0-9_\u4e00-\u9fa5]','g'),'');
return H2("1154700"   title   P(content), sessionId, 16);	
}

 

使用方法就是直接GetCode就好了,3個引數分別是標題,內容和sessionId的值。。

搞了我一整天,這個登陸 發帖。。不過下午還去游泳了,晚上還去吃了滋味烤魚,整體來說不算累。。。