Linux

Quick and Dirty OpenYuma Build, Run and Test

Blog tags: 

Here is my guide for a quickstart instead of reading their documentation:

Install Prerequisites

# sudo apt-get update
# sudo apt-get install -y git autoconf gcc libtool libxml2-dev libssl-dev make libncurses5-dev libssh2-1-dev openssh-server build-essentials git

Reconfigure SSHD

Edit sshd_config and under the line Port 22, add the following two lines

# sudo vi /etc/ssh/sshd_config

# What ports, IPs and protocols we listen for
Port 22
Port 830
Subsystem netconf /usr/sbin/netconf-subsystem --ncxserver-sockname=830@/tmp/ncxserver.sock

Restart SSH with the following command

sudo service ssh restart

Download, build and install OpenYuma

GIT clone, make and install the following - netconfd will run with your current user

# git clone <a href="https://github.com/OpenClovis/OpenYuma.git">https://github.com/OpenClovis/OpenYuma.git</a> openYuma
# cd openYuma
# make
# sudo make install

# sudo cp /etc/yuma/netconfd-sample.conf /etc/yuma/netconfd.conf
# /usr/sbin/netconfd --superuser=`whoami`

Connecting with yangcli

Open a second terminal and run the command:

# yangcli

Something like the following should appear - note the YOURUSERNAME and YOURPASSWORD variables which need to be replaced with something more appropriate

yangcli> connect server=localhost user=YOURUSERNAME password=YOURPASSWORD
val->res is NO_ERR.

yangcli: Starting NETCONF session for rbrash on localhost

NETCONF session established for rbrash on localhost

Client Session Id: 2
Server Session Id: 1

Server Protocol Capabilities
   base:1.0
   candidate:1.0
   confirmed-commit:1.0
   rollback-on-error:1.0
   validate:1.0
   url:1.0
   xpath:1.0
   notification:1.0
   interleave:1.0
   partial-lock:1.0
   with-defaults:1.0
   base:1.1
   validate:1.1
   confirmed-commit:1.1

Server Module Capabilities
   iana-crypt-hash@2014-04-04
      Features:
         crypt-hash-md5
         crypt-hash-sha-256
         crypt-hash-sha-512
   ietf-inet-types@2013-07-15
   ietf-netconf-acm@2012-02-22
   ietf-netconf-monitoring@2010-10-04
   ietf-netconf-partial-lock@2009-10-19
   ietf-netconf-with-defaults@2011-06-01
   ietf-system@2014-08-06
      Features:
         radius
         authentication
         local-users
         radius-authentication
         ntp
         ntp-udp-port
         timezone-name
         dns-udp-tcp-port
   ietf-yang-types@2013-07-15
   nc-notifications@2008-07-14
   notifications@2008-07-14
   yuma-app-common@2012-08-16
   yuma-arp@2012-01-13
   yuma-mysession@2010-05-10
   yuma-ncx@2012-01-13
   yuma-proc@2012-10-10
   yuma-system@2014-11-27
   yuma-time-filter@2011-08-13
   yuma-types@2012-06-01

Server Enterprise Capabilities
   None

Protocol version set to: RFC 6241 (base:1.1)
Default target set to: <candidate>
Save operation mapped to: commit
Default with-defaults behavior: explicit
Additional with-defaults behavior: trim,report-all,report-all-tagged

Checking Server Modules...

Ubuntu SNMPD - Localhost MIB-IP and Statistics

Blog tags: 

As part of the processing of exploring some infrastructure for my thesis - I noticed that the SNMPD documentation needed some love despite the many eyes of the Internet. Here is how I set snmpd up in Ubuntu 15.10 for localhost access to IP-related information contained within the IP MIB.

Install the following:

sudo apt-get install snmp snmp-mibs-downloader snmpd libsnmp-dev

C UDP Client and Server example

Blog tags: 

I recently ran across some code for some students that was terribly written regarding sockets and upon helping them - I realized, that most examples just abhorrently throw all of the required code into the program with no function calls to help segment/make sense of it.

Here is my example programs - note that the actual socket code is wrapped up in socket.c & shared.h:

Quick and Simple Ubuntu DNSmasq & DHCP Router

Blog tags: 

While setting up a research network, I needed to setup a router/gateway machine between my network lab and the IT managed network; they require a static MAC and wall-port so they can mantain "security" on their network. To get around this (and is approved because of my lab's status) - I needed to setup a machine that would act as a router. Here is the short and simple method to getting Ubuntu and DNSmasq setup.

Modifying Linux ELF Binaries - Changing Callq Addresses

Blog tags: 

For awhile, I have wanted to write a simple tutorial of in-line patching of binaries and in particular, changing the assembly instructions and having a binary skip to whatever function we desire manually. This involves tweaking the callq instruction (call can be altered too, but it refers to a static address vs. a relative address).

Okay so lets get started - this tutorial is written to alter one specific thing and assumes that you have some basic knowledge of assembly & know how to compile basic programs. I am also assuming that you could find strings within binaries and know how to convert values in hexadecimal.

The example to be used in this test application contains a main function, and two functions (function1 and function2) which print different messages. The goal of this exercise is to modify the application AFTER it has been compiled so that function2() is executed instead of function1().

Ubuntu 14.01 Not Recognizing All-in-one SD Card reader

Blog tags: 

Interestingly enough, Ubuntu 14.01 was unable to recognize my all-in-one SD card reader (Nextech is the brand) despite working in Windows land. Dmesg output was stating errors and assuming that this is just a generic USB device, I wondered if there was something at play, such as SCSI. I was correct and here are the two changes that are needed to make it work.

sudo apt-get install udisks sg3-utils

Then add the following to /etc/modules.conf

Updating/Compiling OpenDiameter and Basic EAP-MD5 Test

Blog tags: 

Recently, I was asked to review, maintain, update and document existing work from the Concordia University in Montreal. In an effort to continue the past OpenDiameter work - here is the current work for 1.0.7i(ish) and documentation.

OpenDiameter 1.0.8 will be available SOON!

Compiling OpenDiameter 1.0.7-j and running the EAP-MD5 test

The code can be built using the following process:

sudo apt-get install libbz2-dev build-essential python python-dev

Pages

Subscribe to RSS - Linux