ISP限制多用户上网原理.docx
- 文档编号:20128758
- 上传时间:2023-04-25
- 格式:DOCX
- 页数:46
- 大小:36.51KB
ISP限制多用户上网原理.docx
《ISP限制多用户上网原理.docx》由会员分享,可在线阅读,更多相关《ISP限制多用户上网原理.docx(46页珍藏版)》请在冰豆网上搜索。
ISP限制多用户上网原理
ISP限制NAT的方法
一、ISP绑定了网卡MAC地址接入。
破解方法:
破解这个太简单了,常见的宽带路由器都有一种叫做“MAC地址克隆”的功能。
只要把能上网的网卡MAC地址“克隆”到路由器的WAN口就行了。
此方法网上流传太广,不多说。
二、ISP限制了IP数据包的TTL值。
封锁原理:
懂网络原理的朋友应该知道,IP数据包在传输过程中每经过一跳TTL值就会减1,所以如果有人在下面私开NAT的话,ip包经过NAT服务器或者代理服务器出去之后的TTL值一定为:
31、63、127或者254。
所以ISP只需要在局端抓取拥有这些TTL值的数据,直接drop掉,就可以禁止大部份用户自架NAT服务器上网了
破解方法:
既然我们明白了封锁原理,即数据包每经过一跳路由出去后ttl值就会减1,那么我们只要人为的在操作系统中将TTL默认值增大一跳,譬如在winxp系统中通过修改注册表,将TTL值改为129,减1出之后正好是128,就可以逃避检查了。
注意某些地方ISP可能只允许有限的几个默认的TTL出去。
三、ISP修改了DNS查询应答包的TTL值
封锁原理:
ISP也有可能会将UDP53端口(也就是DNS请求)返回包的TTL值设置为1.这样的话(iptables-tmangle-APREROUTING-ieth1-d192.168.1.0/24-pudp--sport53-jTTL--ttl-set1),DNS应答的包只能到达下一级主机。
如果使用了代理或者NAT,再下一级的TTL值将为0,这个包就丢掉了。
从而实现无法解析DNS,大部份用户也就没法上网。
但用户自行修改HOSTS文件手动解析网站或直接通过IP地址访问Internet是可以的。
破解方法:
最好的办法是使用DNS代理,这个DNS代理服务也只能在NAT服务器(路由器)上跑,让DNS代理帮内网用户传递DNS请求。
还有一种办法就是把TTL给它值改回来!
我们可以在路由器上抓取回来的DNS应答包,然后人为的增加TTL值,DNS就可以继续传递给内网了,这个方法也适用于前面那个限制TTL值出去的案例。
只要对出去的所有数据包统一修改TTL值即可,但此方法对破解者的技术要求颇高。
四、ISP检查同一IP地址的数据包中是否有不同的MAC地址。
封锁原理:
据说“网络尖兵”软件在用此方法,但我怀疑这种方法根本没用,因为经过NAT转换之后的IP包文中MAC地址应该也只有一个而非多个,应此不能通过此方法查到用户是否开启NAT服务。
破解方法:
网上流传的方法是把“LAN内所有网卡的MAC改成一致”,貌似也不是一个好的解决办法,改成一致后LAN内的PC间怎么通讯?
还是应该想办法让NAT/代理出去的数据包中含有的MAC地址始终如一才是王道。
五、ISP通过检查HTTP包头来封锁代理服务器(不是NAT)
封锁原理:
一般代理服务软件都是伪造http包头来代理内网PC上网,ISP就通过设备检查http包头中是否含有某些代理的特征字符串
破解方法:
因为是从应用层来分析特征,要破解比较难了,建议还是换成NAT的方式出去。
六、其它一些手段如:
限制TCP连接数、限制P2P、强迫用户安装星空极速、通过SNMP协议检查ADSL猫是否开启路由等手段并不是真正从局端来封锁NAT和代理,在此不复述了。
自己限制
方法1:
如果有人在下面私开nat的话,它那个ip出来的包的ttl值一定为:
31或者63或者127.你只需要在iptables中drop掉ttl数据等于以上值的包,就可以禁止它上网了。
丢弃ttl值为127,31,63的包
iptables-AFORWARD-s192.168.1.0/24-mttl--ttl127-jDROP
iptables-AFORWARD-s192.168.1.0/24-mttl--ttl31-jDROP
iptables-AFORWARD-s192.168.1.0/24-mttl--ttl63-jDROP
方法2:
将53端口返回的包的TTL值设置为1.这样的话,dns查询的包只能到达下一级主机。
如果它用了代理或者nat,再下一级的ttl将将为0,这个包就丢掉了。
从而实现无法解析dns限制非法nat。
iptables-tmangle-APREROUTING-ieth1-d192.168.1.0/24-pudp--sport53-jTTL--ttl-set1。
请把192.168.1.0/24替换为适合自己的值
操作系统默认ttl值
操作系统TCP传输UDP传输
设置dns返回包为1
AIX6030
DECPatchworksV53030
FreeBSD2.16464
HP/UX9.0x3030
HP/UX10.016464
Irix5.36060
Irix6.x6060
UNIX255255
Linux6464
MacOS/MacTCP2.0.x6060
OS/2TCP/IP3.06464
OSF/1V3.2A6030
Solaris2.x255255
SunOS4.1.3/4.1.46060
UltrixV4.1/V4.2A6030
VMS/Multinet6464
VMS/TCPware6064
VMS/Wollongong1.1.1.112830
VMS/UCX(latestrel.)128128
MSWindows95/98/NT3.513232
WindowsNT4.0/2000/XP/2003Server128128
窗体底端
Solutions
Products&Services
Ordering
Support
Training&Events
PartnerCentral
MyCisco
NowyoucanaddandremovemodulestoMyCisco!
Clickthearrowtoopen.
EasilyaccessyourpersonalizedcontentanywhereonCiscousingMyCisco.
Clickthearrowtoopen
HierarchicalNavigation
HOME
SUPPORT
PRODUCTSUPPORT
CISCOIOSANDNX-OSSOFTWARE
CISCOIOSSOFTWARERELEASES12.4T
CONFIGURE
FEATUREGUIDES
ACLSupportforFilteringonTTLValue
CiscoIOSSoftwareReleases12.4T
ACLSupportforFilteringonTTLValue
Downloads
ACLSupportforFilteringonTTLValue
TableOfContents
ACLSupportforFilteringonTTLValue
Contents
RestrictionsforACLSupportforFilteringonTTLValue
InformationAboutACLSupportforFilteringonTTLValue
HowFilteringonTTLWorks
BenefitsofFilteringonTTL
HowtoFilterPacketsBasedonTTLValue
FilteringPacketsBasedonTTLValue
EnablingControlPlanePolicingtoFilteronTTLValues0and1
ConfigurationExamplesforFilteringonTTLValue
FilteringonTTLValue:
Example
ControlPlanePolicingtoFilteronTTLValues0and1:
Example
AdditionalReferences
RelatedDocuments
Standards
MIBs
RFCs
TechnicalAssistance
CommandReference
deny(IP)
permit(IP)
ACLSupportforFilteringonTTLValue
________________________________________
CustomersmayuseextendedIPaccesslists(namedornumbered)tofilterpacketsbasedontheirtime-to-live(TTL)value,from0to255.Thisfilteringenhancesacustomer'scontroloverwhichpacketsreacharouter.
HistoryfortheACLSupportforFilteringonTTLValueFeature
ReleaseModification
12.4
(2)TThisfeaturewasintroduced.
FindingSupportInformationforPlatformsandCiscoIOSSoftwareImages
UseCiscoFeatureNavigatortofindinformationaboutplatformsupportandCiscoIOSsoftwareimagesupport.AccessCiscoFeatureNavigatoratYoumusthaveanaccountonC.Ifyoudonothaveanaccountorhaveforgottenyourusernameorpassword,clickCancelatthelogindialogboxandfollowtheinstructionsthatappear.
Contents
•RestrictionsforACLSupportforFilteringonTTLValue
•InformationAboutACLSupportforFilteringonTTLValue
•HowtoFilterPacketsBasedonTTLValue
•ConfigurationExamplesforFilteringonTTLValue
•AdditionalReferences
•CommandReference
RestrictionsforACLSupportforFilteringonTTLValue
•Thisfeaturedoesnotsupportturboaccesslists.
•WhentheaccesslistspecifiestheoperationEQorNEQ,routersrunningCiscoIOSRelease12.2ScanhavethataccesslistspecifyuptotenTTLvalues.However,forRelease12.0S,onlyoneTTLvaluecanbespecified.
InformationAboutACLSupportforFilteringonTTLValue
BeforeyouconfigureanaccesslistthatfiltersonTTL,youshouldunderstandthefollowingconcepts:
•HowFilteringonTTLWorks
•BenefitsofFilteringonTTL
HowFilteringonTTLWorks
IPextendednamedandnumberedaccesslistsmayfilterontheTTLvalueofpacketsarrivingatorleavinganinterface.PacketswithanypossibleTTLvalues0through255maybepermittedordenied(filtered).Likefilteringonotherfields,suchassourceordestinationaddress,theipaccess-groupcommandspecifiesinorout,whichmakestheaccesslistingressoregressandappliesittoincomingoroutgoingpackets,respectively.TheTTLvalueischeckedinconjunctionwiththespecifiedprotocol,application,andanyothersettingsintheaccesslistentry,andallconditionsmustbemet.
SpecialHandlingforPacketswithTTLor0or1ArrivingonIngressInterface
Thesoftwareswitchingpaths[distributedCiscoExpressForwarding(dCEF),CEF,fastswitching,andprocessswitching]willusuallypermitordiscardthepacketsbasedontheaccessliststatements.However,whentheTTLvalueofpacketsarrivingonaningressinterfacehaveaTTLof0or1,specialhandlingisrequired.ThepacketswithaTTLof0or1getsenttotheprocesslevelbeforetheingressaccesslistischeckedinCEF,dCEF,orfastswitchingpaths.TheingressaccesslistisappliedtopacketswithTTLvalues2through255andapermitordenydecisionismade.
PacketswithaTTLvalueof0or1aresenttotheprocesslevelbecausetheywillneverbeforwardedoutofthedevice;theprocesslevelmustcheckwhethereachpacketisdestinedfortherouterornotandwhetheranInternetControlMessageProtocol(ICMP)TTLExpiremessageneedstobesentbackornot.ThismeansthatevenifanACLwithTTLvalue0or1filteringisconfiguredontheingressinterfacewiththeintentiontodroppacketswithaTTLof0or1,thedroppingofthepacketswillnothappeninthefasterpaths.ItwillinsteadhappenintheprocesslevelwhentheprocessappliestheACL.Thisisalsotrueforhardwareswitchingplatforms.PacketswithTTL0or1aresenttotheprocessleveloftherouteprocessor(RP)orMultilayerSwitchFeatureCard(MSFC).
Onegressinterfaces,accesslistfilteringonTTLworkjustlikeotheraccesslistfeatures.Thecheckwillhappeninthefastestswitchingpathenabledinthedevice.ThisisbecausethefasterswitchingpathshandlealltheTTLvalues(0-255)equallyontheegressinterface.
ControlPlanePolicingforFilteringTTLValues0and1
ThespecialbehaviorforpacketswithaTTLof0or1resultsinhigherCPUusageforthedevice.IfyouarefilteringonTTLvalue0or1,youshouldusecontrolplanepolicing(CPP)toprotecttheCPUfrombeingoverwhelmed.InordertoleverageCPP,youmustconfigureanaccesslistespeciallyforfilteringTTLvalues0and1andapplytheaccesslistthroughCPP.Thisaccesslistwillbeaseparateaccesslistfromanyinterfaceaccesslists.BecauseCPPworksfortheentiresystem,notjustonindividualinterfaces,youwouldneedtoconfigureonlyonesuchspecialaccesslistfortheentiredevice.Thistaskisdescribedinthesection"EnablingControlPlanePolicingtoFilteronTTLValues0and1"section.
BenefitsofFilteringonTTL
•FilteringonTTLprovidesawaytocontrolwhichpacketsareallowedtoreachtherouterorpreventedfromreachingtherouter.Bylookingatyournetworklayout,youcanchoosewhethertoacceptordenypacketsfromacertainrouterbasedonhowmanyhopsawayitis.Forexample,inasmallnetwork,youcandenypacketsfromalocationmorethanthreehopsaway.FilteringonTTLallowsyoutovalidateifthetrafficoriginatedfromaneighboringdevice,asfollows.Youcanacceptonlypacketsthatreachyouinonehop,forexample,byacceptingonlypacketswithaTTLofonelessthantheinitialTTLvalueofaparticularprotocol.
•Manycontrolplaneprotocolscommunicateonlywiththeirneighbors,butreceivepacketsfromeveryone.ByapplyingtoreceivingroutersanaccesslistthatfiltersonTTL,youcanblockunwantedpackets.
•TheCiscoIOSsoftwaresendsallpacketswithaTTLof0or1totheprocessleveltobeprocessed.ThedevicemustthensendanICMPTTLexpiremessagetothesource.ByfilteringpacketsthathaveaTTLof0through2,youcanreducetheloadontheprocesslevel.
HowtoFilterPacketsBasedonTTLValue
Becauseaccesslistsareveryflexible,itisnotpossibletodefineonlyonecombinationofpermitanddenyc
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- ISP 限制 多用户 上网 原理