Wednesday, October 17, 2018

Cisco MACs (OUI) addresses - all of them

00:00:0C        Cisco                  # CISCO SYSTEMS, INC.
00:01:42        Cisco                  # CISCO SYSTEMS, INC.
00:01:43        Cisco                  # CISCO SYSTEMS, INC.
00:01:63        Cisco                  # CISCO SYSTEMS, INC.
00:01:64        Cisco                  # CISCO SYSTEMS, INC.
00:01:96        Cisco                  # CISCO SYSTEMS, INC.
00:01:97        Cisco                  # CISCO SYSTEMS, INC.
00:01:C7        Cisco                  # CISCO SYSTEMS, INC.
00:01:C9        Cisco                  # CISCO SYSTEMS, INC.
00:02:16        Cisco                  # CISCO SYSTEMS, INC.
00:02:17        Cisco                  # CISCO SYSTEMS, INC.
00:02:3D        Cisco                  # Cisco Systems, Inc.
00:02:4A        Cisco                  # CISCO SYSTEMS, INC.

Monitor keypresses in Linux CLI (embedded)


Cmd:   showkey -a

Press any keys - Ctrl-D will terminate this program

a        97 0141 0x61
b        98 0142 0x62
c        99 0143 0x63
d       100 0144 0x64
e       101 0145 0x65
f       102 0146 0x66
g       103 0147 0x67

Thursday, October 11, 2018

UK goes on an Arctic mission

Sun 10/08/2018 3:05 PM PDT

This week, the rather effete British Defense Secretary Gavin Williamson – a former fireplace salesman – said he was sending 800 shivering British soldiers to the Arctic to be ready to fight Russia there.

Amidst the snow.
And the ice.

As both Napoleon and Hitler must have said: "What could possibly go wrong?"
 ======================================================
A note:
>>IMHO<<
 I just hope they have a good pair of socks then ... A new Cold-War have started. Again. 
But this time our gov's aren't targeting the enemy, but their own civilians - us.
Isn't that illegal and against the "Geneve Convency"?

Have fun and enjoy the "Propagandist Time"! 
And Don't Panic! It might get worse...

Sunday, October 7, 2018

TACACS+ on Linux -- Server config

Users ,groups, enable = $enab15$


nano /etc/tacacs+/tac_plus.conf


# Created by Henry-Nicolas Tourneur(henry.nicolas@tourneur.be)
# See man(5) tac_plus.conf for more details
#


# Define where to log accounting data, this is the default.
accounting file = /var/log/tac_plus.acct

# This is the key that clients use to access Tacacs+ server


key = "Cisco321"

#You can also use Linux authentication 

# /etc/passwd file -- all users added to Linux will be also in TACACS+
#default authentication = file /etc/passwd


# Much more features are availables, like ACL, more service compatibilities,
# commands authorization, scripting authorization.
# See the man page for those features.





#Default Group

group = adminiis {
default service = permit #if deny here-no enable, no priv
service = exec {
priv-lvl = 15
    }
}
 

# to generate MD5 salted password use tac_pwd

# Usage: tac_pwd [-ehm] []
#        -e      do not echo the password
#        -h      display this message
#        -m      generate MD5 crypt
#Default User

 user = administrator {
member = adminiis
login = des $1$Os$YCyHqKOMpDWOW3VArn/wR.
}

#Enable Passworde to gain Privilege 15 !!

##!@ DO NOT CHANGE USER BELOW! @!##

user = $enab15$ {
    login = des $1$sZ$/XuPZ.ZEjTenroBEWJEy6.

}

TACACS+ on Linux => AAA Cisco config

Cisco Router AAA Tacacs+ configuration + Banner


aaa new-model
!
aaa local authentication attempts max-fail 5
aaa authentication password-prompt TACACS+Password:
aaa authentication username-prompt TACACS+Username:
aaa authentication login default local group tacacs+ local
aaa authentication enable default enable group tacacs+ enable
aaa accounting exec default start-stop group tacacs+
!
aaa session-id common
!
tacacs-server host 1.2.3.4
tacacs-server key Cisco123
!
!
!
aaa authentication attempts login 5
aaa authentication banner ^CCCCCCCC
*****************************************************************
*                                                               *
*      PRIVATE PROPERTY -- YOU ARE MONITORED! LEAVE NOW!        *
* ------------------------------------------------------------- *
*    THIS COMPUTER SYSTEM, INCLUDING ALL RELATED EQUIPMENT,     *
*                 NETWORKS AND NETWORK DEVICES                  *
*           (SPECIFICALLY INCLUDING INTERNET ACCESS)            *
*   ARE PROVIDED ONLY FOR AUTHORIZED USE. USE OF THIS SYSTEM    *
* AUTHORIZED OR UNAUTHORIZED, CONSTITUTES CONSENT TO MONITORING *
*                                                               *
*    UNAUTHORIZED USE MAY SUBJECT YOU TO CRIMINAL PROSECUTION   *
* EVIDENCE OF UNAUTHORIZED USE COLLECTED DURING MONITORING MAY  *
* BE USED FOR ADMINISTRATIVE, CRIMINAL OR OTHER ADVERSE ACTION  *
*                                                               *
*    USE OF THIS SYSTEM CONSTITUTES CONSENT TO MONITORING.      *
*                                                               *
*****************************************************************



^C
!

!
!
!
!
aaa session-id common
ip arp proxy disable
ip arp gratuitous local
!

dummy2tuntap w/BASH --part II

###!!  For the rest of us normal vulnerable people with only one 
physical network adapter and public IP address on it::
 
sudo ip link set dummy0 up
sudo ip tuntap add dev TAP0 mode tun

 
=================================== 
To make the deployment faster I am using the below BASH scripts
 to create and destroy interfaces when needed
======================================= 
 nano dummy-bridge.sh
#!/bin/sh
/usr/sbin/tunctl -t tap0
/sbin/ifconfig tap0 0.0.0.0 promisc up
/sbin/ifconfig dummy0 0.0.0.0 promisc up
/sbin/brctl addbr br0
/sbin/brctl addif br0 tap0
/sbin/brctl addif br0 dummy0
/sbin/ifconfig br0 172.22.22.22/24 up
echo 1 > /proc/sys/net/ipv4/ip_forward
======================================= 
nano dummy-bridge-stop
#!/bin/sh
ifconfig br0 down
ifconfig dummy0 down
ifconfig tap0
brctl delif br0 tap0
brctl delif br0 dummy0
brctl delbr br0
tunctl -d tap0
tunctl -d tap1
tunctl -d tap2
tunctl -d tap3
======================================
 
 
 

Networking between Containers - NAT, PAT, Bridge & Dummy2tuntap w/BASH script

- install bridge-utils         (brctl IMHO more stable, working with old+new Cisco HW too)
- & create a bridge

brctl addbr br0
( new method:   ip link add br0 type bridge ) #iproute2

A DHCP server like Dnsmasq
 is run on the host to provide DHCP services and IPs from a 
preselected subnet range ie 10.0.3.0/24 to any connecting devices.
This is required so containers and VMs can get IPs on startup.
Without this you would need to setup networking manually for each container or VM.
  
IPtables rule to enable NAT masquerading (in > out)
- containers and VMs can access the Internet

iptables -t nat -A POSTROUTING -s 10.0.3.0/24 ! -d 10.0.3.0/24 -j MASQUERADE

 Port forwarding traffic from a host port to a specific container port (PAT)
Typical example of a port forwarding command:

iptables -t nat -A PREROUTING -p TCP -i eth0 --dport 80 -j DNAT \
--to-destination 10.0.3.10:80 

Host Bridge (Layer 2)

Instead of using the private NAT you can directly bridge one of your hosts physical network interfaces with a bridge to connect containers to it.
(Assuming you have a Private IP range allocated. Or many IPv4 addresses...)
 
In case you don't have physical interface - you can bridge a tap device
with a DUMMY0 interface  //see below
         ...(i knew there will be an usage for it@!)....
 
 brctl addbr br0
brctl addif br0 eth0
 
#to list all active bridges

brctl showbr
 
with DHCP the /etc/networking/interfaces file of a container looks like this
 
auto eth0
iface eth0 inet dhcp

Ntwork interface is eth0. To set a static IP simply specify the IP address+mask+gw
and change dhcp to static as shown below
 
auto eth0
iface eth0 inet static
address 10.0.4.10
gateway 10.0.4.1
netmask 255.255.255.0
 ==================================
 
To be continued...