onsdag 21 november 2012

Napalm Web Auth (Short Review)

Short post about Napalm Web Auth, not much to say ate this moment since it's still in beta.
OnForm Load it try to connect to host, and Check if when loaded contains "Napalm Web Auth"
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
string documentText = this.webBrowser1.DocumentText;
if (documentText.Contains("Napalm Web Auth"))
{
this.tsServStatus.ForeColor = Color.Green;
this.tsServStatus.Text = "Server Status: Online";
auth.Conned = true;
auth.start();
}
}
view raw gistfile1.cs hosted with ❤ by GitHub
After that we have the login it self pretty straight forward
private void btnLogin_Click(object sender, EventArgs e)
{
if (this.txtUsername.Text != "" && this.txtPass.Text != "")
{
if (this.cbSave.Checked)
{
Settings.Default.uName = this.txtUsername.Text;
Settings.Default.uPass = this.txtPass.Text;
Settings.Default.Save();
}
else
{
Settings.Default.uName = "";
Settings.Default.uPass = "";
Settings.Default.Save();
}
string postData = string.Format("email={0}&pass={1}&login=Login", this.txtUsername.Text, this.txtPass.Text);
auth.HttpPost(auth.Host + "login.php", postData);
}
else
{
MessageBox.Show("Please enter a username and password", this.Text + " - Error");
}
}
view raw gistfile1.cs hosted with ❤ by GitHub
And Finally the cheese it self once logged in,
if (auth.hWId == auth.CompHwid)
{
try
{
Application.OpenForms["Form1"].Visible = false;
Application.OpenForms["Form1"].ShowInTaskbar = false;
string text2 = string.Format("hwid={0}&download=server", auth.CompHwid);
byte[] rawAssembly = new WebClient().DownloadData(string.Concat(new string[]
{
auth.Host,
"dl",
auth.status,
".php?",
text2
}));
Assembly assembly = Assembly.Load(rawAssembly);
Type type = assembly.GetType("NWA_Server.NWA");
object obj = Activator.CreateInstance(type);
type.InvokeMember("EntryPoint", BindingFlags.Static | BindingFlags.Public | BindingFlags.InvokeMethod, null, null, null);
}
catch (Exception var_6_1B2)
{
}
view raw gistfile1.cs hosted with ❤ by GitHub
It Download the program which turn out to be a .dll, as byte[] And invoke it with entry point as "EntryPoint" and Namespace as "NWA_Server.NWA" :) Have a nice day and if there are any thing incorrect i am still learning.

Inga kommentarer:

Skicka en kommentar