German | English
n.runs AG - Company
 
 
n.runs AG
Services by n.runs
IT INFRASTRUCTURE
IT SECURITY
IT BUSINESS CONSULTING

n.runs AG
Nassauer Straße 60
D-61440 Oberursel
Phone: +49 (0) 6171/699-0
Fax: +49 (0) 6171/699-199
E-mail: contact@nruns.com
Imprint

.Security Tools - N.bug 1.0.0.15 RC - Run-Time Tracer

Introduction
n.bug is a library call trace implementation for Windows NT operating systems. It is meant as a tool to quickly analyse specific library calls a binary program makes during runtime.


A typical n.bug trace run consists of the following steps:

1. User selects the functions to trace
2. User selects either a running process or a program path (called the target)
3. User initiates trace
4. n.bug attaches a debugger engine to the target and executes it or resumes execution
5. (optional) User interacts with target
6. User terminates trace
7. User inspects trace results and optionally saves them to a file
8. (optional) User repeats the process with different settings

As the result of a trace session, n.bug outputs the following information for each library
function call detected and matching the trace definition:

• The caller’s return address (points to the instruction after the call instruction)
• The module and function name called
• The type, name and value of the parameter upon entry into the library function
• The type, name and value of the parameter upon exit from the library function
• The return value of the call

The results of a trace session can be saved into a text file for future reference and documentation purposes.

General concept of Runtime Analysis
Runtime analysis inspects the code of a target process during its execution. In contrast to static analysis, which takes the processes code and data information and tries to determine the possible execution paths, runtime analysis does not suffer from the many cases in which static analysis cannot determine variable parts of the code flow.

On the other hand, runtime analysis is always limited to the code executed, since only this is what is inspected. Consider the following code example:

void vulnerable_func(char *str) {
char buf[255];
if ( check_formatting(str) ) {
do_something( str );
} else {
sprintf(buf,"Error in string: %s\n",str);
log( buf );
}
}

When doing runtime analysis, normally the correct interaction is used with the target process. In the case of the function above, the vulnerable part is located in the handling of exceptional circumstances, where check_formatting(str) is failing.

Runtime analysis tries to regain a level of abstraction from the binary code executed. Manual inspection of all binary code in a target is unfeasible. Therefore, levels of abstraction are required to speed up the process of bug finding. Runtime analysis tries to inspect parts of the code flow and give an output, which abstracts the functionality covered by the binary code.


(größere Ansicht)

Library call tracing
Most high-level languages use several levels of abstraction to hide small details of data processing and operating system interfacing from the application developer. The order of abstraction is roughly as follows:

1. OS Kernel Functionality, exposed by Software Interrupts

2. Basic operating system functionality

a. Exposed by low level libraries (eg. libc)
b. Exposed by High-level OS API

3. Application framework functionality, exposed by derivable classes
Simple runtime analysis will trap and record all calls to the OS Kernel (1) and report them to the user. This approach is used in many UNIX environments with tools such as “strace” or “truss”. On a Windows 32 Platform, this approach is not feasible, since the Kernel API changes with releases and is intentionally not documented.

Library call tracing traps the calls to both low-level libraries as well as high-level OS API libraries and records their arguments. This gives the user a more abstract view on the operation of a specific piece of code. n.bug in particular will set breakpoints on all library calls it is supposed to trace and report the arguments of the calls, both upon entering and exiting the library function.

It should be permanently in the mind of the user that library call tracing is not complete. It only covers the code executed and it only covers functionality in the binary implemented by known and traced library functions. Custom code using pointer arithmetic or code using custom libraries with functions not defined to trace are not covered and will not show up in the report.

The user should also keep in mind that only functionality executed after the start of a trace is covered. If n.bug is attached to a process (e.g. a server) and no interaction with the server takes place, only the calls in the server’s idle loop are traced, which are probably not of any interest. To achieve a maximal effect, the user should try to interact with the target process in as many different ways as possible. For example, a user authentication should be tried with different usernames and passwords, both correct and wrong, using as many account types as possible.

Trace definition files

n.bug uses trace definition files to know the functions to trace and their type and number of arguments. The trace files in general follow a C compatible syntax for function prototypes.

A simple trace definition looks like this:

int sprintf([out] char * buf, [in] fmchar * format );
int swprintf([out] wchar *buffer, [in] fmtwchar *format );
int vsprintf([out] char *buffer, [in] fmtchar *format, [in] void * argptr);

A prototype definition must at least contain a return type, a function name, the parentheses and a terminating semicolon. A more complete specification of the same function to trace would be:

int msvcrt:system([in] char *commandline);

This includes the exact module where n.bug should look for the function, hereby disabling all other implementations of system in other modules. Do not specify a general trace definition and a module specific together in the same trace file (see Bugs and glitches). It also gives the argument a name, which is then displayed in the result window and the saved report. The [in] specification tells n.bug that the parameter is of interest when entering the function only.

Download n.bug
Documentation
Penetration Test
 

August 11, 2010:
Corporate News
n.runs publishes the half-year report 2010 which confirms the forecast for the total year 2010
+++ Revenues amounting to EUR 2.94 Million generated, exceeding the previous year’s level by about 9 %
+++ EBIT improves to EUR 0.1 Million (half-year 2009: EUR - 0.48 Million)
+++ Tight cost and liquidity management successfully carried out
+++ Focus on consulting as the core business induces high order entry and continuous acquisition of new customers

* * *



June 16, 2010:
Corporate News
n.runs publishes 2009 Annual Report with outlook to the business year 2010
+++ Revenues amounting to EUR 5.66 Million generated
+++ EBIT improves to EUR -0.32 Million (previous year: EUR - 0.80 Million)
+++ Tight cost and liquidity management successfully implemented
+++Outlook to Business Year 2010: Revenue: EUR 6.50 Million, EBIT EUR 0.40 Million

* * *



5. January 2010:
press release
German Consulting Specialist n.runs AG expands their portfolio with an “On Demand” Penetration Testing Platform in cooperation with Indian Supplier iViZ Security

* * *



11. December 2009:
Corporate News
New n.runs Supervisory Board Elected
+++ New Supervisory Board is confirmed at the 2009 Annual Shareholder Meeting
+++ Günther Paul Löw is chosen as the Chairman of the Supervisory Board
+++ Ralph-Peter Quetz is chosen as the Vice Chairman


* * *



4. September 2009:
Corporate News
n.runs publishes 2008 Annual Report
Revenues increase by 22 Percent to EUR 6,70 Million +++ EBIT improves by EUR 0,21 Million to EUR -0,80 Millionen +++ Concentration on profitable Consulting Business


* * *

27 February 2009:
Corporate News
n.runs makes capital increase placement
+++ Subscribed capital increased by 8.7 percent
+++ Funds inflow to be used for reorganization and further growth in consulting
+++ Spin-off of the software solution aps-AV® planned


* * *

17 Dec 2008:
Advisory: Opera HTML parsing flaw lead to remote code execution 

* * *

27 Oct 2008:
Advisory: Eaton MGE OPS Network Shutdown Moduleauthentication bypass and code execution

* * *

21 Oct 2008:
Advisory: Internet Explorer HTML Object Memory Corruption

* * *

30 September 2008:
Corporate News
Figures from the first half of 2008 confirm expansion
+++ Revenues increase by around 30 percent to EUR 3.32m EBITDA improved
+++ by EUR 0.27m to EUR -0.35m Profit impacted by software investments,
+++ consulting profitable Outlook 2008


* * *

17 Sep 2008:
Corporate News
Microsoft selects n.runs as a member of the new program Microsoft Secure Development Lifecycle Pro Network
+++ n.runs AG exclusive member of Microsoft SDL Pro Network
+++ Only member of the MS SDL Pro Network on the European mainland
+++ Medium-term contribution to revenues in excess of 10 percent planned
* * *

10 Sep 2008:
Advisory alert:
Cross-Site Scripting Filter Evasion in various frameworks

* * *

10 Sep 2008:
Advisory alert: 
Horde Framework Cross-Site Scripting in filename MIME attachments

* * *

26 Aug 2008:
Press-release
IT Security for Governments and Military Organizations:
n.runs and Thales Now Co-operating


* * *

25 Aug 2008:
Press-release
Growing threat:
serious attacks on E-Mail-/AV systems constantly increasing n.runs introduces aps-AV – Protective cover for antivirus software