Offensive Operations - SploitLab · •Passive (OSINT) • Search Engines (Google Dorks) • Web...

Post on 09-Apr-2018

235 views 6 download

transcript

@johnhsawyer john@sploitlab.com

OffensiveOperationsJohnH.Sawyer

SeniorManagingConsultantInGuardians,Inc.

BryceLay- Comsys

@johnhsawyer john@sploitlab.com

WorkshopAgenda• Administrivia• IntroductiontoPenetrationTesting

• Reconnaissance• Physical• SocialEngineering• PostExploitation

@johnhsawyer john@sploitlab.com

PurposeofthisWorkshop• Introductiontopenetrationtesting– Securityprofessionalsfocusedondefense– Systemsadministrators– Developers

• Hands-onwithCobaltStrikeandoffensivePowershelltools

• HaveFun!!

@johnhsawyer john@sploitlab.com

WhoAmI?• InGuardiansSeniorManagingConsultant

– RedTeamOperator/PenetrationTester– SocialEngineering– Web,Mobile,andDesktopApps– IncidentResponse&Forensics

• DarkReadingandInformationWeekauthorandspeaker• Infosec VolunteerandMentor• DEFCON14/15CapturetheFlag(1@stplace)

@johnhsawyer john@sploitlab.com

MyAwesomeEmployer• InGuardians,Inc.(formerlyIntelGuardians)• Founded2003byMikePoor,EdSkoudis,JayBeale,Jimmy

Alderson,andBobHillery• Ifit’ssecurity-related,wedoit.

– RedTeamAssessments– PenetrationTesting

• Network,Web,Mobile,Wireless,Hardware,People,andPhysical– IncidentResponseManagementandDigitalForensics

@johnhsawyer john@sploitlab.com

ThankYou• MyWifeandfamily• BryceLay– ComSys• InteropTeam• InGuardians• UBM,DarkReading,andTimWilson

@johnhsawyer john@sploitlab.com

PENETRATIONTESTINGIntroductionto

@johnhsawyer john@sploitlab.com

VulnerabilityAssessment• “Avulnerabilityassessmentistheprocessofidentifying,quantifying,andprioritizing(orranking)thevulnerabilitiesinasystem.”

• Source:Wikipedia

• Whatabout..– Validation– Risktothebusiness

@johnhsawyer john@sploitlab.com

PenetrationTest• “Apenetrationtest,ortheshortformpentest,isanattack

onacomputersystemwiththeintentionoffindingsecurityweaknesses,potentiallygainingaccesstoit,itsfunctionalityanddata.”

• Source:Wikipedia

• Mimicrealattackers• Showrealriskofvulnerabilities

@johnhsawyer john@sploitlab.com

EvolutionofPenetrationTesting• AttackProcess• Recon• Scan• Gainaccess• Maintainaccess• Covertracks

• Pentest Methodology• Preparation• Recon• Scan• Exploit• Analysis• Report

@johnhsawyer john@sploitlab.com

PenetrationTestingExecutionStd.• Pre-engagementinteractions• Intelligencegathering• Threatmodeling• Exploitation• Postexploitation• Reporting

@johnhsawyer john@sploitlab.com

TypesofPenetrationTesting• Network

– Internal– External

• Application– Web– Mobile– Desktop

• Physical

• SocialEngineering– Email– Phone– Other(Social,In-person)

• Wireless– WiFi– OtherRF

• Hardware

@johnhsawyer john@sploitlab.com

RedTeaming• Militaryorigins– practiceofviewingaproblemfromanadversaryorcompetitor'sperspective

• Long-term,persistentoperations– Monthstoyears

• Full-scope– Physical,socialengineering,web,mobile,wireless

@johnhsawyer john@sploitlab.com

OffensiveTraits• Passion• Curiosity• Experience• Adaptability• Communication• Notafraidoffailure

• Diversebackground– sysadmin,developer,networkengineer

@johnhsawyer john@sploitlab.com

LegalIssues• Jobdescription• Writtenpermission• Scope• RulesofEngagement

@johnhsawyer john@sploitlab.com

Risks• DenialofService

– Networkcongestion/saturation– Serviceresourceexhaustion– Crash(BSOD,Segfault)

• Datacorruption• Datadestruction• Angrypeople

– Sysadmins,users,HR,Legal

@johnhsawyer john@sploitlab.com

RECONNAISSANCEIntelligenceGathering

@johnhsawyer john@sploitlab.com

Reconnaissance• Passive(OSINT)• SearchEngines(GoogleDorks)• Webarchives• Newsgroups,GoogleGroups• Whois,Robtex,CentralOps• Shodan,Censys,Netcraft• Socialnetworks• Pwnedlist,Breachalarm

• Active• Nmap• DNSinterrogation• Nessus,Nexpose,Metasploit• Arachni,Burp,wpscan• FOCA,metagoofil• Anythingthatactivelytouches

thetargetnetwork

@johnhsawyer john@sploitlab.com

SearchEngines• “GoogleDorks”• BishopFoxSearchDiggity– GoogleDiggity,BingDiggity,BingLinkFromDomainDiggity– CodeSearchDiggity,DLPDiggity,FlashDiggity– MalwareDiggity,PortScanDiggity,SHODANDiggity– BingBinaryMalwareSearch,andNotInMyBackYard Diggity.

• http://www.bishopfox.com/resources/tools/google-hacking-diggity/attack-tools/

@johnhsawyer john@sploitlab.com

Shodan.io• “Shodan istheworld'sfirstsearchengineforInternet-connecteddevices.”

• http://www.shodanhq.com/help/filters– net,os,city,country,geo,hostname,port,before/after

@johnhsawyer john@sploitlab.com

Shodan Tools• ManytoolsleverageShodan– Spiderfoot,Maltego,etc.

• Shodan API– Pythonandrubylibraries

• Metasploit shodan_search module

@johnhsawyer john@sploitlab.com

Nmap• Networkportscanner• TCPandUDP• OSfingerprinting• Servicefingerprinting• Nmap ScriptingEngine– Advancedchecks– Vulnerabilitydetection

@johnhsawyer john@sploitlab.com

Spiderfoot• Automatesmuchofthereconprocess• FreeandOpenSource• RunsunderLinuxandWindows

• cd/opt/spiderfoot• python./sf.py• http://127.0.0.1:5001

@johnhsawyer john@sploitlab.com

Eyewitness• Screenshotsofwebapplications• Multipleformatimport(nmap,Nessus)• Serverheaders• PageSource• DefaultCreds• Alternatives– peepingtom,httpscreenshot,Spart

@johnhsawyer john@sploitlab.com

SOCIALENGINEERINGBecausethereisnopatchforhuman…

@johnhsawyer john@sploitlab.com

SocialEngineeringDefined• Theactofinfluencingsomeonetotakeanactionthatmayormaynotbeintheirbestinterest.

@johnhsawyer john@sploitlab.com

ExampleCareers• Doctors• Therapists• Radiohosts• Schoolteachers• Counselors• Lawenforcement

@johnhsawyer john@sploitlab.com

WhyDoesItWork?• Desiretobehelpful– ParAvion

• Tendencytotrustpeople• Fearofgettingintotrouble– Daisy

• Willingnesstocutcorners• http://www.social-engineer.org/framework

@johnhsawyer john@sploitlab.com

SomeGuidelines• GoldenRule– Leavesomeonebetterforhavingmetyou

• Manipulation– Thinkscamandpickupartists– Leavepeoplefeeling“dirty”orcheated• ChrisandMichelesurvey

@johnhsawyer john@sploitlab.com

SocialEngineeringMethodology• InformationGathering• PretextDevelopment• AttackPlanning• PerformAttacks• Reporting

@johnhsawyer john@sploitlab.com

ElementsofaGoodPhish• Urgesrecipienttotakeaction• Targetsanemotionalresponse• Mimicscontentforatrustedsource• Spoofsthesourcetoappearlegitimate• Bypassesmailsecuritycontrols

– http://arstechnica.com/information-technology/2014/02/16/how-to-run-your-own-e-mail-server-with-your-own-domain-part-1/

@johnhsawyer john@sploitlab.com

SomeReconTools• theharvester

– ThisisincludedontheVM• FOCA

– Windowsonly– Findsdocsandpulls

metadataincludingusernames,softwareversions,servers,networkshares.

• Maltego– Helpstoidentify

relationshipsbetweenhosts,networks,identitiesandmore.

• metagoofil– Metadatasearchand

extractor– Alittledatedbutstillvery

useful

@johnhsawyer john@sploitlab.com

PHYSICALOliviaNewtonJohnwantstoget…

@johnhsawyer john@sploitlab.com

Physical• Havingphysicalaccessrequireslittle/noexploitstocompromise

– Itisevenmorefunwhenitdoes!

• Thinkaboutwhatanattackercoulddoiftheyhavephysicalaccessto• areceptionist’sworkstation• anITstaffmember’sworkstation• anetworkcloset/IDF• yourdatacenter…• Physicalaccessisoftenconsidered“gameover”

@johnhsawyer john@sploitlab.com

DressthePart• Backtopowersofobservation…byothers

– Howwillstaffperceiveyouintheorganization?• Howareotherdressed?

– Construction– FireExtinguisherinspection– Packagedelivery*– Repairtechnician*

• Casualofficeorprofessionaldress

@johnhsawyer john@sploitlab.com

Tools• Few“technical”toolsexisthere

– Unlesswetalkprox/pinpad– Mostoccasionsdon’trequireanythingtechnical

• Mostpowerfultoolforthispartisyourbrain– Time,creativityandpatience– Thinkingoutsideofthebox– Hacking“hardware”fromthedumpster

• Howminorgapsinimplementationcanbeused

@johnhsawyer john@sploitlab.com

RFIDTools&RubberDucky• https://proxmark3.com• https://www.bishopfox.com/resources/tools/rfid-hacking/attack-tools/

• http://hakshop.myshopify.com/products/usb-rubber-ducky-deluxe?variant=353378649

@johnhsawyer john@sploitlab.com

PowersofObservation(1)• Observinghowphysicalsecuritysystemsareimplemented!• Observingthemovementsofothersperalongperiodoftime• Wheredocameraspoint?Aretheymonitoredactivelyor

reactively?• Howdodoorsunlockfromtheoutside?

– Howdotheyunlockfromthe inside?– Motionsensor?Capacitivetouchbar?– Whatsidearethehingeson?

@johnhsawyer john@sploitlab.com

PowersofObservation(2)• Underdoorgaps?Gapsindoorframes?

– Whatcanweuseoutofthedumpster?– Lowes/Homedepotcrafttime!

• Othermethodsofaccess– Balconies– LoadingDocks

• Unmotivated/Laxbuildingsecurity• Whatdobadgeslooklike?Totheinternet!

@johnhsawyer john@sploitlab.com

SocialEngineering• Thisisagameuntoitself– Somanysubtleties

• TL;DR,itisagameofconfidence– Actlikeyoubelong– Playthepart– “Hey,how’sitgoing?”

@johnhsawyer john@sploitlab.com

Policies• Physicalsecuritydesignattimeofbuild– JustlikeDevOps,bakeinsecurity

• Tailgating• Reportingofsuspiciousactivity• Auditandobserveadherencetopolicy

@johnhsawyer john@sploitlab.com

GETTINGAFOOTHOLDOMG!TheyopenedtheMACRO!!1!1!

@johnhsawyer john@sploitlab.com

Responder• PassiveandActiverecon• Exploitation(LLMNR,NBT-NS,DNS,MDNS)

• Stealpasswordhashesandcrackwithjohn/hashcat

• https://github.com/lgandx/Responder-Windows

@johnhsawyer john@sploitlab.com

Inveigh• LLMNR,mDNS,andNBNS

spoofer• Man-in-the-middletool• HTTP/HTTPS/Proxy

listeners• Slimmeddown,Powershell

versionofResponder

@johnhsawyer john@sploitlab.com

PasswordCracking• CrackthehashescapturedfromResponderusing:– johntheripper– hashcat

@johnhsawyer john@sploitlab.com

POWERSHELLIt’severywhereyouwanttobe…

@johnhsawyer john@sploitlab.com

OffensivePowershell• Greatforbypassingantivirus

andapplicationwhitelisting• OncurrentWindows

workstationandserveroperatingsystems

• MoreoffensivetoolsareleveragingPowershell

• Thebadguysareusingit,too!

@johnhsawyer john@sploitlab.com

Powershell ExecutionPolicy• ExecutionPolicy*IS*nota

securityfeature!!• 15waystobypass

Powershell executionpolicy– https://blog.netspi.com/15-

ways-to-bypass-the-powershell-execution-policy/

@johnhsawyer john@sploitlab.com

Powershell Pwnage Must-Haves• Empire

– http://www.powershellempire.com

• Powersploit– https://github.com/PowerShell

Mafia/PowerSploit• BloodHound

– https://github.com/BloodHoundAD/BloodHound

• PowerUpSQL– https://github.com/NetSPI/Po

werUpSQL• MailSniper

– https://github.com/dafthack/MailSniper

• DomainPasswordSpray– https://github.com/dafthack/D

omainPasswordSpray

@johnhsawyer john@sploitlab.com

COBALTSTRIKEPost-exploitationandC2excellence

@johnhsawyer john@sploitlab.com

CobaltStrike• Post-exploitation• CommandandControl

(C2)• Flexibleprotocols• Powershell integration• Scriptable

@johnhsawyer john@sploitlab.com

ListenersandPayloads

@johnhsawyer john@sploitlab.com

MacrosfortheFoothold

@johnhsawyer john@sploitlab.com

InjectingADCredstoAccessSysvol

@johnhsawyer john@sploitlab.com

MovingLaterally:SMBBeacons

@johnhsawyer john@sploitlab.com

Credentials

@johnhsawyer john@sploitlab.com

Powershell Integration

@johnhsawyer john@sploitlab.com

NEXTSTEPSWheretogofromhere…

@johnhsawyer john@sploitlab.com

NextSteps• Buildyourownlab

– VMWare (ESXi),VirtualBox,Hyper-V,AWS,Docker– Vulnhub.com– Networkequipment(HWorSW)

• Certifications– OSCP– GPEN,GPWN,GXPN

• BugBountiesandCapturetheFlagevents

@johnhsawyer john@sploitlab.com

ContactInformation• Contactinformation:

JohnH.Sawyerjohn@sploitlab.com@johnhsawyer352-389-4704

• Slides- https://www.sploitlab.com