AngularJS tutorial can't open in Chrome Mac - node.js

Started official tutorial of AngularJS. It works fine in firefox, but can't open example and run tests on Chrome.
Chrome Version 34.0.1847.116
node --version v0.10.26
Mac OS X Version 10.9.2
Tried wget some json resource, it works.
wget http://localhost:8000/app/phones/phones.json
--2014-04-20 01:14:37-- http://localhost:8000/app/phones/phones.json
Resolving localhost (localhost)... ::1, 127.0.0.1, fe80::1
Connecting to localhost (localhost)|::1|:8000... failed: Connection refused.
Connecting to localhost (localhost)|127.0.0.1|:8000... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6845 (6.7K) [application/json]
Saving to: 'phones.json'
100%[======================================>] 6,845 --.-K/s in 0s
2014-04-20 01:14:37 (466 MB/s) - 'phones.json' saved [6845/6845]
HTTP logs:
Starting up http-server, serving ./ on port: 8000
Hit CTRL-C to stop the server
[Sat, 19 Apr 2014 22:14:37 GMT] "GET /app/phones/phones.json" "Wget/1.15 (darwin13.0.0)"
[Sat, 19 Apr 2014 22:16:06 GMT] "GET /app/phones/phones.json" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Firefox/24.0"
Same resource on Chrome:
Oops! Google Chrome could not connect to localhost:8000
Empty in Chrome Console and in Network:

Found solution for my case.
Firstly started looking for proxies. After sniffing around loopback interface with wireshark, found that localhost is linked to ::1. "::1" is 127.0.0.1 for IPv6.
Firefox is somehow resolves the problem, but Chrome not.
Simply add the line below to hosts file.
127.0.0.1 localhost
It fixes problem.

Related

tails os and proxychains - getting denied connection

Been trying to run a wallet app in tails os ver 4.28 with no success. I'm getting denied error when using it with proxychains. Being a noob here, would someone assist me in letting me know what I'm doing incorrect here. I've included terminal output & proxychain config info for reference here.
amnesia#amnesia:~/Persistent$ chmod +x Neuron-v0.101.2-x86_64.AppImage
amnesia#amnesia:~/Persistent$ proxychains ./Neuron-v0.101.2-x86_64.AppImage
ProxyChains-3.1 (http://proxychains.sf.net)
|S-chain|-<>-127.0.0.1:9050-<><>-127.0.0.1:8114-<--denied
06:16:58.553 › Network: connection dropped
|DNS-request| localhost
|DNS-request| localhost
|DNS-response| localhost is 127.0.0.1
|S-chain|-<>-127.0.0.1:9050-|DNS-request| localhost
<><>-127.0.0.1:8114-<--denied
|DNS-response| localhost is 127.0.0.1
|S-chain|-<>-127.0.0.1:9050-<><>-127.0.0.1:8114-|DNS-request| localhost
<--denied
06:17:00.145 › Network: fail to connect to the network. Is CKB node running?
06:17:00.323 › Network: switched to: {
id: 'mainnet',
name: 'default node',
remote: 'http://localhost:8114',
genesisHash: '0x92b197aa1fba0f63633922c61c92375c9c074a93e85963554f5499fe1450d0e5',
type: 0,
chain: 'ckb'
}
06:17:01.453 › Main window: The main window is ready to show
|DNS-response| localhost is 127.0.0.1
|S-chain|-<>-127.0.0.1:9050-|DNS-request| localhost
<><>-127.0.0.1:8114-<--denied
|DNS-response| localhost is 127.0.0.1
|S-chain|-<>-127.0.0.1:9050-<><>-127.0.0.1:8114-|DNS-request| localhost
<--denied
|DNS-response| localhost is 127.0.0.1
|S-chain|-<>-127.0.0.1:9050-<><>-127.0.0.1:8114-<--denied
|DNS-response| localhost is 127.0.0.1
|DNS-request| localhost
|DNS-request| localhost
|S-chain|-<>-127.0.0.1:9050-<><>-127.0.0.1:8114-<--denied
06:17:03.705 › CKB: external RPC on default uri not detected, starting bundled CKB node.
06:17:03.707 › CKB: Initializing node...
06:17:03.708 › CKB: init: config file detected, skip ckb init.
06:17:03.708 › CKB: starting node...
06:17:04.116 › CKB: process closed
|DNS-response| localhost is 127.0.0.1
|S-chain|-<>-127.0.0.1:9050-|DNS-request| localhost
<><>-127.0.0.1:8114-<--denied
|DNS-response| localhost is 127.0.0.1
|S-chain|-<>-127.0.0.1:9050-<><>-127.0.0.1:8114-<--denied
|DNS-request| localhost
|DNS-response| localhost is 127.0.0.1
|S-chain|-<>-127.0.0.1:9050-<><>-127.0.0.1:8114-|DNS-request| localhost
<--denied
^C|DNS-response|: localhost does not exist
Aborted
proxychain.config file
#dynamic_chain
strict_chain
#random_chain
#chain_len = 2
#quiet_mode
proxy_dns
# Some timeouts in milliseconds
tcp_read_time_out 15000
tcp_connect_time_out 8000
[ProxyList]
# add proxy here ...
# meanwile
# defaults set to "tor"
socks4 127.0.0.1 9050
Appreciate any assistance in this matter.
So, didn't get a response from the community as of yet. I did some exploration and enabled the following in proxychains config file
enabled dynamic_chain and commented strict_chain
replace socks4 with socks5
This got rid of the denied issue, but gave me a timeout issue.
Reached out the wallet tech team for assistance. They responded stating wallet synchronization fails when it's behind a firewall, vpn, anti-virus. Wallet behind a proxy configuration also disrupts the synchronization. I had a very slim hope that this would work and that faded quickly with their response. This closes out this open question.
I solved the problem by connecting to the internet (usually not connected) and running "sudo apt-get update" . After the update was done (a few seconds) I restarted tails (USB Stick variant) and then the problem was gone.

hack attempts from IP 127.0.0.1 - is there an exploit to be aware of?

I have noticed numerous entries in Tomcat's local_access_log for various resources coming from IP address 127.0.0.1. These are clearly attempts to hack in. For example, here is a request to get access to the "manager" app:
127.0.0.1 - - [30/Apr/2015:13:35:13 +0000] "GET /manager/html HTTP/1.1" 401 2474
here is another one:
127.0.0.1 - - [30/Apr/2015:21:23:37 +0000] "POST /cgi-bin/php?%2D%64+%61%6C%6C%6F%77%5F%75%72%6C%5F%69%6E%63%6C%75%64%65%3D%6F%6E+%2D%64+%73%61%66%65%5F%6D%6F%64%65%3D%6F%66%66+%2D%64+%73%75%68%6F%73%69%6E%2E%73%69%6D%75%6C%61%74%69%6F%6E%3D%6F%6E+%2D%64+%64%69%73%61%62%6C%65%5F%66%75%6E%63%74%69%6F%6E%73%3D%22%22+%2D%64+%6F%70%65%6E%5F%62%61%73%65%64%69%72%3D%6E%6F%6E%65+%2D%64+%61%75%74%6F%5F%70%72%65%70%65%6E%64%5F%66%69%6C%65%3D%70%68%70%3A%2F%2F%69%6E%70%75%74+%2D%64+%63%67%69%2E%66%6F%72%63%65%5F%72%65%64%69%72%65%63%74%3D%30+%2D%64+%63%67%69%2E%72%65%64%69%72%65%63%74%5F%73%74%61%74%75%73%5F%65%6E%76%3D%22%79%65%73%22+%2D%64+%63%67%69%2E%66%69%78%5F%70%61%74%68%69%6E%66%6F%3D%31+%2D%64+%61%75%74%6F%5F%70%72%65%70%65%6E%64%5F%66%69%6C%65%3D%70%68%70%3A%2F%2F%69%6E%70%75%74+%2D%6E HTTP/1.1" 404 1016
When decoded, the URL is this:
127.0.0.1 - - [30/Apr/2015:21:23:37 0000] "POST /cgi-bin/php?-d allow_url_include=on -d safe_mode=off -d suhosin.simulation=on -d disable_functions="" -d open_basedir=none -d auto_prepend_file=php://input -d cgi.force_redirect=0 -d cgi.redirect_status_env="yes" -d cgi.fix_pathinfo=1 -d auto_prepend_file=php://input -n HTTP/1.1" 404 1016
There are lots of such entries, all from IP address 127.0.0.1. Obviously, since this is the address of localhost, I can't block it. More over, I am not sure if there is something that I can do about it. Is there possibly an exploit that should be patched up? For instance, is there a version of Tomcat that has a related vulnerability? I am running Tomcat 8.
Much thanks for any advice!
UPDATE: thanks for the suggestion about a proxy. Turned out that httpd was indeed installed and not surprisingly, there are suspicious request. For example:
[Sat Mar 30 17:26:49 2013] [error] [client 5.34.247.59] Invalid URI in request GET /_mem_bin/../../../../winnt/system32/cmd.exe?/c+dir HTTP/1.0
[Sat Mar 30 17:26:49 2013] [error] [client 5.34.247.59] Invalid URI in request GET /_mem_bin/../../../../winnt/system32/cmd.exe?/c+dir%20c:\\ HTTP/1.0
[Sat Mar 30 17:26:49 2013] [error] [client 5.34.247.59] Invalid URI in request GET /_mem_bin/../../../../winnt/system32/cmd.exe?/c+dir%20c:\\ HTTP/1.0
This is not a windows system so cmd.exe has not place for it...
If you have a proxy server running on your computer, that will often receive requests and then call the primary server using the localhost (127.0.0.1) interface.
This could explain why you're logging these requests.

Too Many Redirects on OpenShift after push

I have a node.js application running on openshift. After testing my code on a local environment I pushed it up to my instance on openshift. After doing so, I went to check those changes on the public site and my browser reported that I was getting too many redirects. I tried to look at my haproxy status and even that was getting too many redirects.
I have done some investigation and here is what I've found:
I checked my nodejs logs and my node server started successfully (no errors)
I've ssh'd into my machine and ran curl -vvv $OPENSHIFT_NODEJS_IP:8080 and I was returned my index.html as I should.
When I run curl -vvv http://minutepolitics-minutepolitics.rhcloud.com/ I get this response:
RESPONSE:
Hostname was NOT found in DNS cache
Trying 54.81.203.46...
Connected to minutepolitics-minutepolitics.rhcloud.com (54.81.203.46) port 80 (#0)
GET / HTTP/1.1
User-Agent: curl/7.37.1
Host: minutepolitics-minutepolitics.rhcloud.com
Accept: */*
HTTP/1.1 302 Found
Date: Thu, 23 Oct 2014 03:26:06 GMT
Server Apache/2.2.15 (Red Hat) is not blacklisted
Server: Apache/2.2.15 (Red Hat)
Vary: Host
X-Powered-By: PHP/5.3.3
Location: http://minutepolitics-minutepolitics.rhcloud.com/
Connection: close
Accept-Ranges: none
Content-Length: 0
Content-Type: text/html
Closing connection 0
Also, when I ssh into my machine and run /etc/init.d/haproxy start the output is: Starting haproxy: [ALERT] 294/230821 (134951) : Starting frontend main: cannot bind socket [FAILED]
From here, I don't know what to do or try to get this working again.
Any and all help will be greatly apprecaited! Thanks!!

403 / Forbidden on favicon with NodeJS / Express

I'm currently testing LocomotiveJS and have a very simple "hello world" app up
I thought I'd set up the connect favicon middleware, but when I visit any route ('/' for example) I get the following in the console:
127.0.0.1 - - [Tue, 17 Jul 2012 21:41:25 GMT] "GET / HTTP/1.1" 200 1491 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11"
Error: Forbidden
at SendStream.error (/Users/alex/Desktop/LocoTest/node_modules/express/node_modules/send/lib/send.js:142:16)
at SendStream.pipe (/Users/alex/Desktop/LocoTest/node_modules/express/node_modules/send/lib/send.js:307:52)
at Object.static (/Users/alex/Desktop/LocoTest/node_modules/express/node_modules/connect/lib/middleware/static.js:78:8)
at next (/usr/local/lib/node_modules/locomotive/node_modules/express/node_modules/connect/lib/http.js:204:15)
at pass (/usr/local/lib/node_modules/locomotive/node_modules/express/lib/router/index.js:219:24)
at Router._dispatch (/usr/local/lib/node_modules/locomotive/node_modules/express/lib/router/index.js:280:5)
at Object.middleware [as handle] (/usr/local/lib/node_modules/locomotive/node_modules/express/lib/router/index.js:45:10)
at next (/usr/local/lib/node_modules/locomotive/node_modules/express/node_modules/connect/lib/http.js:204:15)
at multipart (/Users/alex/Desktop/LocoTest/node_modules/express/node_modules/connect/lib/middleware/multipart.js:52:61)
at module.exports (/Users/alex/Desktop/LocoTest/node_modules/express/node_modules/connect/lib/middleware/bodyParser.js:57:9)
127.0.0.1 - - [Tue, 17 Jul 2012 21:41:25 GMT] "GET /favicon.ico HTTP/1.1" 403 - "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11"
Any idea what's causing this?
It looks like the send middleware is considering this request malicious because it's not the root and contains "..". I'm not sure why /favicon.ico would cause isMalicious to return true though. I'd suggest debugging into isMalicious and examining this._root and this.path. Could either be some bug in send or favicon middleware or perhaps your code isn't configuring them. Can't help with that unless you post some code.
What version of Express and Connect were pulled in as dependencies? I encountered a bug with express#3.0.0beta6, which I think has been fixed in beta7 (though I haven't confirmed that myself). I'm running on express#3.0.0beta4, which I know works, and you can revert to that by doing:
$ npm uninstall express
$ npm install express#3.0.0beta4
The master branch of Locomotive is using the Express 3.x betas, which have generally been pretty solid. I'm looking forward to that being stable, and pushing out new releases.

why can't get this page in linux with wget/telnet?

this URL www.jinfuwu.com can be access in windows browser,windows telnet,
but in my ubuntu server, i can't get this page:
telnet (ubuntu):
root#ubuntu:~# telnet www.jinfuwu.com 80
Trying 121.199.111.176...
Connected to www.jinfuwu.com.
Escape character is '^]'.
GET / HTTP/1.1
Host: www.jinfuwu.com
HTTP/1.1 200 OK
Content-Type: text/html
Last-Modified: Sun, 05 Dec 2010 01:34:33 GMT
Accept-Ranges: bytes
ETag: "f671fd911c94cb1:0"
Server: Microsoft-IIS/7.5
X-Powered-By: ASP.NET
X-UA-Compatible: IE=EmulateIE7
Date: Sun, 05 Dec 2010 10:03:21 GMT
Content-Length: 1214Connection closed by foreign host.
wget (ubuntu):
root#ubuntu:~# wget http://www.jinfuwu.com
--18:10:29-- http://www.jinfuwu.com/
=> `index.html.2'
Resolving www.jinfuwu.com... 121.199.111.176
Connecting to www.jinfuwu.com|121.199.111.176|:80... connected.
HTTP request sent, awaiting response...
Read error (Connection reset by peer) in headers.
Retrying.
....
but in my windows ,i using telnet command, i can get the page
telnet (windows7):
run:
telnet www.jinfuwu.com 80
paste:
GET / HTTP/1.1
Host: www.jinfuwu.com
and press doubles Enter,i can see the page HTML code.
google it:
site:jinfuwu.com
google can access this site
can you tell me why?
btw: also www.joytg.com,same question
thanks a lot :)
Did some further digging for you and found the root cause is due to misconfigured routers. You can read about it all here.
The workaround that article mentions is to:
echo 0 > /proc/sys/net/ipv4/tcp_default_win_scale
However, this file has changed and on newer setups you need to instead:
echo 0 > /proc/sys/net/ipv4/tcp_window_scaling
You will need to be root when running that though.
$ wget http://www.jinfuwu.com
--2010-12-05 12:58:39-- http://www.jinfuwu.com/
Resolving www.jinfuwu.com... 121.199.111.176
Connecting to www.jinfuwu.com|121.199.111.176|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12145 (12K) [text/html]
Saving to: `index.html'
100%[====================================================>] 12,145 5.19K/s in 2.3s
2010-12-05 12:58:43 (5.19 KB/s) - `index.html' saved [12145/12145]
FWIW, I can get the page just fine using wget or curl from MacPorts.

Resources