Saturday, March 22, 2014

weinre



INSTALL

- unzip.
- go to node/bin
./npm install -g weinre


RUN
- go to node/bin and execute *./weinre --boundHost -all-*


REMOTE DEBUG CLIENT

embed in every page for test <script src="http://10.165.41.84:8080/target/target-script-min.js#anonymous"></script>

Wednesday, March 12, 2014

Limiting outgoing traffic on linux host (Simulating slow connection) as 1,2,3

iptables -t mangle -F
tc qdisc del dev enp0s25 root                                                      ### Delete all TC rules for enp0s25 
tc qdisc add dev enp0s25 root handle 1:0 htb                                       ### Activate queueing discipline
tc class add dev enp0s25 parent 1:0 classid 1:10 htb rate 100kbps ceil 100kbps prio 0  ### Define class allowed 2500kbit burst to 2500kbit (kbps=kiloBYTES)
iptables -A OUTPUT -t mangle -p tcp --dport 8091 -j MARK --set-mark 10             ### Create iptables mangle rule for outgoing port 8091
iptables -A OUTPUT -t mangle -p tcp --sport 8091 -j MARK --set-mark 10             ### Create iptables mangle rule for outgoing port 8091
tc filter add dev enp0s25 parent 1:0 prio 0 protocol ip handle 10 fw flowid 1:10   ### Assign the rule to the proper qdisc
tc -s -d class show dev enp0s25
iptables -t mangle -n -v -L
watch -n 1 tc -s -d class show dev enp0s25