Skip to content

Instantly share code, notes, and snippets.

View ppsreejith's full-sized avatar
🗒️
Learning

Sreejith Pp ppsreejith

🗒️
Learning
View GitHub Profile
@ppsreejith
ppsreejith / gist:9bb5be30cfdfadbbd851
Created November 8, 2014 10:33
Ssh configuration through tor
## Inside the firewall ( use proxy)
Host *
#ProxyCommand /usr/bin/corkscrew 192.168.1.102 8080 %h %p
#ProxyCommand putty -load phoneproxy %h %p
#ProxyCommand nc -X connect -x 192.168.1.102:8080 %h %p
CheckHostIP no
Compression yes
Protocol 2
ProxyCommand connect -4 -S 192.168.1.150:9050 $(tor-resolve %h 192.168.1.150:9050) %p
#!/bin/sh
PROXY_IP=144.16.192.247
PROXY_PORT=8080
LAN_IP=`nvram get lan_ipaddr`
LAN_NET=$LAN_IP/`nvram get lan_netmask`
iptables -t nat -A PREROUTING -i br0 -s $LAN_NET -d ! $LAN_IP -p tcp --dport 80 -j DNAT --to $PROXY_IP:$PROXY_PORT
iptables -t nat -A PREROUTING -i br0 -s $LAN_NET -d ! $LAN_IP -p tcp --dport 443 -j DNAT --to $PROXY_IP:$PROXY_PORT
iptables -t nat -A POSTROUTING -o br0 -s $PROXY_IP -p tcp -d $LAN_NET -j SNAT --to $PROXY_IP
iptables -A FORWARD -i vlan1 -o br0 -s $LAN_NET -d $PROXY_IP -p tcp --dport $PROXY_PORT -j ACCEPT
@ppsreejith
ppsreejith / Simple SMTP Server
Created January 5, 2014 23:22
A quick smtp server written in python.
import smtpd
import smtplib
import asyncore
class SMTPServer(smtpd.SMTPServer):
def __init__(*args, **kwargs):
print "Running smtp server on port 25"