Im back :D!!

General technological topics without their own forum go here

Im back :D!!

Post by xTractatorix on Thu Jul 12, 2012 7:41 pm
([msg=68011]see Im back :D!![/msg])

Okay so im a bit stuck. I want to make a simple(well not proving so simple for me...) program that when the person downloads it and opens the .exe file, it sends me a email containing the public IP adress of the person who downloaded it. I really would appreciate the help.
xTractatorix
Experienced User
Experienced User
 
Posts: 61
Joined: Sun May 13, 2012 8:42 am
Blog: View Blog (0)


Re: Im back :D!!

Post by WallShadow on Thu Jul 12, 2012 8:55 pm
([msg=68012]see Re: Im back :D!![/msg])

Oh wow, this is totally not a virus! We should all totally help OP. *smirks*

jk, this is fun for me.

Once the other person executes the .exe, you've basically got his whole computer at your mercy. To send an e-mail, you'll need a program to use sockets to connect to your e-mail host and using the e-mail protocol (or whatever the fuck it's called, I just know it exists) send the e-mail. How to get his IP address, I have no fucking idea. The only thing that comes to mind right now is using tracert to find the route to, say, google.com and then print the output route to e-mail.

Actually, if anyone knows a simpler way to e-mail using a program, I'd love to know!

-WallShadow <3
User avatar
WallShadow
Contributor
Contributor
 
Posts: 594
Joined: Tue Mar 06, 2012 9:37 pm
Blog: View Blog (0)


Re: Im back :D!!

Post by Acidiferous on Fri Jul 13, 2012 5:16 am
([msg=68016]see Re: Im back :D!![/msg])

You can send a mail with a little code using SMTP.
http://en.wikipedia.org/wiki/Simple_Mai ... r_Protocol

You need to setup or find a open relay server, SMTP uses port 25 by default.
So scanning for that may be the fastest. When you find something with a open port 25, try telnetting it.

[telnet mail.test.org 25]

If your lucky you will get something like "220 mail.test.org Microsoft ESMTP MAIL Service ready at Fri, 13 jul 2012 11:17:25 +0200"
You can read more about SMTP running on Exchange, and how to test if it works, here: http://support.microsoft.com/kb/153119

(You dont have to use Exchange to set up a SMTP server, you can find many alternatives.)

You can also try [nmap --script smtp-open-relay mail.test.org/ip-range], but that can take a while.

I dont know what you are making you program in, but google should be be able to assist you with the code.
I can give you a example in C#:

Code: Select all
   MailMessage mailObj = new MailMessage("test@test.org", "test@test.org", "Subject", error.Message.ToString());
    SmtpClient SMTPServer = new SmtpClient("mail.test.org");
    SMTPServer.Send(mailObj);


You can find more information here: http://msdn.microsoft.com/en-us/library ... ssage.aspx

I use this sometimes when i test programs, normally i will have it send me a mail with the error, if an unhandled exception occurres.


Well now i got carried away, so i made something you can take a look at.
I'm using the whatsmyip.com automation ( http://www.whatismyip.com/faq/automation.asp ) to get the ip.

Code: Select all
using System;
using System.Net;
using System.Text;
using System.Net.Mail;

namespace ConsoleApplication342
{
    class Program
    {
        static void Main(string[] args)
        {

            SendMail(ExternalIp().ToString());
        }

        private static void SendMail(string sMailBody)
        {
            MailMessage mailObj = new MailMessage("test@test.org", "test@test.org", "User IP", sMailBody); //Alte: TO/FROM
            SmtpClient SMTPServer = new SmtpClient("SMTP-Server"); //SMTP SERVER, you will have to find this one your selfe
            SMTPServer.Send(mailObj);
        }

        private static IPAddress ExternalIp()
        {
            string whatIsMyIp = "http://automation.whatismyip.com/n09230945.asp";
            WebClient wc = new WebClient();
            UTF8Encoding utf8 = new UTF8Encoding();
            string requestHtml = "";
            try
            {
                requestHtml = utf8.GetString(wc.DownloadData(whatIsMyIp));
            }
            catch (WebException we)
            {
                Console.Write(we.ToString());
                Console.ReadLine();
            }

            IPAddress externalIp = IPAddress.Parse(requestHtml);
            return externalIp;
        }
    }
}


I hope i dont breake your rules by posting this, but i can se many practical and legal uses for it.
Feel free to remove it, no offence intended.
As far as i know it's legal to use open relayes, as long as you dont use them for spam.
Acidiferous
Experienced User
Experienced User
 
Posts: 61
Joined: Tue Mar 29, 2011 9:49 am
Location: Europe
Blog: View Blog (0)


Re: Im back :D!!

Post by limdis on Fri Jul 13, 2012 9:52 am
([msg=68022]see Re: Im back :D!![/msg])

Acidiferous, good info +1. This thread and your post is fine. Nothing wrong with learning 8-)
"The quieter you become, the more you are able to hear..."
"Drink all the booze, hack all the things."
User avatar
limdis
Moderator
Moderator
 
Posts: 1341
Joined: Mon Jun 28, 2010 5:45 pm
Blog: View Blog (0)


Re: Im back :D!!

Post by mShred on Sun Jul 15, 2012 3:01 am
([msg=68070]see Re: Im back :D!![/msg])

^^ True dat.
It all depends on the setup... There's always the web server option that I proposed in a thread not too long ago. Setup a webserver with some easy PHP workin on it. Have the executable file connect to your website rather than using the victim's OWN mail protocol. Seemingingly harmless port 80 traffic is gonna look a lot less suspicious than some random program using the SMTP protocol. Either way, if you REALLY need the email, then you can just as easily have your PHP script send you an email through your own computer. And it'll be a lot easier using a premade PHP mail function rather than developing your own all into an executable file.
Image

For those about to rock.
User avatar
mShred
Administrator
Administrator
 
Posts: 1707
Joined: Tue Jun 22, 2010 4:22 pm
Blog: View Blog (2)



Return to General

Who is online

Users browsing this forum: No registered users and 0 guests