MAC Address ALLOW/DROP Script

Discussion regarding the installation and configuration of Linux distributions.

Postby asaddotcom » Wed Mar 01, 2006 10:48 pm

Dear LinuxFreaK,
Sallam,

Yes this one script is working fine...thankx.. now tell me what is major difference BTW New maccheck script and old one which u post in year 2004 i think!!!!!!
Thanking You...

ครค๔
www.apnicollection.com | www.wikisoft.pk
asaddotcom
Company Havaldaar Major
 
Posts: 195
Joined: Fri Feb 04, 2005 7:21 pm
ICQ: 172131405
Website: http://www.apnicollection.com
WLM: asaddotcom@msn.com
Yahoo Messenger: asaddotcom2002@yahoo.com
AOL: AsadDotCom
Location: Lahore, PK

Re:

Postby LinuxFreaK » Thu Mar 02, 2006 3:44 pm

Dear asaddotcom,
Salam,

Blocking of all other request is not working and browsering issues.

Regards.
Farrukh Ahmed
LinuxFreaK
Site Admin
 
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
ICQ: 82075802
Website: http://www.linuxpakistan.net/wiki/index.php?pagename=LinuxFreak
WLM: f4fahmed@hotmail.com
Yahoo Messenger: f4fahmed@yahoo.com
AOL: linuxpakistan@aol.com
Location: Karachi

Postby maiqbal » Thu Aug 31, 2006 4:58 pm

Hi Farrukh Bhai,

When I run maccheck it gives me the following error:

[root@fire root]# maccheck
Loading MAC Address....
iptables v1.2.7a: Bad mac address `#AsifIqbal'
Try `iptables -h' or 'iptables --help' for more information.
MAC Address Loaded Successfully....


while my mac.allow file is like this:
[root@fire root]# cat /etc/mac.allow
00-0D-61-26-B9-7B
00:16:76:09:41:67 #AsifIqbal


Any suggesstions?

Also this script only allows mac address in mac.allow table, what one should do if he needs to verify IP to MAC check authentication?

Thanks in advace,

Regards,
Muhammad Asif Iqbal
maiqbal
Lance Naik
 
Posts: 19
Joined: Fri Sep 03, 2004 11:04 am
WLM: maiqbal24@hotmail.com
Yahoo Messenger: masifiqbal1@yahoo.com
Location: Karachi

Re:

Postby LinuxFreaK » Fri Sep 01, 2006 9:10 am

Dear maiqbal,
Salam,

Did you read whole thread ?

FYI, http://www.linuxpakistan.net/forum2x/vi ... t=15#20469

Best Regards.
Farrukh Ahmed
LinuxFreaK
Site Admin
 
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
ICQ: 82075802
Website: http://www.linuxpakistan.net/wiki/index.php?pagename=LinuxFreak
WLM: f4fahmed@hotmail.com
Yahoo Messenger: f4fahmed@yahoo.com
AOL: linuxpakistan@aol.com
Location: Karachi

Farrukh Ahmed, I read your MAC script Good job.

Postby thecooldude » Fri Jan 05, 2007 1:59 am

Good job, but a Drawback :)

Farrukh Ahmed, I looked up at your MAC script, but! put a NAT box there....same MAC, as many users as they want can access Internet :) OR SOLUTION: Use kismet to discover all valid macs, and use whichever is not in use at the time.

Thanks
..
Regards,
Sherry.
thecooldude
Lance Naik
 
Posts: 43
Joined: Sun Nov 26, 2006 6:04 pm
Website: http://www.xsroot.com
WLM: cancerian_pisces@hotmail.com
Location: Dubai, UAE.

Re:

Postby LinuxFreaK » Fri Jan 05, 2007 10:02 am

Dear thecooldude,
Salam,

Thanks for appreciating my work. I have just written this script to achieve my goals at that time and goals may vary time by time :)

Best Regards.
Farrukh Ahmed
LinuxFreaK
Site Admin
 
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
ICQ: 82075802
Website: http://www.linuxpakistan.net/wiki/index.php?pagename=LinuxFreak
WLM: f4fahmed@hotmail.com
Yahoo Messenger: f4fahmed@yahoo.com
AOL: linuxpakistan@aol.com
Location: Karachi

Mac Binding

Postby rmira » Sat Mar 10, 2007 8:32 am

Dear Admin,
i want to apply this mac binding ruls on my text base Centos server.easy to apply this ruls on my grapich mode server, but how can i apply this on my text mode server,that means how can i copy past on text mode,plz easy way. is its work on centos
thanks
rmira
Lance Naik
 
Posts: 22
Joined: Sat Dec 17, 2005 1:50 pm

Re: Mac Binding

Postby LinuxFreaK » Sat Mar 10, 2007 10:43 am

Dear rmira,
Salam,

rmira wrote:i want to apply this mac binding ruls on my text base Centos server.easy to apply this ruls on my grapich mode server, but how can i apply this on my text mode server,that means how can i copy past on text mode,plz easy way. is its work on centos


You should just copy and paste it in a file. make file executable and use it :)

Best Regards.
Farrukh Ahmed
LinuxFreaK
Site Admin
 
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
ICQ: 82075802
Website: http://www.linuxpakistan.net/wiki/index.php?pagename=LinuxFreak
WLM: f4fahmed@hotmail.com
Yahoo Messenger: f4fahmed@yahoo.com
AOL: linuxpakistan@aol.com
Location: Karachi

Postby sevensins » Sat Nov 10, 2007 5:40 am

AOA,
I tested ur script and added a few things here and there as per my requirements...

This is what I have done with ur maccheck script (apart of it is)

********************************************************
/sbin/iptables --flush
/sbin/iptables --table nat --flush
/sbin/iptables --delete-chain
/sbin/iptables --table nat --delete-chain
/sbin/iptables -F -t nat
/sbin/iptables -F -t mangle
/sbin/iptables -X -t nat
/sbin/iptables -X -t mangle
/sbin/iptables -P INPUT DROP
/sbin/iptables -P FORWARD DROP

echo 1 > /proc/sys/net/ipv4/ip_forward
echo 1 >/proc/sys/net/ipv4/tcp_syncookies
echo 1 >/proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
echo 1 >/proc/sys/net/ipv4/conf/all/rp_filter
echo 0 >/proc/sys/net/ipv4/conf/all/accept_source_route
echo 0 > /proc/sys/net/ipv4/tcp_timestamps
echo 0 >/proc/sys/net/ipv4/conf/all/accept_redirects
echo 1 > /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses
echo 1 > /proc/sys/net/ipv4/ip_dynaddr
echo 30 > /proc/sys/net/ipv4/tcp_fin_timeout
echo 1800 > /proc/sys/net/ipv4/tcp_keepalive_time
echo 0 > /proc/sys/net/ipv4/tcp_window_scaling
echo 0 > /proc/sys/net/ipv4/tcp_sack
echo 8388608 > /proc/sys/net/core/wmem_max
echo 8388608 > /proc/sys/net/core/rmem_max
echo "4096 87380 4194304" > /proc/sys/net/ipv4/tcp_rmem
echo "4096 65536 4194304" > /proc/sys/net/ipv4/tcp_wmem

#ALLOW USERS
/sbin/iptables -I INPUT -p all -s $IP -m mac --mac-source $MAC -j ACCEPT
/sbin/iptables -I FORWARD -p all -s $IP -m mac --mac-source $MAC -j ACCEPT

#DENY USERS
/sbin/iptables -I INPUT -p all -s $IP -m mac --mac-source $MAC -j DROP
/sbin/iptables -I FORWARD -p all -s $IP -m mac --mac-source $MAC -j REJECT
********************************************************

The Same problem as I had posted way back.... If the user changes his/her ip and mac address to an allowed ip+mac, he/she would gain access to the system.... Now I read some where about this

sbin/iptables -I INPUT -p all -s $IP -m mac --mac-source ! $MAC -j DROP

I tried this but no dice... anyone has any pointers to how a lynx box could check for the real mac addresses???? not the spoofed one??? or anything.. would be gr8ful....
Regards,

-----------------------------------------------------------------
A wise monkey never monkies w/ another monkey's monkey!
sevensins
Havaldaar
 
Posts: 117
Joined: Tue Apr 13, 2004 1:45 pm
ICQ: 3655945
Website: http://www.us-cert.gov/
WLM: shehzad_h@hotmail.com
Yahoo Messenger: shehzadhamid@yahoo.com
Location: PAKISTAN

Postby sameer666 » Sat Nov 10, 2007 7:39 am

yes he will traverse if IP+mac is in allow list and there is no way of detecting it, unless there is some inconsistence in the packets.
Novice at heart
sameer666
Naik
 
Posts: 82
Joined: Tue Nov 06, 2007 5:31 am


Return to “%s” Installation

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron