Sponsored Content
Special Forums IP Networking Proxy Server iptables as "proxy" and a filter Post 302926601 by tschulian on Tuesday 25th of November 2014 12:07:03 PM
Old 11-25-2014
iptables as "proxy" and a filter

Dear community,
since I am a german guy, excuse gramatical mistakes.

I create a proxy to hide my application servers public IP from my customers.
I am actually using those 3 lines
(for testing reasons I am forwarding the traffic which connects to the ubuntu proxy to my apache webserver (5.196.130.245:80)

Code:
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 5.196.130.245:80
iptables -t nat -A POSTROUTING -j MASQUERADE

I show this to a friend/competitor and he said, lol, with this code ur "hiding" the costumers IP in ur Database logs
(for example, they use the register formular on the website username, password registerIP - and with my 3 lines of code the register IP is the proxys IP in every single case but he told me he got a way to see even the real Users IP, even if they connecting through the proxy)

So he sent me the following Picture of his script
Image

Any1 knows / is able to describe me what he has done better / other than me? I cannot see any routing cmds in his script.

I'm now almost searching 5 days for a solution and this is my last hope to find it.


EDIT: okay, I just found out that this Script for setting up the iptables is not for forwarding any traffic.
For the redirecting/forwarding part he is using HAPROXY.

regards,
Julian

Last edited by tschulian; 11-25-2014 at 04:13 PM.. Reason: code tags not icode ... thanks
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

2. Shell Programming and Scripting

cat $como_file | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g'

hi All, cat file_name | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g' Can this be done by using sed or awk alone (4 Replies)
Discussion started by: harshakusam
4 Replies

3. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

4. Solaris

The slices "usr", "opt", "tmp" disappeared!!! Help please.

The system don't boot. on the screen appears following: press enter to maintenance (or type CTRL-D to continue)...I checked with format command. ... the slices "0-root","1-swap","2-backup" exist. ...the slises "3-var","6-usr" -unassigned. :( (16 Replies)
Discussion started by: wolfgang
16 Replies

5. Shell Programming and Scripting

Filter file by length, looking only at lines that don't begin with ">"

I have a file that stores data in pairs of lines, following this format: line 1: header (preceded by ">") line 2: sequence Example.txt: >seq1 name GATTGATGTTTGAGTTTTGGTTTTT >seq2 name TTTTCTTC I want to filter out the sequences and corresponding headers for all sequences that are less... (2 Replies)
Discussion started by: pathunkathunk
2 Replies

6. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

7. UNIX for Dummies Questions & Answers

Grep : Filter/Move All The Lines Containing Not More Than One "X" Character Into A Text File

Hi All It's me again with another huge txt files. :confused: What I have: - I have 33 huge txt files in a folder. - I have thousands of line in this txt file which contain many the letter "x" in them. - Some of them have more than one "x" character in the line. What I want to achieve:... (8 Replies)
Discussion started by: Nexeu
8 Replies

8. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

9. AIX

Apache 2.4 directory cannot display "Last modified" "Size" "Description"

Hi 2 all, i have had AIX 7.2 :/# /usr/IBMAHS/bin/apachectl -v Server version: Apache/2.4.12 (Unix) Server built: May 25 2015 04:58:27 :/#:/# /usr/IBMAHS/bin/apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_worker_module (static) ... (3 Replies)
Discussion started by: penchev
3 Replies
CURLOPT_PROXY_SSL_VERIFYHOST(3) 			     curl_easy_setopt options				   CURLOPT_PROXY_SSL_VERIFYHOST(3)

NAME
CURLOPT_PROXY_SSL_VERIFYHOST - verify the proxy certificate's name against host SYNOPSIS
#include <curl/curl.h> CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_SSL_VERIFYHOST, long verify); DESCRIPTION
Pass a long set to 2L as asking curl to verify in the HTTPS proxy's certificate name fields against the proxy name. This option determines whether libcurl verifies that the proxy cert contains the correct name for the name it is known as. When CURLOPT_PROXY_SSL_VERIFYHOST(3) is 2, the proxy certificate must indicate that the server is the proxy to which you meant to connect to, or the connection fails. Curl considers the proxy the intended one when the Common Name field or a Subject Alternate Name field in the certificate matches the host name in the proxy string which you told curl to use. When the verify value is 1L, curl_easy_setopt will return an error and the option value will not be changed due to old legacy reasons. When the verify value is 0L, the connection succeeds regardless of the names used in the certificate. Use that ability with caution! See also CURLOPT_PROXY_SSL_VERIFYPEER(3) to verify the digital signature of the proxy certificate. If libcurl is built against NSS and CURLOPT_PROXY_SSL_VERIFYPEER(3) is zero, CURLOPT_PROXY_SSL_VERIFYHOST(3) is also set to zero and cannot be overridden. DEFAULT
2 PROTOCOLS
All protocols when used over a HTTPS proxy. EXAMPLE
CURL *curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "https://example.com"); /* Set the default value: strict name check please */ curl_easy_setopt(curl, CURLOPT_PROXY_SSL_VERIFYHOST, 2L); curl_easy_perform(curl); } AVAILABILITY
Added in 7.52.0. If built TLS enabled. RETURN VALUE
Returns CURLE_OK if TLS is supported, and CURLE_UNKNOWN_OPTION if not. If 1 is set as argument, CURLE_BAD_FUNCTION_ARGUMENT is returned. SEE ALSO
CURLOPT_PROXY_SSL_VERIFYPEER(3), CURLOPT_PROXY_CAINFO(3), , CURLOPT_SSL_VERIFYPEER(3), CURLOPT_CAINFO(3), , libcurl 7.54.0 December 16, 2016 CURLOPT_PROXY_SSL_VERIFYHOST(3)
All times are GMT -4. The time now is 04:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy