Giter Site home page Giter Site logo

Comments (4)

iphelix avatar iphelix commented on August 19, 2024

Thanks for the bug report, will definitely investigate.
On Mar 31, 2014 3:28 PM, "Will Sargent" [email protected] wrote:

Got a stack trace

worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 443;
server_name www.howsmyssl.com;

    location / {
        root   html;
        index  index.html index.htm;
    }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   html;
    }
}

}

Run nginx:

sudo /usr/local/bin/nginx -c /usr/local/etc/nginx/nginx.conf

Download and set up ngrok:

wget https://dl.ngrok.com/darwin_amd64/ngrok.zip
unzip ngrok.zip
ngrok 443

ngrok should show you two lines:

Forwarding http://1d775921.ngrok.com -> 127.0.0.1:80
Forwarding https://1d775921.ngrok.com -> 127.0.0.1:80

Check to see that ngrok is proxying to nginx, and is providing the HTTPS
certificates:

curl https://1d775921.ngrok.com | grep "Welcome to nginx"

<title>Welcome to nginx!</title>

Welcome to nginx!

➜ ~ host 1d775921.ngrok.com1d775921.ngrok.com has address 173.255.204.192

Download dnschef:

sudo - su
curl -O https://thesprawl.org/media/projects/dnschef-0.2.1.tar.gz
tar xvzf dnschef-0.2.1.tar.gz
cd dnschef-0.2.1
/usr/local/bin/python ./dnschef.py --fakedomains www.howsmyssl.com --fakeip 173.255.204.192

Now hit www.howsmyssl.com using -k to suppress hostname validation:

curl -k https://www.howsmyssl.com

[*] Cooking A replies to point to 1d775921.ngrok.com matching: www.howsmyssl.com
[15:21:48] 127.0.0.1: proxying the response of type 'AAAA' for v2-api-1998245248.us-east-1.elb.amazonaws.com

[15:21:49] 127.0.0.1: cooking the response of type 'A' for www.howsmyssl.com to 1d775921.ngrok.com

Exception happened during processing of request from ('127.0.0.1', 51320)
Traceback (most recent call last):
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 593, in process_request_thread
self.finish_request(request, client_address)
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 334, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 649, in init
self.handle()
File "./dnschef.py", line 212, in handle
response = self.parse(data)
File "./dnschef.py", line 110, in parse
response = response.pack()
File "/private/var/root/dnschef-0.2.1/lib/dnslib/dns.py", line 238, in pack
rr.pack(buffer)
File "/private/var/root/dnschef-0.2.1/lib/dnslib/dns.py", line 463, in pack
self.rdata.pack(buffer)
File "/private/var/root/dnschef-0.2.1/lib/dnslib/dns.py", line 516, in pack
buffer.pack("!BBBB",*map(int,self.data.split(".")))

ValueError: invalid literal for int() with base 10: '1d775921'

[15:21:49] 127.0.0.1: proxying the response of type 'A' for v2-api-1998245248.us-east-1.elb.amazonaws.com

[15:21:50] 127.0.0.1: cooking the response of type 'A' for www.howsmyssl.com to 1d775921.ngrok.com

Exception happened during processing of request from ('127.0.0.1', 51320)
Traceback (most recent call last):
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 593, in process_request_thread
self.finish_request(request, client_address)
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 334, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 649, in init
self.handle()
File "./dnschef.py", line 212, in handle
response = self.parse(data)
File "./dnschef.py", line 110, in parse
response = response.pack()
File "/private/var/root/dnschef-0.2.1/lib/dnslib/dns.py", line 238, in pack
rr.pack(buffer)
File "/private/var/root/dnschef-0.2.1/lib/dnslib/dns.py", line 463, in pack
self.rdata.pack(buffer)
File "/private/var/root/dnschef-0.2.1/lib/dnslib/dns.py", line 516, in pack
buffer.pack("!BBBB",*map(int,self.data.split(".")))

ValueError: invalid literal for int() with base 10: '1d775921'


Reply to this email directly or view it on GitHubhttps://github.com//issues/4
.

from dnschef.

wsargent avatar wsargent commented on August 19, 2024

Found it: I'd made a shortcut of doing:

/usr/local/bin/python ./dnschef.py --fakedomains www.howsmyssl.com --fakeip `host 1d775921.ngrok.com`

but host does not return the IP address, but a string starting with the hostname. My mistake.

from dnschef.

iphelix avatar iphelix commented on August 19, 2024

Sweet, glad you got it working.

I will add some more user input sanity checks so you don't have to dig for
the issue.
On Mar 31, 2014 3:50 PM, "Will Sargent" [email protected] wrote:

Found it: I'd made a shortcut of doing:

/usr/local/bin/python ./dnschef.py --fakedomains www.howsmyssl.com --fakeip host 1d775921.ngrok.com

but host does not return the IP address, but a string starting with the hostname. My mistake.

Reply to this email directly or view it on GitHubhttps://github.com//issues/4#issuecomment-39152168
.

from dnschef.

wsargent avatar wsargent commented on August 19, 2024

Cool. Good news is that there's a blog post about dnschef now: http://tersesystems.com/2014/03/31/testing-hostname-verification/

from dnschef.

Related Issues (20)

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.