网络攻击与防范4恶意代码概论_第1页
网络攻击与防范4恶意代码概论_第2页
网络攻击与防范4恶意代码概论_第3页
网络攻击与防范4恶意代码概论_第4页
网络攻击与防范4恶意代码概论_第5页
已阅读5页,还剩165页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

IntroductionofMaliciousProgramsBasisknowledgeTrapdoorsLogicbombVirusTrojanHorseRootkitWormBotnetFuture?GrowthandChangeinMalwareDevelopmentInthebeginningtherewereviruses…2003sawthebeginningofspyware,phishing,botnets,etc.asanoutgrowthofspammingoutfits,nothackingoutfits.Spyware,Phishing,Botnetsstillgrowingdespitetheincreaseofmoneybeingspenttoremediatetheproblem.GrowthinMalwareNumberoftrojansinterceptedbyKasperskyLabs.2About10-15knewbotmachinesperday.Droppedto5kafterSP2releaseforonlyafewmonths.Only4-6daysuntilexploitreleased,yet40-60daysforpatch.Whydotheykeepgrowing?Becauseitkeepsworking.Wehaven’teliminatedtherealproblem.WhatisMaliciousCode?SetofinstructionsthatcausesasecuritypolicytobeviolatedGenerallyrelieson“legal”operationsAuthorizedusercouldperformoperationswithoutviolatingpolicyMaliciouscode“mimics”authorizeduserMaliciousProgramsMaliciousProgram’sEvolutionGlobal

Infrastructure

ImpactRegional

NetworksMultiple

NetworksIndividual

NetworksIndividual

ComputerTargetandScopeofDamage1stGenBootvirusesWeeks2ndGenMacrovirusesEmailDoSLimitedhackingDays3rdGenNetworkDoSBlendedthreat(worm+virus+trojan)TurbowormsWidespreadsystemhackingMinutesNextGenSeconds1980s1990sTodayFutureTrapdoorsTrapdoorAnundocumentedwayofgainingaccesstoaprogram,onlineserviceoranentirecomputersystem.Thebackdooriswrittenbytheprogrammerwhocreatesthecodefortheprogram.Itisoftenonlyknownbytheprogrammer.ExamplesofBackdoor2003,anattemptwasmadetocreateabackdoorintheLinuxKernelEarlyversionsoftheSobigVirusin2003installedbackdoorstosenditsspam.MyDoomvirusinearly2004createdabackdooronport3127tosendspamBackdoorTypesLocalEscalationofPrivilegeRemotecommand-lineaccess.RemotecontroloftheGUI.BackdoorInstallationAttackerhascompromisedthesystemVirus,worm,ormaliciousmobilecodeinstallsthebackdoor.Socialengineering:Trickingthevictimintoinstallingthebackdoor....StartingbackdoorsautomaticallyAttackerwantstomaintainaccesstothesystem.Backdoorneedstorestartwheneverthesystemrestarts.MethodsareOSdependent.StartingbackdoorsautomaticallyonWindowsAlteringStartupFilesandFoldersRegistryTaskSchedulerExampleUseSub7tocreateabackdoortotheremotemachine.Fromremotemachine,useexistingvpntunneltocommunicateinsidethenetwork.Nowhaveaccess,performVLANHoppingattack.Sub7ManyfunmodulesKeyloggingEnabletelnetandftp………….LogicBombLogicBombprogrammingcodeaddedtothesoftwareofanapplicationoroperatingsystemthatliesdormantuntilapredeterminedperiodoftime(i.e.,aperiodoflatency)oreventoccurs,triggeringthecodeintoaction

LogicBombOneofoldesttypesofmalicioussoftwareCodeembeddedinlegitimateprogramActivatedwhenspecifiedconditionsmetE.g.,presence/absenceofsomefileParticulardate/timeParticularseriesofkeystrokesWhentriggeredtypicallydamagesystemModify/deletefiles/disksVirusesVirusesDefinitionfromRFC1135:Avirusisapieceofcodethatinsertsitselfintoahost,includingoperatingsystems,topropagate.Itcannotrunindependently.Itrequiresthatitshostprogramberuntoactivateit.StepsinNormalProgramExecutionOSAMainMemory(volatile)HardDisk(non-volatile)ROM(non-volatile)0x0OSOS1234ProgramA0x00x0OSProgramA0x0OSlocates&copiestheprogramtobeexecutedintomemoryMainmemoryisemptyatthebeginningBIOSlocates&copiesOSfromdisktomemoryProgramAstartsexecutingFATFAT:FileAllocationTablestoresthelocationofallfilesonthesystem.ItismaintainedbytheOS.BIOScodeExecutingprogramsusetheOStoperformstandardfunctionslike,readingandwritingfilesetcVirusInfectionMechanismOSBInfectedprogramentersmemoryHardDisk0x0OSOS0x00x0OS0x0VirussearchesforasuitableprogramtoinfectOSProgramAVirusFrominfectedfloppydiskoranemailattachmentOSHardDiskB+virusVirusProgramAProgramB1FAT23ProgramAProgramAVirusVirusVirusProgramBViruscopiestheinfectedtargetbackintothedisk54ViruscopiesitselfintothetargetprograminmemoryViruscopiesthetargetprogramtomainmemoryWhenprogramBisexecuteditinfectsanewfileVirusmakesuseofOSconstructstosearchfortargetfiles,copyingetc VirusTargetClassificationBoot-SectorInfectorsFileInfectorsMacroVirusesConcealmentStrategyClassificationNoConcealmentEncryptionStealthOligomorphism,Polymorphism,Metamorphism27先来看看硬盘的安排按DOS标准的一张分区表主分区+扩展分区<=4——这个ubuntu的gparted会提示的但逻辑分区可以很多很多。Windows需要安装到主分区上Windows需要让主分区为激活状态(Active或boot),只能有一个MBR和引导扇区的代码均不可见MBRMFT主分区(Primary)逻辑分区(Logical)扩展分区(extended)引导扇区MBR主引导记录28MBR->分区——Windows的启动方式系统包括WindowsXP在安装的时候向MBR写一些代码,从而把MBR完全覆盖,它会去寻找主分区中的活动分区中的引导扇区,如这个C:的->引导扇区向ntldr或者bootmgr发出邀请XP用ntldr,Vista和Win7用bootmgr但win7有可能自己新建一个C:前面的隐藏、主、活动分区专门放启动文件MBRMFTC:ntldrORbootmgr Virus:BootSectorInfectorsBootsequenceonIBM-PCRunsinstructionatmemorylocationF000:FFF0ofBIOSJumpstoexecutionofBIOSstartupprogramExecutesPower-OnSelf-Test(POST)Checks,initializesdevicesGoesthroughpreconfiguredlistofdevicesIfitfindsbootabledevice,loads,andexecutesbootsectorAssumeMBRonharddriveMBRcontainsaddressofbootablepartitionLoadbootsectorofbootablepartitionBootsectormovesOSkernelintomemoryandstartsit Virus:BootSectorInfectorsBootSectorInfectorCopiesitselfintotheMBRTypicallyaftermakingcopyofMBRina“safelocation”StonedVirusOriginalversioninfectsonly360KBdiskettes1988ManyvariantsBehaviorBecomesmemoryresidentDisablesinterrupt12(MemorySizeDetermination)InfectsMBRInfectsalldiskettesMovesbootsectortosector11andcopiesitselfintosector0UsuallydestroyspartofthefilesystemPayload:Displaysmessageduringbootprocess:Yourcomputerisnowstoned. Virus:BootSectorInfectorsExtinctinthewild:Floppiesarerarelyusedtoboot,disablingthepropagationmechanismOSpreventwritingtoadisk’sbootsectorwithoutproperauthorizationBIOScanenablebootblockprotection Virus:FileInfectorsVirusinfectsexecutablesVirusisplacedinanexecutablePrependingVirus:AtthebeginningExecutionofa*.comloadsfileintomemorySetPCtobeginningoffileOftencopiesinfectedfilefurtherdownCodeCodeVirus Virus:FileInfectorsCodeCodeVirusAppendingVirus:AttheendTogetcontrolSaveoriginalinstructionincode,replacebyjumptoviralcode,executevirus,restoreoriginalinstructionandjumptothemorrunoriginalinstructionatsavedlocationfollowedbyjumptotherestofthecodeExecutablefileformatscanspecifystartlocationinfileheader Virus:FileInfectorsJumpJumpVirusProgramAProgramA1stinstruction1stinstruction2ndinstruction2ndinstructionProgramAinfectedwithvirusViralInfectionEndprogramAEndprogramAInintheexecutionoftheinfectedprogram,thevirusisexecutedbeforeprogramA,andthecorrectsequenceofinstructionexecutionInprogramAismaintained Virus:FileInfectorsOverwritingVirusesDoesnotchangefilesizePlacementStrategies:PlacevirusinsuperfluousdataPlacevirusinfileslackorunusedallocatedfilespaceStashoverwrittencontentsinacompanionfileCompress(partsof)theoriginalfile,decompress Virus:ConcealmentEncryptionVirusbodyisencryptedtomakeithardertodetectVirusneedstocontainadecryptionengineEncryptionmethodsrangefromverysimpletostrong Virus:ConcealmentStealthVirustakesactivestepstoconcealinfectionRestoreoriginalfiletimestampInterceptsystemcallstoplaybackoriginalinformationoffileChangeI/OcallsinDOSChangesystemlibrariesinmoresophisticatedOSAnti-stealthvirusVirusmakesallfileslookinfected Virus:ConcealmentPolymorphismByusingequivalentinstructionsequencesByusingdifferentversionsTremorhad6decryptionenginesMetamorphismInstructionsarereordered,branchconditionsreversedJumpsandNOPsinsertedinrandomplacesGarbageopcodesinsertedinunreachablecodeareasInstructionsequencesreplacedwithotherinstructionsthathavethesameeffect,butdifferentopcodesMutateSUBEAX,EAXintoXOREAX,EAXor

PUSHEBP;MOVEBP,ESPintoPUSHEBP;PUSHESP;POPEBPAnti-VirusTechnologiesSimpleanti-virusscannersLookforsignatures(fragmentsofknownviruscode)HeuristicsforrecognizingcodeassociatedwithvirusesPolymorphicvirusesoftenusedecryptionloopsIntegritycheckingtofindmodifiedfilesRecordfilesizes,checksums,MACs(keyedhashesofcontents)GenericdecryptionandemulationEmulateCPUexecutionforafewhundredinstructions,viruswilleventuallydecrypt,canrecognizeknownbodyVirusDetectionbyEmulationVirusbodyRandomlygeneratesanewkeyandcorrespondingdecryptorcodeMutationADecryptandexecuteMutationCMutationBTodetectanunknownmutationofaknownvirus,emulateCPUexecutionofuntilthecurrentsequenceofinstructionopcodesmatchestheknownsequenceforvirusbodyTrojanhorsesAdestructiveprogramthatmasqueradesasabenignapplication.Unlikeviruses,TrojanhorsesdonotreplicatethemselvesbuttheycanbejustasdestructiveTrojanHorseProgramsthatappeartohaveonefunctionbutactuallyperformanother.ModernTrojanHorse:resembleaprogramthattheuserwishestorun

-usuallysuperficiallyattractiveE.g.,game,softwareupgradeetcWhenrunperformssomeadditionaltasksAllowsattackertoindirectlygainaccesstheydonothavedirectlyOftenusedtopropagateavirus/wormorinstallabackdoorTrojanHorseProgramwithanovertandcoverteffectAppearsnormal/expectedCoverteffectviolatessecuritypolicyUsertrickedintoexecutingTrojanhorseExpects(andsees)overtbehaviorCoverteffectperformedwithuser’sauthorizationExample:In1995,aprogramdistributedasPKZ300B.EXElookedlikeanewversionofPKZIP…Whenexecuted,itformattedyourharddrive.TrojanhorsemayreplicateCreatecopyonexecutionSpreadtootherusers/systemsRootkitMotivationHackerswanttokeepaccesstoasuccessfullycompromizedbox.Atthesametime,theywanttoremainundetectedandthusneedtohidetheirpresenceandtraces.Allhackeractivitiesanddatarelatedtothoseactivitiesshallbeinvisibletolegitimateusers.Anypermanenttraceshouldbeavoided,ifpossible.DefinitionSource:G.Hoglund,J.Butler:„Rootkits“,ISBN0-321-29431-9„Arootkitisasetofsoftwaretoolsintendedtoconcealrunningprocesses,filesorsystemdatafromtheoperatingsystem.“Source:WikipediaEncyclopedia,/wiki/RootkitArootkitisasetofprogramsandcodethatallowsapermanentorconsistent,undetectablepresenceonacomputer.“47RootkitBehaviorRemoveevidenceoforiginalattackandactivitythatledtorootkitinstallation.Hidefutureattackeractivity(files,networkconnections,processes)andpreventitfrombeinglogged.Enablefutureaccesstosystembyattacker.Installtoolstowidenscopeofpenetration.Securesystemsootherattackerscan’ttakecontrolofsystemfromoriginalattacker.HistoryofRootkitsPrimitiveBinaryfilereplacement(passwordlogging/UNIX)Hidingtraces/tracks(logcleaners)Moreadvancedhiding-“stealthy”(Hxdef,HE4Hook)HookingtechniquesDirectdynamicmanipulationofkernelstructures(FU)DifficultfordetectionsoftwaretoidentifyAdvancedMemoryhooking/hiding(ShadowWalker)Usedincollusionwith3rdGenerationrootkitExtremely“stealthy”1First

Generation2Second

Generation3Third

Generation4Fourth

GenerationHardwareVirtualization5Fifth

GenerationReference:/archives/63/p63-0x08_Raising_The_Bar_For_Windows_Rootkit_Detection.txtPopularRootkitsAFXRootkit2005FUHackerDefenderHE4HookNTRootNTFSHiderNTIllusionVanquishWinlogonHijackNewRootkitsFUToKIrcBotSubVirtShadowWalkerBluePill(PoC)CommercialStealthSonyDRMMr.&Mrs.SmithDVD

(Alpha-DiscDRM)NortonSystemWorksHideFoldersXPTrackingandMonitoringsoftwareCommerciallyavailableproductsthatuserootkittypetechnologies.52RootkitTypesUser-modeRootkitsBinaryRootkitsreplaceuserprograms.ls,netstat,ps,login,sshd.LibraryRootkitsreplacesystemlibraries.Interceptsystemcalldatareturningfromkernel,strippingoutevidenceofattackeractivities.Alternately,ensurethatrootkitlibraryprovidingsystemcallsiscalledinsteadoflibcbyplacingitin/etc/ld.so.preload,like:

t0rnrootkit KernelRootkitsModifysystemcalls/structuresthatalluser-modeprogramsrelyontolistusers,processes,andsockets.Addbackdoorstokernelitself.53RootkitsDifferentRootkitsWindowsRootkits&MalwareUser-landRootkitKernel-landRootkitLinux/*BSDRootkitsUser-landRootkitKernel-landRootkitMacOSXRootkitsUser-landRootkitKernel-landRootkitFourPrivilegeRingsRing3Ring2Ring1Ring0Least-trustedlevelMost-trustedlevelCPURing0:operatingsystemkernelRing1:operatingsystemservicesRing2:customextensionsRing3:ordinaryuserapplicationsLegalRing-TransitionsAtransitionfromanouterringtoaninnerringismadepossiblebyusingaspecialcontrol-structure(knownasa‘callgate’)The‘gate’isdefinedviaadata-structurelocatedina‘system’memory-segmentnormallynotaccessibleformodificationsAtransitionfromaninnerringtoanouterringisnotnearlysostrictlycontrolledOperatingSystemDesignIntelhasfourprivilegelevelsorringswindowsandmanyotherOSvendorsuseonlytworingsUserMode:Inthislevelsomerestrictioninaccessingthesystemhardwareandcertainmemoryregionsapply.Theaddressspaceofauserprogramisrestrictedtotheapplicationmemorymaps.KernelMode:EverythingisallowedSupervisor/KernelModeUserMode58User-Landvs.Kernel-LandMulti-LayersofanOperatingSystemUser-LandYourpersonalapplicationsrunwithinthisspaceOperatingsystemprovidescommonAPIfordeveloperstouseKernel32.dllNtdll.dll.Kernel-LandThisisthe“heart”ofyourO/S.ThelowlevelkernelfunctionsthatimplementtheservicesneededinuserlandProtectedmemorycontainingobjectssuchasthoseforprocesses,tokens,ports,etcWindowsArchitectureHowdoesRootkitwork?Ring3–UserLandUserAdministratorSystemRing0–KernelLandDriversSystemServiceCallCycleUserApplicationcalltoCreateFileAPIKernel32.DLLcallstubNtCreateFileAPINTDLL.DLLEAX=0x00000020callINT2EhUSERMODEKERNELMODENTOSKRNL.EXESwitchBacktoUSERMODEreturnNtCreateFileresultreturnCreateFileresultNTDLLInterfaceKernel32.DLLimportssolelyonthelibraryNTDLL.DLLNTDLL.DLLisaninterfacetoInt2EhfunctionofWindowsNTInt2EhsignalsaneedtoswitchfromusermodetokernelmodeInt2EhisinternallyknownasKiSystemService().Int2EhhandlerlooksuponatableinNTOSKRNLcalledKeServiceDescriptorTable()

GettingIntoTheRootApplication:CalltoCreateFile()APIKernel32.DLL:CalltoNtCreateFile()--NativeAPINTDLL.DLLNTOSKRNL.EXE:CalltoKeServiceDescriptorTableInvokesKiSystemService()NTOSKRNLExportsThestructureofKeServiceDescriptorTable:typedefstructServiceDescriptorTable{PVOIDServiceTableBase;PVOIDServiceCounterTable(0);unsignedintNumberOfServices;PVOIDParamTableBase;}KeServiceDescriptorTableServiceTableBaseParamTableBase……@NtCreateFile0x2Cbytes……@NtCreateProcess0x20bytes…@NtOpenProcess0x10bytes………0x200x290x6AHookingSystemServiceExampleofNTDLLExportedFunctionsWhatHappensWhenYouReadaFile?Readfile()calledonFile1.txtTransitiontoRing0NtReadFile()processedI/OSubsystemcalledIRPgeneratedUserland(Ring3)RootkitsBinaryreplacementegmodifiedExeorDllBinarymodificationinmemoryegHe4HookUserlandhookingegHackerDefenderIAThookingKernel(Ring0)RootkitsKernelHookingE.g.NtRootkitDriverreplacement

E.g.replacentfs.syswithntfss.sysDirectKernelObjectManipulation–DKOM

E.g.Fu,FuToKernel(Ring0)RootkitsIORequestPacket(IRP)HookingIRPDispatchTable E.g.He4HookKernel(Ring0)RootkitsFilterDriversTheofficialMicrosoftmethodTypesFilesystemfilterVolumefilterDiskFilterBusFilter

ClassficalwaysforhidingvariousobjectsReplacingfiles(e.g.DLLs)HookingDLL’sfunctions(API/IAThooking)ModifyingDLL’sfunctions(RawCodeChange)HookingentriesinSST/KiServiceTable(verypopular)HookingIDT2EhentryModifyingKernelCode(RawCodeChange)IAThookingImportAddressTable(IAT)/ExportAddressTable(EAT)Eachprocessandmodule(DLL)havetheirownImportAddressTable(IAT)thatcontainstheentry-pointaddressesoftheAPIsthatareused.EveryDLLhasanExportAddressTable(EAT)thatcontainstheentry-pointaddressesoftheAPIsthatareimplementedwithintheDLL.0x00IATModificationHeadersCodeSectionCALL[CreateFileA]CreateFileA():…ImportSectionCreateFileA:0x12345678Kernel32.dllPEFileBeforeIATPatchingIATModificationHeadersCodeSectionCALL[CreateFileA]CreateFileA():…ImportSectionCreateFileA:AddrofHookKernel32.dllPEFileBeforeIATPatchingHook:JMP0x12345678IAThookingPowerfulandsimpleEasytodetect,butLegitimatehookingcommonMethodssuchasDLLforwardingmakesbenignvs.malicioushookshardtodiscernLatebindingApplicationsdolate-demandbindingwherefunctionaddressesarenotresolveduntilcalledFunctionswillnothaveaddressesinIATtohook!InlinefunctionhookingMorepowerfulthanIAThookingDonothaveproblemswithbindingtimeOverwritecodebytesoftargetfunctionsothatnomatterhowitisresolved,yourcodewillrunCanbeusedforbothkernelanduserfunctionsInlinefunctionhookingFindNextFileA:195D6:55 PUSHEBP195D7:8BEC MOVEBP,ESP195D9:81EC60020000 SUBESP,260Continue_Here:194DF:53 PUSHEBX195E0:8D85A0FDFFFF LEAEAX,[EBP-260]195DF:XX <…originalcode continues…>OriginalFindNextFile()APIFunctionDynamicCodePatchingFindNextFileA:195D6:E9XXXXXXXX JMPHook195DB:90 NOP195DC:90 NOP195DD:90 NOP195DE:90 NOPContinue_Here:194DF:53 PUSHEBX195E0:8D85A0FDFFFF LEAEAX,[EBP-260]195DF:XX <…originalcode continues…>Hook:<processparams> callSaved_Original <alterdata> retPatchedFindNextFile()APIFunctionInjectingaDLLViatheRegistryAppInit_DLLkeyAddaDLLthathooksormodifiesIAT,kernel32.dllorntdll.dllViaWindowshooksWindowsallowsyoutohookwindowmessagesandeventsofanotherprocessSetWindowsHookExWindowshookspecifiesThreadtohooktoSetto0andthesystemhooksallthreadsinthecurrentWindowsdesktop!InjectingaDLLViaremotethreadWindowsallowsyoutocreateathreadonaremoteprocessCreateRemoteThreadLoadrootkitDLLintoremoteprocessbyspecifyingstartroutineasLoadLibraryandbygivingitparametersthatpointtorootkitcodeusingVirtualAllocExDynamicForkingofWin32EXEUnderWindows,aprocesscanbecreatedinsuspendmodeusingtheCreateProcessAPIwiththeCREATE_SUSPENDEDparameter.TheEXEimagewillbeloadedintomemorybyWindowsbutexecutionwillnotbeginuntiltheResumeThreadAPIisused.SSDThookingSystemServiceDescriptorTableKerneldatastructurethatpointstocodewhichimplementssystemcallsinWin32,POSIX,andOS/2subsystemsIndexedbysystemcallnumberSystemServiceParameterTableSpecifiesthenumberofbytesfortheparametersofeachcallHookingSSDTLoadrootkitasdevicedriverReplaceSSDTentrytopointtoitinsteadofNtoskrnl.exeorWin32k.sysLaterversionsofWindowsXPmakememorythatstoresSSDTread-only(BSODifyoutrytowrite)ChangeCR0todisablememoryprotectioninkernelUseMemoryDescriptorListstochangeflagsHOOK_SYSCALL,UNHOOK_SYSCALLmacrosUsingSSDThooksHidingprocessesReplaceNTQuerySystemInformationfunctioninSSDTHookcallsoriginalfunctionandfiltersresultstoremoverootkitentriesfromSystemInformationClassbufferthatisreturnedMustupdateexecutiontimestatisticsacrossallprocessesinlistIfCPUdoesn’taddupto100%,someonewillbesuspiciousSDTEveryKTHREADobjecthaspServiceDescriptorTablepointer,whichisactuallyusedtodeterminetheappropriateService

Tabletobeused.+0xdcKTHREADSDT...KiServiceTableSDT&SDTShadow...KTHREAD......KiServiceTableW32pServiceTableSDTSDTShadowActiveProcessLinks...Allactiveprocessesinthesystemarekeptonthesinglelist.ThislistisimplementedbypairofpointersineachEPROCESSblock:EPROCESS.ActiveProcessLinksEPROCESSFurootkit...Attacker’sprocess...NowitishiddenIDThookingInterruptDescriptorTableNumeroussoftwareandhardwareinterruptsPagefaults(Entry0x0e),timers,systemcalls(Entry0x2e),etc.H2eStoreoriginalint2efunctionhandler(KiSystemService)intoglobalDWORDReplaceSSDTentrywithaddressofyourhookModernWindowsusesfasterSYSENTERAddressesoffunctionsstoredinmodel-specificregisters(MSR)RequireRing0tomodifyHookingI/OMajorI/ORequestPacketFunctionTableFunctiontablecontainedineverydevicedriverEachIRPtypehasanentryintableforaddressesoffunctionsthathandleitReplaceIRPoffilesystemwritesorTCPquerieswithrootkitRootkitTechnologySummaryExecutionpathChangeOnlydatastructuresChange(e.g.fu)Simplehooking(IAT,SDT/SST,IDT)RawcodechangeStrangepointerschange91LinuxRootkitsHistoryUser-LandSSHEater-1.1byCarlosBarrosKernel-LandStatic-X’sAdore-NG2.4/2.6kernelrootkitRebel’sphalanx(patches/dev/mem)

rebel@DifferenttypesbinaryreplacementlibraryreplacementKernelmodificationInterruptTableSyscallTableSyscallHandlerRAMmodificationotherkernelstructures93BinaryRootkitsExample:LRK4chsh Trojaned!User->r00tcrontab Trojaned!HiddenCrontabEntriesdu Trojaned!Hidefilesfix Filefixer!ifconfig Trojaned!Hidesniffinginetd Trojaned!Remoteaccesslinsniffer Packetsniffer!login Trojaned!Remoteaccessls Trojaned!Hidefilesnetstat Trojaned!Hideconnectionspasswd Trojaned!User->r00tps Trojaned!Hideprocessesrshd Trojaned!Remoteaccesssniffchk Programtocheckifsnifferisupandrunningsyslogd Trojaned!Hidelogstcpd Trojaned!Hideconnections,avoiddeniestop Trojaned!Hideprocesseswted wtmp/utmpeditor!z2 Zap2utmp/wtmp/lastlogeraser!94Example:LRK4ifconfig–Doesn’tdisplayPROMISCflagwhensniffing.login–Allowslogintoanyaccountwiththerootkitpassword.Ifrootloginisrefusedonyourterminalloginas"rewt".Disableshistoryloggingwhenbackdoorisused.ls–Hidesfileslistedin/dev/ptyr.Allfilesshownwith'ls-/'ifSHOWFLAGenabled.passwd–Enteryourrootkitpasswordinsteadofoldpasswordtobecomeroot.ps–Hidesprocesseslistedin/dev/ptyp.rshd–Executeremotecommandsasroot:rsh-lrootkitpasswordhostcommandsyslogd–Removeslogentriesmatchingstringslistedin/dev/ptys.Example:

LKMRootkitFunctionalityExample:RKPRootkitFunctionalityDetectingRootkitsHowtoDetectKeepacloseeyeonyoursystem(e.g.,filefingerprinting,centralizedsystemlogging)NoticeunusualtrafficwithIDS,etc.Noticeunusualportsbeingused(thiscouldalsobebotnetactivity)UNIXtoolschkrootkitchkrootkit:shellscriptthatcheckssystembinariesforrootkitmodification.ifpromisc.c:checksiftheinterfaceisinpromiscuousmode.chklastlog.c:checksforlastlogdeletions.chkwtmp.c:checksforwtmpdeletions.check_wtmpx.c:checksforwtmpxdeletions.(Solarisonly)chkproc.c:checksforsignsofLKMtrojans.chkdirs.c:checksforsignsofLKMtrojans.strings.c:quickanddirtystringsreplacement.chkutmp.c:checksforutmpdeletionsUNIXtools(cont’d)http://www.rootkit.nl/projects/

rootkit_hunter.htmlrkhunter(fromtheirsite)Rootkithunterisascanningtooltoassureyou(toabout99.9%*)you'recleanofnastytools.Thistoolscansforrootkits,backdoorsandlocalexploitsbyrunningtestslike:

-MD5hashcompare

-Lookfordefaultfilesusedbyrootkits

-Wrongfilepermissionsforbinaries

-LookforsuspectedstringsinLKMandKLDmodules

-Lookforhiddenfiles

-Optionalscanwithinplaintextandbinaryfiles

RootkitHunterisreleasedasGPLlicensedprojectandfreeforeveryonetouse.

*No,notreally99.9%..It'sjustanothersecuritylayerWindowsTools/ntw2k/

freeware/rootkitreveal.shtml

RootkitRevealerInterestingquotefromthesiteThereasonthatthereisnolongeracommand-lineversionisthatmalwareauthorshavestartedtargettingRootkitRevealer'sscanbyusingitsexecutablename.We'vethereforeupdatedRootkitRevealertoexecuteitsscanfromarandomlynamedcopyofitselfthatrunsasaWindowsservice.Thistypeofexecutionisnotconducivetoacommand-lineinterface.Notethatyoucanusecommand-lineoptionstoexecuteanautomaticscanwithresultsloggedtoafile,whichistheequivalentofthecommand-lineversion'sbehaviorWindowsTools(cont’d)/unhackme/unhackmeWindowsNT4/2000/XPthroughSP2What'snewinversion2.5AddeddetectionofAFXRootkit2005,EliteKeylogger,hiddenprocesses.What'snewinversion2.0

AddeddetectionandremovalofAFXRootkitandVanquishRootkit.UnHackMemonitor.NotGPLWindowsTools(cont’d)/taskinfo.html

TaskinfoUsedtolookforrogueprocessesWorksonWindows95through2003serverTaskInfoshowsinformationaboutallrunningprocessesandthreadsincludingring0VxDthreads.Informationabouteachprocessincludes:MostoftheProcessesthatwanttobeinvisiblelikeworms,keyloggersandotherspysoftware

Allthreads(withdetailsincludingThreadStartAddressandCallStackwithSymbolicInformationifpossible)CPUusage(multipleCPUsupported)MemoryusageSchedulingratePathOpenedfilesandhandlesLoadedmodules(DLLsetc.)CommandlineEnvironmentvariablesVersioninformationConnectionsWormsWormsAutonomous,activecodethatcanreplicatetoremotehostswithoutanytriggeringReplicatingbutnotinfectingprogramBecausetheypropagateautonomously,theycanspreadmuch

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论