LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Software to add HTML to webpages? (https://www.linuxquestions.org/questions/linux-software-2/software-to-add-html-to-webpages-4175490951/)

laptopdude90 01-11-2014 11:43 AM

Software to add HTML to webpages?
 
Hi, I'm trying to modify all webpages to add a small header. I have a computer set up with two network cards. One is on my internal network, the other is connected to my router. Basically, I need something that forwards all connections to their usual destination except for port 80, which is redirected to a proxy. I want something without a NAT.

lleb 01-11-2014 05:22 PM

how can you want something that is in and of its self by definition NAT. if you want to have multiple systems behind a router and you want ports forwarded to specific computers, that my friend is part of NAT.

you are asking several questions.

1.
Quote:

Hi, I'm trying to modify all webpages to add a small header.
for this you can use any editor like gedit, nano, piko, vi, etc... pick your poison so to speak.

2.
Quote:

I have a computer set up with two network cards. One is on my internal network, the other is connected to my router.
this is by definition NAT as your router will not, in most cases, pass your WAN side IP to the computer that it is connected to, it will pass a LAN side PRIVATE IP (192.xxx.xxx.xxx or 10.xxx.xxx.xxx or something along that line)

3.
Quote:

Basically, I need something that forwards all connections to their usual destination except for port 80, which is redirected to a proxy. I want something without a NAT.
what you want is NAT combined with port forwarding. This is the power of NAT.

haertig 01-11-2014 05:34 PM

I can't say I understand exactly what you are wanting to do. It appears you are running a webserver and you want to modify all your webpages that redirect things elsewhere? Is that it? If so, why don't you configure that in your webserver, not in the webpages themselves?

laptopdude90 01-11-2014 05:38 PM

No, I want to redirect all HTTP traffic at a proxy.

laptopdude90 01-12-2014 05:14 AM

Quote:

Originally Posted by lleb (Post 5096353)
how can you want something that is in and of its self by definition NAT. if you want to have multiple systems behind a router and you want ports forwarded to specific computers, that my friend is part of NAT.

you are asking several questions.

1. for this you can use any editor like gedit, nano, piko, vi, etc... pick your poison so to speak.

2.

this is by definition NAT as your router will not, in most cases, pass your WAN side IP to the computer that it is connected to, it will pass a LAN side PRIVATE IP (192.xxx.xxx.xxx or 10.xxx.xxx.xxx or something along that line)

3.

what you want is NAT combined with port forwarding. This is the power of NAT.



But having a double nat is bad...

Let's say my public IP is 1.2.3.4. The router has NAT built in, so I get a local ip (192.168.182.*) and then I want it to pass through my linux box into another subnet (still 192.168.182.*). I want to redirect all port 80 traffic to a proxy.

lleb 01-12-2014 11:50 AM

double NAT is not bad and the two subnets you listed are the same.

sounds like you need to install an IPCop or IPFire real hardware firewall and configure the system for Red, Green, Orange then put up a 2nd firewall/router behind the Orange connection.

If you are just setting up a Proxy, you dont need a 2nd computer to do that just run it local on your Linux computer, but that will NOT mask your real world IP. For that you will require TOR or some 3rd party Proxy to pass all of your traffic through.

Also what I described is NOT double NAT. it is pure and simple NAT with port forwarding. its networking 101.

John VV 01-12-2014 12:47 PM

Quote:

Hi, I'm trying to modify all webpages to add a small header.
if your CMS for the site is a php based cms there will be a header and footer php file
edit that

but that statement is so vague as the first person said
use gedit,kate,vi,nano,emacs,.....

laptopdude90 01-12-2014 02:57 PM

Quote:

Originally Posted by John VV (Post 5096731)
if your CMS for the site is a php based cms there will be a header and footer php file
edit that

but that statement is so vague as the first person said
use gedit,kate,vi,nano,emacs,.....

I'm trying to modify EVERY web page that comes through the wire.

John VV 01-12-2014 03:22 PM

Quote:

I'm trying to modify EVERY web page that comes through the wire.
that is a VERY different issue

the forum admins will need to chime in on if that topic is legal for us to post on this site

you could hack the version of firefox you are using ,then turn off user updates of firefox

it would be possible to get firefox to have something in the default window

but maintaining a CUSTOM build of firefox will be fun
other than that .....

laptopdude90 01-12-2014 04:41 PM

Quote:

Originally Posted by John VV (Post 5096788)
that is a VERY different issue

the forum admins will need to chime in on if that topic is legal for us to post on this site

you could hack the version of firefox you are using ,then turn off user updates of firefox

it would be possible to get firefox to have something in the default window

but maintaining a CUSTOM build of firefox will be fun
other than that .....

What if I'm not using firefox? What if, on the other side of that wire, is a public network?

John VV 01-12-2014 06:04 PM

to insert code into the headers of web sites on YOUR OWN LAN might be legal
as in YOU own all the computers that you are doing this to

but that is a double edged sword

something that crackers do .

so ....

Z038 01-12-2014 07:00 PM

Quote:

Originally Posted by laptopdude90 (Post 5096157)
Hi, I'm trying to modify all webpages to add a small header. I have a computer set up with two network cards. One is on my internal network, the other is connected to my router. Basically, I need something that forwards all connections to their usual destination except for port 80, which is redirected to a proxy. I want something without a NAT.

Are you talking about on-the-fly URL rewriting for requests coming in to your own webserver?

http://en.wikipedia.org/wiki/Rewrite_engine
http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html
http://httpd.apache.org/docs/2.0/rew...ite_guide.html
http://httpd.apache.org/docs/2.0/rew..._advanced.html

Or are you talking about a transparent proxy that sits between the client (on your LAN) and external internet webservers?

http://en.wikipedia.org/wiki/Proxy_s...nsparent_proxy

laptopdude90 01-12-2014 07:10 PM

Quote:

Originally Posted by Z038 (Post 5096875)
Are you talking about on-the-fly URL rewriting for requests coming in to your own webserver?

http://en.wikipedia.org/wiki/Rewrite_engine
http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html
http://httpd.apache.org/docs/2.0/rew...ite_guide.html
http://httpd.apache.org/docs/2.0/rew..._advanced.html

Or are you talking about a transparent proxy that sits between the client (on your LAN) and external internet webservers?

http://en.wikipedia.org/wiki/Proxy_s...nsparent_proxy

The second one.

haertig 01-12-2014 07:34 PM

Oh, now I think I see what you're after (maybe, still not sure). If you want to do this modification on your web browser side, via a proxy setting in the web prowser, you should look at "Proximitron". That is a stellar piece of software, it hasn't had seen any new development for years, but will probably do what you need even though it's old. Google it. It's still out there for download.

Problem is, you'd have to run it under Wine or in a VM, since it's Windows software. I image that would be doable however.

Z038 01-12-2014 10:48 PM

OK, here is a "how-to" for transparent proxying.

http://www.tldp.org/HOWTO/TransparentProxy.html

From the overview section:

Quote:

In ``ordinary'' proxying, the client specifies the hostname and port number of a proxy in his web browsing software. The browser then makes requests to the proxy, and the proxy forwards them to the origin servers. This is all fine and good, but sometimes one of several situations arise. Either

You want to force clients on your network to use the proxy, whether they want to or not.
You want clients to use a proxy, but don't want them to know they're being proxied.
You want clients to be proxied, but don't want to go to all the work of updating the settings in hundreds or thousands of web browsers.
and another:

http://wiki.squid-cache.org/SquidFaq/InterceptionProxy



.


All times are GMT -5. The time now is 10:55 AM.