Coder Social home page Coder Social logo

modlishka's Introduction

..Modlishka..

Modlishka is a powerful and flexible HTTP reverse proxy. It implements an entirely new and interesting approach of handling browser-based HTTP traffic flow, which allows it to transparently proxy multi-domain destination traffic, both TLS and non-TLS, over a single domain, without a requirement of installing any additional certificate on the client. What exactly does this mean? In short, it simply has a lot of potential, that can be used in many use case scenarios...

From the security perspective, Modlishka can be currently used to:

  • Support ethical phishing penetration tests with a transparent and automated reverse proxy component that has a universal 2FA “bypass” support.
  • Wrap legacy websites with TLS layer, confuse crawler bots and automated scanners, etc.

Modlishka was written as an attempt to overcome standard reverse proxy limitations and as a personal challenge to see what is possible with sufficient motivation and a bit of extra research time. The achieved results appeared to be very interesting and the tool was initially released and later updated with an aim to:

  • Highlight currently used two factor authentication (2FA) scheme weaknesses, so adequate security solutions can be created and implemented by the industry.
  • Support other projects that could benefit from a universal and transparent reverse proxy.
  • Raise community awareness about modern phishing techniques and strategies and support penetration testers in their daily work.

Modlishka was primarily written for security related tasks. Nevertheless, it can be helpful in other, non-security related, usage scenarios.

Features

Key features of Modlishka include:

General:

  • Point-and-click HTTP and HTTPS reverse proxying of an arbitrary domain/s.
  • Full control of "cross" origin TLS traffic flow from your users browsers (without a requirement of installing any additional certificate on the client).
  • Easy and fast configuration through command line options and JSON configuration files.
  • Pattern based JavaScript payload injection.
  • Wrapping websites with an extra "security": TLS wrapping, authentication, relevant security headers, etc.
  • Stripping websites of all encryption and security headers (back to 90's MITM style).
  • Stateless design. Can be scaled up easily to handle an arbitrary amount of traffic - e.g. through a DNS load balancer.
  • Can be extended easily with your ideas through modular plugins.
  • Automatic test TLS certificate generation plugin for the proxy domain (requires a self-signed CA certificate)
  • Written in Go, so it works basically on all platforms and architectures: Windows, OSX, Linux, BSD supported...

Security related:

  • Support for majority of 2FA authentication schemes (out of the box).
  • Practical implementation of the "Client Domain Hooking" attack. Supported with a diagnostic plugin.
  • User credential harvesting (with context based on URL parameter passed identifiers).
  • Web panel plugin with a summary of automatically collected credentials and one-click user session impersonation module (proof-of-concept/beta).
  • No website templates (just point Modlishka to the target domain - in most cases, it will be handled automatically without any additional manual configuration).

Proxying In Action (2FA bypass)

"A picture is worth a thousand words":

Modlishka in action against an example two factor authentication scheme (SMS based bypass proof-of-concept) :

https://vimeo.com/308709275

Installation

Latest source code version can be fetched from here (zip) or here (tar).

Fetch the code with 'go install' :

$ go install github.com/drk1wi/Modlishka@latest

Compile manually:

$ git clone https://github.com/drk1wi/Modlishka.git
$ cd Modlishka
$ make

alt text

# ./dist/proxy -h


Usage of ./dist/proxy:
      
  -cert string
    	base64 encoded TLS certificate
  
  -certKey string
    	base64 encoded TLS certificate key
  
  -certPool string
    	base64 encoded Certification Authority certificate
  
  -config string
    	JSON configuration file. Convenient instead of using command line switches.
      
  -controlCreds string
      Username and password to protect the credentials page.  user:pass format
      
  -controlURL string
      URL to view captured credentials and settings. (default "SayHello2Modlishka")
      
  -credParams string
      	Credential regexp with matching groups. e.g. : base64(username_regex),base64(password_regex)

  -debug
    	Print debug information
  
  -disableSecurity
    	Disable proxy security features like anti-SSRF. 'Here be dragons' - disable at your own risk.
  
  -dynamicMode
      	Enable dynamic mode for 'Client Domain Hooking'
  
  -forceHTTP
     	Strip all TLS from the traffic and proxy through HTTP only

  -forceHTTPS
     	Strip all clear-text from the traffic and proxy through HTTPS only
 
  -jsRules string
    	Comma separated list of URL patterns and JS base64 encoded payloads that will be injected - e.g.: target.tld:base64(alert(1)),..,etc
  
  -listeningAddress string
    	Listening address - e.g.: 0.0.0.0  (default "127.0.0.1")
  
  -log string
    	Local file to which fetched requests will be written (appended)
  
  -plugins string
    	Comma seperated list of enabled plugin names (default "all")
  
  -proxyAddress string
	    Proxy that should be used (socks/https/http) - e.g.: http://127.0.0.1:8080 
     
  -proxyDomain string
    	Proxy domain name that will be used - e.g.: proxy.tld
  
  -postOnly
    	Log only HTTP POST requests
  
  -rules string
      	Comma separated list of 'string' patterns and their replacements - e.g.: base64(new):base64(old),base64(newer):base64(older)

  -target string
    	Target domain name  - e.g.: target.tld
     
  -targetRes string
    	Comma separated list of domains that were not translated automatically. Use this to force domain translation - e.g.: static.target.tld 
  
  -terminateTriggers string
    	Session termination: Comma separated list of URLs from target's origin which will trigger session termination
    		
  -terminateUrl string
    	URL to which a client will be redirected after Session Termination rules trigger
  
  -trackingCookie string
    	Name of the HTTP cookie used to track the client (default "id")
  
  -trackingParam string
    	Name of the HTTP parameter used to track the client (default "id")

Commercial Usage

Modlishka is licensed under this License.

For commercial, legitimate applications, please contact the author for the appropriate licensing arrangements.

Credits

Author: Modlishka was designed and implemented by Piotr Duszyński (@drk1wi). All rights reserved.

See the list of contributors who participated in this project.

  • sentence copied directly from another project .

Disclaimer

This tool is made only for educational purposes and can be used in legitimate penetration tests or research only. Author does not take any responsibility for any actions taken by its users.

modlishka's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

modlishka's Issues

invalid URL port

I start the reverse proxy with the google_gsuite template and everything starts fine
but when I connect locally to loopback.modlishka.io
all it gives me is a blank page and an error that says: invalid URL port port_number.google.com

Need help

I followed the quick guide steps, and i still dont get it working.

When i go the domain i redicted to ip to, it straight redicts me to the target website.

Captcha

While testing Modlishka on a login portal with ReCaptcha v2 enabled, I received the following error when attempting to pass the captcha challenge to the victim's browser:

ERROR for site owner:
Invalid domain for site key

I recently noticed your tweet regarding Modlishka supporting ReCaptcha v2, is there any specific configurations that are needed to properly pass Captcha challenges?

credParams - office365

I'd appreciated if you can help me to figure out the regular expression for Office365. I passed the request through Burp to capture the following HTTP Post:

http_post_o365

Error TLS

Hello, i've got an error. Can someone help?

2019/01/25 19:23:47 http: TLS handshake error from [website]: tls: first record does not look like a TLS handshake

Cannot make

I followed the stept, but making is not working:
make
go test -v main.go main_test.go

github.com/drk1wi/Modlishka/core

core/proxy.go:498:10: rp.Proxy.ErrorHandler undefined (type *httputil.ReverseProxy has no field or method ErrorHandler)
FAIL command-line-arguments [build failed]
Makefile:23: recipe for target 'test' failed
make: *** [test] Error 2

Custom templates

What do i need to change at the template to make a custom one?

Only a different target link?

port closed

Hello! Good project!

I just have a problem with my ports. After starting the proxy my ports 443 and 80 are still closed... What can be the problem? Thank you!
ffff

UUID not captured

First of all: thanks for this awesome project!
I've set everything up, the proxy works, but the UUID of the user that is logged in is not captured. This also means that the user_id is unknown, preventing impersonation.

root@hostname:~/go/src/github.com/drk1wi/Modlishka/dist# ./proxy_linux -config ../templates/google.com_gsuite.json -debug
[Wed Jan  9 09:14:23 2019]  INF  Enabling plugin: autocert v0.1
[Wed Jan  9 09:14:23 2019]  INF  Enabling plugin: control_panel v0.1
[Wed Jan  9 09:14:23 2019]  INF  Control Panel: Collecting usernames with [true\],"([^\W]+)"]] regex and passwords with [\bnull,\["([a-zA-Z0-9"!"#$%&'()*+,-./:;<=>?@^_`{|}~]+)",null\b] regex
[Wed Jan  9 09:14:23 2019]  INF  Enabling plugin: template v0.1
[Wed Jan  9 09:14:23 2019]  INF  Control Panel: SayHello2Modlishka handler registered	
[Wed Jan  9 09:14:23 2019]  INF  Control Panel URL: /SayHello2Modlishka
[Wed Jan  9 09:14:23 2019]  INF  

>>>> "Modlishka" Piotr Duszynski @drk1wi - Reverse Proxy started <<<<

 _______           __ __ __         __     __          
|   |   |.-----.--|  |  |__|.-----.|  |--.|  |--.---.-.
|       ||  _  |  _  |  |  ||__ --||     ||    <|  _  |
|__|_|__||_____|_____|__|__||_____||__|__||__|__|___._|

Listening on: [0.0.0.0:443] 
Proxying [domain.tld:443] via --> [https://google.com] 
2019/01/09 09:14:34 http: proxy error: context canceled
2019/01/09 09:14:34 http: TLS handshake error from my-external-ip:24956: EOF
2019/01/09 09:14:35 http: proxy error: context canceled
2019/01/09 09:14:35 http: TLS handshake error from my-external-ip:24968: EOF
2019/01/09 09:14:35 http: TLS handshake error from my-external-ip:24969: EOF
2019/01/09 09:14:35 http: proxy error: context canceled
2019/01/09 09:14:36 http: TLS handshake error from my-external-ip:24985: EOF
[Wed Jan  9 09:15:18 2019]  INF  Username collected ID:[] username: <the-username> 
[Wed Jan  9 09:15:22 2019]  INF  Password collected ID:[] password: <the-password>
2019/01/09 09:15:42 http: TLS handshake error from my-external-ip:25027: EOF
2019/01/09 09:15:42 http: TLS handshake error from my-external-ip:25028: EOF
2019/01/09 09:15:42 http: proxy error: context canceled
2019/01/09 09:15:42 http: TLS handshake error from my-external-ip:25029: EOF
2019/01/09 09:15:42 http: TLS handshake error from my-external-ip:25034: EOF
2019/01/09 09:15:42 http: TLS handshake error from my-external-ip:25037: EOF
2019/01/09 09:15:42 http: TLS handshake error from my-external-ip:25036: EOF
2019/01/09 09:15:42 http: TLS handshake error from my-external-ip:25039: EOF
2019/01/09 09:15:42 http: proxy error: context canceled
2019/01/09 09:15:42 http: TLS handshake error from my-external-ip:25048: EOF
2019/01/09 09:15:42 http: TLS handshake error from my-external-ip:25047: EOF
2019/01/09 09:15:42 http: TLS handshake error from my-external-ip:25046: EOF

Below my config file:

{
  "phishingDomain": "domain.tld",
  "listeningPort": "443",
  "listeningAddress": "0.0.0.0",
  "target": "https://google.com",
  "targetResources": "content.googleapis.com,www.gstatic.com,ssl.gstatic.com,ogs.google.com,a$
  "targetRules": "",
  "terminateTriggers": "",
  "terminateRedirectUrl": "",
  "trackingCookie": "ident",
  "trackingParam": "ident",
  "useTls": true,
  "jsRules":"",
  "debug": false,
  "logPostOnly": false,
  "disableSecurity": false,
  "log": "google.log",
  "plugins": "all",
  "credParams": "dHJ1ZVxdLCIoW15cV10rKSJd,XGJudW$
  "cert": "-----BEGIN CERTIFICATE-----\nMIIFWTCC$
  "certKey": "-----BEGIN PRIVATE KEY-----\nMIIEw$
  "certPool": ""
}

Do you have any ideas on why this is happening?

Thanks in advance!

Redirecting modlishka to path

I am currently playing around with Modlishka, and managed to run it properly. Now I am trying to create a new template.
I try to create a proxy for:
https://ab.cd.com/p1/p2/?a1=XXXX&a2=XXXX&a3=XXXX
Is this possible? Because when I set this as my target, it does not load. But when I set the target to https://ab.cd.com/ it loads, but the mainpage, which I do not want.

Is there a way to load a target path from a subdomain including some parameters (a1-a3)?

EDIT: Okey managed it to make it work. Had a thinking error..I needed to set the target to https://cd.com/ and in targetResource add the subdomain.

Put I've got another problem now: Modlishka does not report a login attempt (eventhough I set the trackingParam to the username and password). Or does Modlishka only report valid login attempts?

The post request of the login is saved correctly in the log file

Enhancement: cookie in admin panel

important things first: it works great and is awesome! thanks

in addition to capturing username/password, i'd also like to show the captured cookies for easy impersonation in the admin panel. I now fetch them from the logfile.

modlishka error

when i execute this command ./dist/proxy -config templates/google.com_gsuite.json
i get following error
panic: tls: failed to find any PEM data in certificate input

goroutine 1 [running]:
github.com/drk1wi/Modlishka/plugin.init.0.func1()
/root/go/src/github.com/drk1wi/Modlishka/plugin/autocert.go:103 +0xc0a
github.com/drk1wi/Modlishka/plugin.(*Property).Enable(0xc000062300)
/root/go/src/github.com/drk1wi/Modlishka/plugin/core_plugin.go:71 +0xef
github.com/drk1wi/Modlishka/plugin.Enable(0xc000054c50, 0xc000054c60, 0xc000054c70, 0xc000054c80, 0xc000054c90, 0xc000054cc0, 0xc000054cd0, 0xc000054ca0, 0xc000054cb0, 0xc000054ce0, ...)
/root/go/src/github.com/drk1wi/Modlishka/plugin/core_plugin.go:105 +0x11a
main.main()
/root/go/src/github.com/drk1wi/Modlishka/main.go:65 +0x149
please tell me how to solve this error and start modlishka

Error with next button when using TLS

The tool is working perfectly without the TLS and everything is captured however when using tls and adding the certificate parameters, google page loads fine and the login page also, however when i add the mail and click next nothing happens, looks like the next button is not working

Not a phishing domain

Dear piotr,

Thank you for this wonderful tool.
Passwords won't appear after testing and following your guide.

these are my configurations:

sudo ./dist/proxy -target http://www.(website).com -phishingDomain https://43269b3c.ngrok.io -listeningPort 443

screenshot from 2019-01-13 06-19-30

but it appears that it's telling me that my domain is not a phishing domain?
can you elaborate please

Thank you.

tls: failed to find any PEM data in certificate input . Terminating.

Launched:

./proxy_linux -target https://www.targetdom.com -phishingDomain www.targetdom.me -tls -listeningAddress 0.0.0.0 -debug -cert ./cert.b64 -certKey ./privkey.b64

  • is '-tls' required?

  • '-cert' is x509 wildcard certificate for *.targetdom.me signed by LetsEncrypt CA
    -- original: cert.pem, converted: cat cert.pem | base64 --wrap=0 > cert.b64

  • '-certKey' is x509 private key used to create request to certbot for submission to LetsEncrypt CA
    -- original: privkey.pem, converted: cat privkey.pm | base64 --wrap=0 > privkey.b64

I may switch to in-package autocert and json, sounds simpler I suppose.

quickstart tutorial error

I follow step by step tutorial and after start sudo ./dist/proxy -config templates/google.com_gsuite.json the local url doesnt start. Thank you!
a

does not work behind cloudflire

I tested the Modlishka with my target site behind cloudflire. When i turn on Ddos protection. In normal site appears after few seconds in browser. But when I test it on loopback.modlishka.io
the message does not disappear, just change Ray ID: every 5 seconds. Without Ddos protection its ok.

Checking your browser before accessing …..
This process is automatic. Your browser will redirect to your requested content shortly.
Please allow up to 5 seconds…

DDoS protection by Cloudflare
Ray ID: 324506efga3ac543

Any ideas?

panic: tls: failed to find any PEM data in certificate input

Hi,help pls

openssl genrsa -out MyRootCA.key 2048
openssl req -x509 -new -nodes -key MyRootCA.key -sha256 -days 1024 -out MyRootCA.pem
awk '{printf "%s\\n", $0}' MyRootCA.key > MyRootCA2.key
awk '{printf "%s\\n", $0}' MyRootCA.pem > MyRootCA2.pem

Edit templates/google.com_gsuite_MY.json

{
  "phishingDomain": "MYDOMAIN.ooo",
  "listeningPort": "443",
  "listeningAddress": "127.0.0.1",
  "target": "https://google.com",
  "targetResources": "content.googleapis.com,www.gstatic.com,ssl.gstatic.com,ogs.google.com,accounts.google.com,clients1.google.com,clients2.google.com,clients3.google.com,clients4.google.com,clients5.google.com,clients6.google.com",
  "targetRules": "",
  "terminateTriggers": "",
  "terminateRedirectUrl": "",
  "trackingCookie": "ident",
  "trackingParam": "ident",
  "useTls": true,
  "jsRules":"",
  "debug": false,
  "logPostOnly": false,
  "disableSecurity": false,
  "log": "google.log",
  "plugins": "all",
  "credParams": "dHJ1ZVxdLCIoW15cV10rKSJd,XGJudWxsLFxbIihbYS16QS1aMC05IiEiIyQlJicoKSorLC0uLzo7PD0+P0BeX2B7fH1+XSspIixudWxsXGI=",
  "cert": "-----BEGIN CERTIFICATE-----MIIDYDCCAAAAAAAAAAAAAc15/6g==-----END CERTIFICATE-----",
  "certKey": "-----BEGIN RSA PRIVATE KEY-----MIIEogIBAAKCAAAAAAAAAAAOwgSc=-----END RSA PRIVATE KEY-----",
  "certPool": ""
}

Run command sudo ./dist/proxy -config templates/google.com_gsuite_MY.json
Error

[Thu Jan 10 17:43:47 2019] !!! tls: failed to find any PEM data in certificate input . Terminating.

Referer rewrite adds extra characters

I've set up a simple login page to demonstrate the use of this tool. However, when I run it, I am running into issues, because it is rewriting location headers, and adding extra characters.

{ "phishingDomain": "www.xxxxxxxxxx.live", "listeningPort": "443", "listeningAddress": "xxx.xxx.xxx.29", "target": "https://www.yyyyyyyyyy.live/", "targetResources": "", "targetRules": "", "terminateTriggers": "", "terminateRedirectUrl": "", "trackingCookie": "", "trackingParam": "", "useTls": true, "jsRules":"", "debug": true, "logPostOnly": false, "disableSecurity": false, "log": "test.log", "plugins": "all", "credParams": "dHJ1ZVxdLCIoW15cV10rKSJd,XGJudWxsLFxbIihbYS16QS1aMC05IiEiIyQlJicoKSorLC0uLzo7PD0+P0BeX2B7fH1+XSspIixudWxsXGI=", "cert" : "-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----\n", "certkey": "-----BEGIN PRIVATE KEY-----\n-----BEGIN PRIVATE KEY-----", "certPool": "" }
And here is the dubug output:

`


| | |.-----.--| | ||.-----.| |--.| |--.---.-.
| || _ | _ | | ||
--|| || <| _ |
||_|||||||||||||||_.|

Listening on: [xxx.xxx.xxx.29:443]
Proxying [www.xxxxxxxxxx.live:443] via --> [https://www.yyyyyyyyyy.live/]
[Tue Jan 22 05:46:44 2019] DBG [RP] Checking domain: www.yyyyyyyyyy.live/
[Tue Jan 22 05:46:44 2019] DBG [P] Proxying target [https://www.yyyyyyyyyy.live/] via phishing [www.xxxxxxxxxx.live]
[Tue Jan 22 05:46:44 2019] DBG PatchHeaders: HTTPRequest took 942ns
[Tue Jan 22 05:46:44 2019] DBG rewriteRequest took 194.134µs
[Tue Jan 22 05:46:44 2019] DBG Rewriting Set-Cookie Flags: from
[PHPSESSID=li1g1getmc1l2la0masgk9h9t0; path=/]
-->
[PHPSESSID=li1g1getmc1l2la0masgk9h9t0; path=/]
[Tue Jan 22 05:46:44 2019] DBG Rewriting Location Header [https://www.yyyyyyyyyy.live/login.php] to [https://d8ngmj946qft2m20h6y4mk051ccg.www.xxxxxxxxxx.liveve/login.php]
[Tue Jan 22 05:46:44 2019] DBG PatchHeaders: HTTPResponse took 739.663µs
[Tue Jan 22 05:46:44 2019] DBG Fallback to default compression ()
[Tue Jan 22 05:46:44 2019] DBG [rw] Rewriting Response Body for (https://www.yyyyyyyyyy.live/): status[302] type[text/html; charset=UTF-8] encoding[] uncompressedBody[2121 bytes]
[Tue Jan 22 05:46:44 2019] DBG rewriteResponse took 25.570329ms
`

At least part of the problem seems to be in this line:

[Tue Jan 22 05:46:44 2019] DBG Rewriting Location Header [https://www.yyyyyyyyyy.live/login.php] to [https://d8ngmj946qft2m20h6y4mk051ccg.www.xxxxxxxxxx.liveve/login.php]

Google template - Can't get it working with push notifications

Hello!. First I want to congratulate you because this is an amazing tool.
I tested it with google and seems to work really well with 2FA using SMS. However I was not able to get it working with push notifications. I'm always getting a timeout error.
Did you test it with push notifications?
Maybe i'm doing something wrong but I tested almost everything and i'm always getting the timeout error.

Let me know if you have any comments about this.

Thank you again and keep rocking.

Binding with ngrok.io

Instead of using self signed certificate is there any way to integrate ngrok for Modlishka. Importing self signed certificates in to browsers would be challenging during red teaming operations.

modlishka and windows

Hello,
I try running modlishka on windows 10. It is not capturing any password or username even though the redirection works perfectly. Am missing something or modlishka will not run properly on windows 10. Any feedback will be highly appreciated

Certificate state Unvalid?

I did everything as descripted, but as a beginner i cannot figure out what i did wrong.

Im getting the following message:

NET::ERR_CERT_AUTHORITY_INVALID

Please Help!

TLS Renegotiation Error

First of all, Modlishka is awesome! Thank you for all your hard work. I'm considering learning GO just to contribute.

Currently, I'm experiencing an issue with TLS renegotiation. The configuration file below is near identical to one that is working for accounts.google.com, which leads me to believe the issue is stemming from a configuration on the target server. After renegotiation fails, a 502 Bad Gateway response is received from the proxy.

I would normally provide a packet capture along with the items below but it would disclose sensitive client information (see screen capture).

Any insight would be greatly appreciated! Thanks again.

Configuration File

{
  "phishingDomain": "evil-aa.local",
  "listeningPort": "443",
  "listeningAddress": "192.168.86.5",
  "target": "https://target-domain.com",
  "useTls":true,
  "targetRes": "target-subdomain",
  "trackingCookie": "malid",
  "trackingParam": "malid",
  "debug": true,
  "logPostOnly": false,
  "disableSecurity": false,
  "log": "requests.log",
  "plugins": "all",
  "cert": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS",                             
  "certKey": "LS0tLS1CRUdJTiBQUklWQVRFIEt",
  "credParams": "VXNlck5hbWU9KC4rKSY/,UGFzc3dvcmQ9KC4rKSY/"
}

Debug Output

[Fri Jan  4 16:46:51 2019]  INF  Enabling plugin: autocert v0.1
[Fri Jan  4 16:46:51 2019]  INF  Enabling plugin: control_panel v0.1
[Fri Jan  4 16:46:51 2019]  INF  Control Panel: Collecting usernames with [UserName=(.+)&?] regex and passwords with [Password=(.+)&?] regex                                
[Fri Jan  4 16:46:51 2019]  INF  Enabling plugin: template v0.1
[Fri Jan  4 16:46:51 2019]  INF  Control Panel: SayHello2Modlishka handler registered
[Fri Jan  4 16:46:51 2019]  INF  Control Panel URL: /SayHello2Modlishka                                                                                                     
[Fri Jan  4 16:46:51 2019]  INF 

>>>> "Modlishka" Piotr Duszynski @drk1wi - Reverse Proxy started <<<<
                                                                                                                                                                            
 _______           __ __ __         __     __
|   |   |.-----.--|  |  |__|.-----.|  |--.|  |--.---.-.
|       ||  _  |  _  |  |  ||__ --||     ||    <|  _  |
|__|_|__||_____|_____|__|__||_____||__|__||__|__|___._|

Listening on: [192.168.86.5:443]                                                                                                                                            
Proxying [evil-aa.local:443] via --> [https://target-domain.com]                                                                                                                  
[Fri Jan  4 16:47:03 2019]  DBG  Subdomain: target-subdomain
[Fri Jan  4 16:47:03 2019]  DBG  Standard subdomain: target-subdomain
[Fri Jan  4 16:47:03 2019]  DBG  [RP] Checking domain: target-subdomain.target-domain.com
[Fri Jan  4 16:47:03 2019]  DBG  [RP] Checking IP: x.x.x.x
[Fri Jan  4 16:47:03 2019]  DBG  [P] Proxying target [https://target-subdomain.target-domain.com] via phishing [evil-aa.local]                                                                  
[Fri Jan  4 16:47:03 2019]  INF  [P] Tracking victim via initial parameter 6cb89440-b038-4bf2-982e-6a357c2e0252                                                             
[Fri Jan  4 16:47:03 2019]  DBG  PatchHeaders: HTTPRequest took 1.08µs
[Fri Jan  4 16:47:03 2019]  DBG  rewriteRequest took 221.56µs
2019/01/04 11:47:03 http: proxy error: local error: tls: no renegotiation

Screen Capture

Any redacted address is associated with the target server.

2pcewqoaqm

proxy error

Hi and thanks a lot fot this amazing tool... can you help me to solve this issue?
issue

Failed to find any PEM data in certificate input

I tried to follow the tutorial on /Modlishka/wiki/Quickstart-tutorial, but that didn't quite work.

I tried to copy the content of my certificate into the autocert.go file, (with and without \n) but I get the error message stated in the title.

After that I tried to directly put the certificate details into the template.json file, which resulted in the error message "Error unmarshalling JSON configuration (templates/google.com_gsuite.json): invalid character '\n' in string literal . Terminating."

Installing problem

when I try tho install this i get some error like this..

github.com/drk1wi/Modlishka/core

/root/go/src/github.com/drk1wi/Modlishka/core/proxy.go:498:10: rp.Proxy.ErrorHandler undefined (type *httputil.ReverseProxy has no field or method ErrorHandler)

No UUID in console log or control panel

1 - config.txt
2 - console log.txt

Hey,

For some reason, I can't capture the UUID.
I'm using the default template (google.com_gsuite2.json) in which I only changed the following:

  1. phishingDomain - to my wildcard ssl domain
  2. listeningAddress - to 0.0.0.0
  3. added cert and certKey (base64 format)

I have attached the config file and the console log.

Can not capture Username

First of all the project is perfectly installed in my kali linux 2018.4 VMware . No change any string or syntax in the project accepted ssl part (i tested on local).

Okay here is the details what i did and what i get.

For capture the UUID i used Version 4 UUID Generator from this site "www.uuidgenerator.net" and put the syntax as below:

https://loopback.modlishka.io:443/?ident=fe502484-1778-4434-a17f-xxxxxx

When i hit enter the url to request, it browse to the google interface as normal and get the uuid from the terminal:

[P] Tracking victim via initial parameter fe502484-1778-4434-a17f-xxxxxx

When i login with the password it logged in perfectly and get something like this on terminal:

Password collected ID:[fe502484-1778-4434-a17f-xxxxxx] password: !oxxxxxxxxxxx

Okay now here the part of issue, when i go to the panel page "/SayHello2Modlishka" i see only the "UUID, Password and Session" and show the user credential but only on Username that did't show any string.

And when i try to use the session function "Impersonate user (beta)" to login, it progress to the loading page and redirect to the main page without any account log in.

Thanks,

Issue with certificate

Hi,

Thank you for a beautiful project, managed to get it up and running without the https.
I am trying to install the certificate i got from acme.sh script and i can't understand what to put in the json file, could you please explain ( i am new at all the CA sigining).
FYI i did transform the key into pem format but dont understand what goes where.

Also can we issue a certificate from lets encrypt with all the subdomains needed in order to not need a wildcard certificate ?

page cannot be displayed ?

hello. I started the program with the domain name , but cannot be displayed.. page opens with local domain name..it does not work with the domain I received from freenom ?

Self-Signed Certificate ( loopback.modlishka.io)

Dear Piotr,
Thank you for this intelligent project
Everything is working fine except when
phishing google.com to the loopback.modlishka.io.
Certificates were generated successfully, inserted
to the .json config file and installed in the firefox browser.
Firefox keeps telling me ( Certificate is untrusted because its self signed)
The page is stuck in login gmail page "enter your username" and after that
doesnt go to the password field.
Can you elaborate ?
Best Regards

Subdomain issue, DecodeSubdomain

Hi,

I have scenario that a cdn link with a different domain info is called while loading page, however cdndomain is replaced by target domain by modlishka while proxying..

And I do get following error message "WAR DecodeSubdomain [ wi] contains invalid characters : %!s(MISSING)" for the below config.

What I am doing wrong?

Thanks

{
"phishingDomain": "mypishdom.com",
"listeningPort": "443",
"listeningAddress": "111.1.1.111",
"target": "https://mytargetdom.com",
"targetResources": "abc.mytargetcdn.com",
"targetRules": "YWJjLm15dGFyZ2V0Y2RuLmNvbQ==:YWJjLm15cGlzaGRvbS5jb20=:", #base64(abc.mytargetcdn.com):base64(abc.mypishdom.com)
"terminateTriggers": "",
"terminateRedirectUrl": "",
"trackingCookie": "ident",
"trackingParam": "ident",
"useTls": true,
"jsRules":"",
"debug": false,
"logPostOnly": false,
"disableSecurity": false,
"log": "my.log",
"plugins": "all",
"cert": "-----BEGIN CERTIFICATE-----\nMIID2zCCAsOgA..IBAgIJAODZ0tu5odBZZcJNQcw==\n-----END CERTIFICATE-----\n",
"certKey": "-----BEGIN RSA PRIVATE KEY-----\nMIIEpA..KUba58QN64HHpAIeVJM5g==\n-----END RSA PRIVATE KEY-----\n",
"certPool": ""
}

I can see string replacement in html file source code of target site.

view-source:https://mypishdom.com/

however, app redirects related request to the target domain instead of original cdn domain.

[Wed Jan 16 11:00:03 2019] WAR DecodeSubdomain [ wi] contains invalid characters : %!s(MISSING)
2019/01/16 06:00:04 http: proxy error: dial tcp: lookup abc.mytargetdom.com on 8.8.8.8:53: no such host

Modlishka error

You just have to c&p the cert and key to the autocert.go and "make". no need to add any '\n' chars. no need to add anything to json after this. autocert generates certificates on its own.
I have applied this method but it is showing this error
when i execute this command ./dist/proxy -config templates/google.com_gsuite.json
i get following error
panic: tls: failed to find any PEM data in certificate input

goroutine 1 [running]:
github.com/drk1wi/Modlishka/plugin.init.0.func1()
/root/go/src/github.com/drk1wi/Modlishka/plugin/autocert.go:103 +0xc0a
github.com/drk1wi/Modlishka/plugin.(*Property).Enable(0xc000062300)
/root/go/src/github.com/drk1wi/Modlishka/plugin/core_plugin.go:71 +0xef
github.com/drk1wi/Modlishka/plugin.Enable(0xc000054c50, 0xc000054c60, 0xc000054c70, 0xc000054c80, 0xc000054c90, 0xc000054cc0, 0xc000054cd0, 0xc000054ca0, 0xc000054cb0, 0xc000054ce0, ...)
/root/go/src/github.com/drk1wi/Modlishka/plugin/core_plugin.go:105 +0x11a
main.main()
/root/go/src/github.com/drk1wi/Modlishka/main.go:65 +0x149
please tell me how to solve this error and start modlishka
Please read full comment and then tag it duplicate or close it

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.