My Tech Note's

Mês: Fevereiro 2014

Howto make simple duplicate packet with scapy

With scapy you can do any think.

This example, all packets to port 162 are sent to another machine too

#/usr/bin/env python2.6
from scapy.all import *
ipdst="78.78.78.78"
while True:
        pkt = sniff(count = 1,filter="udp and dst port 162")
        if pkt[0].haslayer(UDP):
                ipsrc=str(pkt[0][IP].src)
                send(IP(src=ipsrc,dst=ipdst)/UDP(sport=1234,dport=162)/pkt[0][SNMP])

[warning]

you can do with TCP.

[/warning]

 

Howto VPN over SSH

[warning]After all, you need openssh v4.3 and tuntap installed on both machines.[/warning]

Steps:

server1 # ssh [email protected] -NTCf -w 0:0

 -N Do not execute a remote command. This is useful for just forwarding ports.
-T Disable pseudo-tty allocation.
-C Requests compression of all data 
-f Requests ssh to go to background just before command execution.

[notice]

You need this options on sshd_config

PermitRootLogin yes

PermitTunnel yes

[/notice]

Configure the interfaces:

On the server1

server1 # ip link set tun0 up

server 1 # ip addr add 10.10.10.1/32 peer 10.10.10.2 dev tun0

On the server2

server2 # ip link set tun0 up

server2 # ip addr add 10.10.10.2/32 peer 10.10.10.1 dev tun0

 

And this moment, you have connection btw two servers, you can do ping 10.10.10.2 on the server1

 

now, you need configure the routing table

if you want routed all traffic

on the server1:

server1 # route add -host ip_server1 gw gateway_on_your_network

server1 # route del default gw gateway_on_your_network

server1 # route add default gw 10.10.10.2

on the server2:

server2 # iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

(eth0 are connected to internet/lan)

server2 # echo 1 > /proc/sys/net/ipv4/ip_forward

 

Now, all traffic btw server1 and server2 are encripted 🙂

O que está na moda é “Dupla tributação”

Pois é… pelos a dita “dupla tributação” está na moda…

Há um concerto que quero ir ver/assistir, lá fui eu a este website para comprar os bilhetes.

Selecionei o concerto e as cadeiras (são lugares marcados), até aqui tudo bem.

Lá estava eu todo contente, por haver lugares livres, decidi então marcar os lugares e prosseguir o referido pagamento.

preço

Quando começo a olhar o preço final, e quando deparei no “Custos de Operação” achei muito caro.

Por ex. na FNAC só cobram 1€ por cada bilhete!!!

Continue reading

© 2020 Sec&Stuff&Others

Theme by Anders NorenUp ↑