Hot answers tagged http
9
Use tcpdump.
tcpdump -w httpdebug.pcap -i eth0 port 80 will sniff all packets heading to or from port 80 on the eth0 interface and output them to httpdebug.pcap, which you can then read at your leisure, either with tcpdump again (with multiple -x options, refer to the tcpdump manpage ) in console if you're feeling masochistic, or with wireshark.
I really ...
8
Most browsers enable you to get a warning if you have HTTP content on an HTTPS page. This can be very annoying if you visit sites that mix HTTP content on their HTTPS pages. From your question it appears Wikipedia is one of those. When properly set, Firefox warns me visiting this page.
A web server is not required to offer HTTPS. Many sites do not ...
8
The difference is in how DNS and the HTTP "Host" header work.
The site you're going to may have multiple sites hosted using the same server. In DNS, all the names for the sites hosted on that IP list the single server IP address. When you enter the name in the browser, the browser sends the hostname to the server using the "Host" header. If you enter only ...
5
If you really want to use command line for this there is tcpflow. It saves TCP streams to different files. The HTTP request and responses will be stored separately.
tcpflow -i wlan0 tcp port 80
If you can use GUI try Wireshark. You can right click any packet and pick "Follow TCP stream".
5
I was looking for a way to run a program with modified DNS resolution for testing purposes. For me, the solution was using the HOSTALIASES environment variable:
$ echo "foo www.google.com" > ~/my_hosts
$ HOSTALIASES=~/my_hosts wget foo
See hostname(7).
5
I think the best way to do this would be to set up a SOCKS5 proxy and tell firefox to send the DNS requests over the SOCKS5 proxy (network.proxy.socks_remote_dns). You could set up a socks5 proxy with openssh fairly easily (the -D option) and have a remote host running with a custom /etc/hosts, or something like DNSMasq for more complex DNS settings. ...
4
Check out following question at superuser:
http://superuser.com/questions/184643/override-dns-in-firefox
If the discussed options and the SO link are not viable solutions then check out:
http://superuser.com/questions/100239/hostname-override-in-firefox
Especially check out:
https://addons.mozilla.org/en-US/firefox/addon/redirector/
It sounds like this ...
4
The debian package dwww give access to all the documentation installed by the packages, included the manual pages.
After installing the package with your favorite package manager, you will be able to browse the local documentation with your navigator on http://localhost/dwww/.
By default, access to this URL is restricted to local connections but you can ...
4
The headers in an HTTP request must use CRLF (Windows) line endings. (See Wikipedia or RFC 2616.) Many servers support LF (Unix) line endings as an extension, but not this one.
In addition, HTTP 1.1 requires a Host: header line, as Warren Young pointed out. (See Wikipedia or RFC 2616).
echo -e "GET ...
4
Use node.js , fast and lightweight.
Or
just use simple nc netcat command to start a quick webserver on a port and serve the content of a file including the server response headers.
Reference from Wikipedia:
http://en.wikipedia.org/wiki/Netcat#Setting_up_a_one-shot_webserver_on_port_8080_to_present_the_content_of_a_file
{ echo -ne "HTTP/1.0 200 ...
4
This may not be the best solution, but if you use any proxy then it will have a specific host:port so the netcat solution with still work, albeit you'll have to pick apart the proxy meta-data to make sense of it.
The easiest way to do this might be to use any random anonymization proxy out there and just channel all the traffic through netcat. (I.e., set ...
4
wget is a great tool.
Use wget -m http://somesite.com/directory
-m
--mirror
Turn on options suitable for mirroring. This option turns on
recursion and time-stamping, sets infinite recursion depth and
keeps FTP directory listings. It is currently equivalent to
-r -N -l inf --no-remove-listing.
4
This is commonly referred to as "port forwarding". Here is a snippet from the official documentation:
Go to the Firewall menu, select NAT, then click on the Port Forward tab.
Click on the + icon at the top or bottom of the screen.
Choose the Interface for the port forward (likely WAN) and if needed, pick a virtual IP address from the External Address ...
3
You can use the iprange module to match a range of addresses. You want to DNAT the packets to your webserver.
iptables --table nat --append PREROUTING --match iprange --src-range 10.13.13.10-10.13.13.19 --protocol tcp --dport 80 --jump DNAT --to-destination 1.2.3.4
3
Both Perl and Python (and probably Ruby as well) have simple kits that you can use to quickly build simple HTTP proxies.
In Perl, use HTTP::Proxy. Here's the 3-line example from the documentation. Add filters to filter, log or rewrite requests or responses; see the documentation for examples.
use HTTP::Proxy;
my $proxy = HTTP::Proxy->new( port => ...
3
Your question is quite subjective, and configuring the port should be very easy with any http server.
Though, I would recommend lighttpd with server.port = 1080 (or whatever above 1024 for non-root users) in a configuration file:
server.document-root = "/home/foo/www"
server.port = 1080
It's a complete enough http server, and for serving static ...
3
You might be interested in HTTP Strict Transport Security sometimes called STS or HSTS. This is a voluntary header a web server can send out to instruct the web browser that the site must always be secure. Chrome is one of the browsers that implement it. http://www.imperialviolet.org/2011/02/17/hstsui.html I think you can add Wikipedia to the default ...
2
OCSP is a way for programs that use X.509 certificates (such as anything using SSL, like web browsers for https: URLs) to check whether a certificate has been revoked because it was compromised.
You're not seeing them when using https: directly because you would need a packet tracer that can decrypt SSL and the SSL certificate used for encryption — which in ...
2
HTTP 1.1 requires that you send at least a Host header in GET requests. That is, the minimum legal request looks like this:
GET http://www.example.com/noise/and/junk HTTP/1.1
Host: www.example.com
(Plus an additional CRLF to terminate the header section, of course.)
There may be HTTP servers that will cope with a request claiming to require HTTP 1.1 but ...
2
You need to include the domain name in your GET request. You have told nc the domain name you are connecting to do it knows where to go find the server, but nc doesn't pass that on to the server. If the server is hosting multiple domains, it will not know which one to send you. The request header you are passing with echo should include this full domain like ...
2
In general, you can't. HTTP can support multiple domain names on the same IP address since HTTP 1.0's addition of the Host header; most other services (SSH, FTP, etc.) have no equivalent and therefore can't differentiate access via one domain name from another and therefore don't support per-domain name settings.
2
Try using SimpleHTTPServer in Python.
mkdir ~/public_html
command_to_generate_output > ~/public_html/output.txt
(cd ~/public_html; python -c 'import SimpleHTTPServer,BaseHTTPServer; BaseHTTPServer.HTTPServer(("", 8080), SimpleHTTPServer.SimpleHTTPRequestHandler).serve_forever()')
The first two lines are setup for the web server. The last line creates ...
2
Looking at the Java sources, the connections seem benign. Their purpose is to retrieve DOM and DTD files for the book types the program deals with. Z39.86, for instance, is a digital talking book specification. It seems odd to me as a programmer to put this kind of network dependency into an application instead of bundling the needed files, but there may ...
2
It seems redirection is disabled at your wget, try specifying --max-redirect=2 or a higher number. You probably also want to specify --trust-server-names to allow wget to update the file name after redirection, otherwise the downloaded files will still be called download.
2
Wireshark's "follow TCP stream" feature shows the data payload that flows in both directions on the selected socket connection. So it matches up packets by socket connection, which is the combination of Host1_IP_address:port <-> Host2_IP_address:port.
You can read more on wireshark's web page at ...
1
Since you only want to get the domains accessed via http you could setup up a transparent http-proxy with Polipo or Privoxy and evaluate the log file.
Set up the proxy
Install and configure the proxy, that he listen for example on the address 127.0.0.1:8080 and enable logging.
Set up the firewall rule
Write a firewall rule, which redirect all outgoing ...
1
For about eight months (until mid-August) I used Tiny Tiny RSS with the slight hacks described above, so thanks again for that answer! However, I never actually needed the powerful web interface the API and many of its other great features—what I did need at some point was the ability to manipulate the HTTP request headers (to insert cookies and ...
1
PECL HTTP 2.0+
The latest version of pecl_http introduces the http namespace. so HttpRequest will no longer be available. Follow php's documentation for using namespace, and checkout the supplied phpunit directory for usage & examples.
$req = new http\Client\Request();
Or a more preferred way, that allows for backwards support
use ...
1
On higher ports you usually don't need any elevated permissions. Give lighttp or thttpd a try. Best point to start would be the FAQ, the other Docs are linked from there. If your admin does not have installed any webservers you like, you can dowload and build the source.
1
DNS CNAMEs would be the de-facto way to do this.
Edit: In light of comments below...
I don't think you'll be able to do what you are trying to do. You're trying to trick the browser or some other program into thinking something is an address it's not. The problem is that something is also going pass the name of the resource it wants so that the remote ...
Only top voted, non community-wiki answers of a minimum length are eligible