Hacking and more...
HaCkinG CulT
Lista Forumurilor Pe Tematici
Hacking and more... | Reguli | Inregistrare | Login

POZE HACKING AND MORE...

Nu sunteti logat.
Nou pe simpatie:
GeorgianaBC
Femeie
23 ani
Bacau
cauta Barbat
28 - 80 ani
Hacking and more... / n00bs / SETUP A MAILSERVER WITH A BOGUS DOMAIN Moderat de Shocker
Autor
Mesaj Pagini: 1
epic
User

Inregistrat: acum 17 ani
Postari: 1896



In this series I will tell you how to setup a mailserver with a bogus domain, for eg. . You can use fetchmail to download you pop3 mail account and then redirect them to your internal mail account on your LAN.

By: Krishna Shekhar ; ;



1. In this series I will tell you how to setup a mailserver with a bogus domain, for eg. .
You can use fetchmail to download you pop3 mail account and then redirect them to your internal mail account on your LAN.
This is how I set it up for my GMX email which is a pop3 account.

2. First we will setup a bogus domain for eg. which may or may not exist on the Net.

SETTING UP YOUR DNS

3. You need to set up your dns.
4. Go to the /etc directory
[ /etc]# pico named.conf
5. Setup up a new zone for this domain in "named.conf"

zone "yourname.com"{
type master;
file "yourname.com";
notify no;
};

6. Also setup a reverse mapping zone entry for your internal network as well as for your localhost eg. my internal network address is "192.168.0." and localhost is "127.0.0"

zone "0.0.127.IN-ADDR.ARPA"{
type master;
file "127.0.0";
};
zone "0.168.192.IN-ADDR.ARPA"{
type master;
file "192.168.0";
notify no;
};

7. Now switch to the /var/named directory
[ /etc]# cd /var/named
8. First find out your hostname for your box.
[ ]# hostname
linux.yourname.com
9. Now make a file 127.0.0 , the following shows the my configuration, please do read the DNS howto to understand it.
[ ]# pico 127.0.0
########################################################################
$TTL 86400
@ IN SOA linux.yourname.com hostmaster.yourname.com. (
2002010501 ; serial
3600 ; refresh
900 ; retry
1209600 ; expire
86400 ; default_ttl
)
1 IN PTR localhost.yourname.com.
@ IN NS linux.yourname.com.
#########################################################################

10. And make another file called yourname.com
[ ]# pico yourname.com
11. This is what I have
#########################################################################
$TTL 86400
@ IN SOA linux.yourname.com. hostmaster.yourname.com. (
2001091103 ; serial
3600 ; refresh
900 ; retry
1209600 ; expire
43200 ; default_ttl
)

www IN A 192.168.0.13
localhost IN A 127.0.0.1
linux IN A 192.168.0.13
@ IN MX 5 mail.yourname.com.
@ IN NS linux
########################################################################
12. I have setup dns on localhost, beacause that is a reliable way to do it.
13. The ip 192.168.0.13 is a virtual host under localhost.
14. Next create a file for reverse zone mapping entry for your internel network, in my case it is 192.168.0
[ ]# pico 192.168.0
15. This is what my configurtion for internal lan, I have removed entries for other servers.
########################################################################
$TTL 86400
@ IN SOA linux.yourname.com. hostmaster.yourname.com (
2002010501 ; serial
3600 ; refresh
900 ; retry
1209600 ; expire
43200 ; default_ttl
)
13 IN PTR.
@ IN NS linux.yourname.com.
#######################################################################
16. Now edit /etc/hosts file.
17. [ /etc]# pico hosts
18. This is what you should do
#######################################################################
127.0.0.1 localhost linux.yourname.com
192.168.0.13 linux.yourname.com
192.168.0.13
#######################################################################
19. Restart named.
[ /etc]# /sbin/service named restart
20. To test it do a lookup at "www.yourname.com" and it should resolve to 192.168.0.13
21. [ /etc]# nslookup -silent
Server: 127.0.01
Address: 127.0.0.1#53

Name:
Address: 192.168.0.13
[ /etc]#

22. Thats it !! You have now configured your working DNS.

SETTING UP SENDMAIL

23. Now we need to setup Sendmail.
24. Edit /etc/sendmail.cf
25. You need to define "local info".

Cw yourname.com
Cw localhost linux.yourname.com

26. Next search for daemonportoptions which makes sendmail listening on the ipaddress of your box, here 192.168.0.36 is the ipaddress of the ethernet interface

O DaemonPortOptions=Port=smtp,Addr=127.0.0.1, Name=MTA
O DaemonPortOptions=Port=smtp,Addr=192.168.0.36, Name=MTA

27. By default sendmail does not relay, we need to set it to relay for our internal network.
28. Go to the /etc/mail directory and edit "access"
29. This is what you should have
[ ]# cat access
localhost.localdomain RELAY
localhost RELAY
127.0.0.1 RELAY
mail.yourname.com RELAY
192.168.0 RELAY
[ ]#

30. Now restart sendmail " /sbin/service sendmail restart "
31. Send a mail through your internal network using the servers smtp address. If relay still does not work, download webmin,
and configure sendmail!!
32. Now DNS and Sendmail are set , we need to configure xinetd to listen on the pop3 port.

SETTING UP XINETD

33. Go to /etc/xinetd.d and edit "ipop3".
34. [ .d]# pico ipop3
35. Set "disable = no"
#############################################################
[ .d]# cat ipop3
# default: off
# description: The POP3 service allows remote users to access their mail
# using an POP3 client such as Netscape Communicator, mutt,
# or fetchmail.
service pop3
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/sbin/ipop3d
log_on_success += USERID
log_on_failure += USERID
}
[ .d]#
##################################################################

36. Now restart xinetd.d
[ .d]# /sbin/service xinetd.d restart

36. Do "netstat --inet -a" and look for pop3 port.
37. Test it by telnetting it to port 110.
[ .d]# telnet 192.168.0.13 110
Trying 192.168.0.13...
Connected to 192.168.0.13.
Escape character is '^]'.
+OK POP3 linux.yourname.com v2000.69rh server ready
38. Check your firewall also allow access to your pop3 port from internal network.

SETTING UP FETCHMAIL

39. Now lets configure Fetchmail which will pop your external email address and will then forward that mail to you internal email
address.
30. Hope you have fetchmail installed. I ran fetcmail for root.
31. Go to the /root directory and create a file .fetchmailrc
32. [ /root]# pico .fetchmailrc
33. This is the configuration for your pop3 email account

[ /root]# cat .fetchmailrc
set syslog
set postmaster " "
set daemon 300
poll pop.gmx.net with proto pop3 #
user username pass password is kris ## Pop from gmx and redirect it to local user Kris
here;
[ /root]#

34. Start fetchmail by doing
35. [ /root]# fetchmail&
36. See /var/log/maillog , your mails must be downloading as well as forwarded to you bogus email address here i.e

37. Now go to your windows machine , open up your mail client , and add a new mail account , specify smtp and outgoing address as 192.168.0.36 (here which is the ipaddress of the ethernet interface where we did all this stuff).
38. On Eudora I had to disable SSL, on outlook it was a direct hit!!!!!!!!!
39. You can now see you mails downloading, from which is actually containing emails from my GMX email account.
40 . If you got any problems , please do email me.

regards
Krishna



_______________________________________
:< 4 8 15 16 23 42 *execute*
TOATA LUMEA ESTE INVITATA PE NOUL FORUM!

pus acum 17 ani
   
Pagini: 1  

Mergi la