Carlos Aguni

Highly motivated self-taught IT analyst. Always learning and ready to explore new skills. An eternal apprentice.


HP Proxy

05 Jun 2022 »

http://192.168.0.2/

change mac address

e8:d8:d1:9d:7c:d1

[root@automation ~]# nmap 192.168.0.2

Starting Nmap 6.40 ( http://nmap.org ) at 2022-06-04 22:11 EDT
Nmap scan report for 192.168.0.2
Host is up (0.029s latency).
Not shown: 994 closed ports
PORT     STATE SERVICE
80/tcp   open  http
443/tcp  open  https
631/tcp  open  ipp
8080/tcp open  http-proxy
9100/tcp open  jetdirect
9220/tcp open  unknown

docker-compose.yml

version: "3"

services:
  nginx:
    image: nginx
    ports:
      - 80:80
      - 139:139/udp
      - 161:161/udp
      - 162:162/udp
      - 427:427/udp
      - 443:443
      - 631:631
      - 3702:3702/udp
      - 5353:5353/udp
      - 8000:8000
      - 8080:8080
      - 8800:8800
      - 9100:9100
      - 9220:9220
      - 9290:9290
      - 9500:9500
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf
  mypython:
    image: python
    command: python3 -m http.server 8000


nginx.conf

user  nginx; worker_processes  auto;

error_log  /var/log/nginx/error.log notice;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    #gzip  on;

    #include /etc/nginx/conf.d/*.conf;
}

stream {
    server {
        listen 80;
        proxy_pass 192.168.0.2:80;
    }
    server {
        listen 139 udp;
        proxy_pass 192.168.0.2:139;
    }
    server {
        listen 161 udp;
        proxy_pass 192.168.0.2:161;
    }
    server {
        listen 162 udp;
        proxy_pass 192.168.0.2:162;
    }
    server {
        listen 427 udp;
        proxy_pass 192.168.0.2:427;
    }
    server {
        listen 443;
        proxy_pass 192.168.0.2:443;
    }
    server {
        listen 631;
        proxy_pass 192.168.0.2:631;
    }
    server {
        listen 3702 udp;
        proxy_pass mypython:3702;
    }
    server {
        listen 5353 udp;
        proxy_pass mypython:5353;
    }
    server {
        listen 8000;
        proxy_pass mypython:8000;
    }
    server {
        listen 8080;
        proxy_pass 192.168.0.2:8080;
    }
    server {
        listen 8800;
        proxy_pass 192.168.0.2:8800;
    }
    server {
        listen 9100;
        proxy_pass 192.168.0.2:9100;
    }
    server {
        listen 9220;
        proxy_pass 192.168.0.2:9220;
    }
    server {
        listen 9290;
        proxy_pass 192.168.0.2:9290;
    }
    server {
        listen 9500;
        proxy_pass 192.168.0.2:9500;
    }
}