Source Code documentation is an often neglected aspect of Software Engineering. In most software projects, an overview of the code structure is useful both for new developers looking at the code for the first time, as well as a reference for all developers interacting with this code.
Fortunately, there are many useful tools to help us with this issue, namely, Code Documentation Generators. These tools pick up the code’s structure through syntactic parsing and typically augment it with information supplied by the developers directly in the source code. In the last step, a nice HTML-based reference manual is typically exported.
The following sections present some interesting examples of this type of tool.
“Doxygen is the de facto standard tool for generating documentation from annotated C++ sources, but it also supports other popular programming languages such as C, Objective-C, C#, PHP, Java, Python, IDL (Corba, Microsoft, and UNO/OpenOffice flavors), Fortran, VHDL, Tcl, and to some extent D.”
if a tracker response has a key failure reason that maps to a human readable string which explains why the query failed
the response contains two typical keys:
number of seconds the downloader should wait between regular rerequests
a list of peers, each peer containing
HTTP/1.1 200 OK
URLs for this protocol use the form udp://tracker:port. This type of tracker was created to improve on the overhead caused by the HTTP protocol usage. The URLs can be obtained in the metadata file for the torrent.
Possible requests supported by a UDP Tracker:
Before announcing, the client must obtain a connection ID (to avoid IP spoofing problems).
Choose a (random) transaction ID, Fill the connect input structure, Send the packet.
Here I present some examples of BitTorrent protocol interactions.
Wireshark can be used to analyze BitTorrent protocol interactions in TCP/IP.
Remember that BitTorrent’s peer protocol operates over TCP or uTP. At the time of writing, Wireshark could identify correctly a uTP connection, but unfortunately would not decode its contents as a BitTorrent protocol session. It decodes it fine for TCP/IP connections.
The Handshake message flows in both directions, this means that each peer sends an handshake message to the other.
“Extended” message examples
In these messages we can see which extensions are supported by a peer / downloader.
Port, Interested, Unchoke example
A request for a piece of a file:
The reply with the piece’s data contents:
Not Interested example
Downloader Peers screenshots
Usually, when a peer is connected to another one, the remote peer appears in the “Peers” tab for a torrent.
Most virtualization platforms provide some sort of mechanism of communication between the the hypervisor and its guest virtual machines. “Open VM Tools” is a set of tools that implements such communication mechanisms for VMware™ virtual machines and hypervisors. In this book we analyze each of these these tools and APIs, from high-level usage to low-level communication details, between the guest and the host. This information can be used for a better understating of what actually happens when using a guest machine with these tools. It can also be used as inspiration for using and extending guest-hypervisor communication and penetration testing.
Mitigate i.e. singling out all the illegitimate IP packets, while allowing legitimate ones to pass through
“To detect the attack, we use the netflow sent by the routers and analysed by the Arbor Peakflow boxes. Each router sends a summary of 1/2000 of the traffic that is actually passing through it. The Arbor Peakflow boxes analyse this and compare it to the attack signatures. If the comparison is positive, mitigation is activated within seconds.
The signatures analysed are based on traffic thresholds of
“packets per second” (pps, Kpps, Mpps, Gpps) or
“bits per second” (bps, Kbps, Mbps, Gbps) on certain packet types”
DDoS attack types
For example, Guard-Host acknowledges the following DDoS attack types:
DDoS Attack Types
In the following diagram, the packets in the red area are flagged as belonging to a DDoS attack and are thus discarded and not sent to the server under attack.
Traveling Ruby consists of a set of multi-platform portable Ruby binaries, which can be used to distribute Ruby-based products and run them even in machines where Ruby is not installed. It’s very useful, as you can also use it to pack multi-platform applications.
Traveling Ruby is a project which supplies self-contained, “portable” Ruby binaries: Ruby binaries that can run on any Linux distribution and any OS X machine. It also has Windows support (with some caveats). This allows Ruby app developers to bundle these binaries with their Ruby app, so that they can distribute a single package to end users, without needing end users to first install Ruby or gems.
A Code smell is an interesting Software Engineering concept. According to Wikipedia, a Code Smell
“refers to any symptom in the source code of a program that possibly indicates a deeper problem. According to Martin Fowler, “a code smell is a surface indication that usually corresponds to a deeper problem in the system“. Another way to look at smells is with respect to principles and quality: “smells are certain structures in the code that indicate violation of fundamental design principles and negatively impact design quality“.
NOTE: StyleCop works with source code, whereas FxCop works with compiled files
Most of these smells lower your code’s quality and maintainability. Be sure to include some of these detection tools on your development processes, as well as appropriate coding standards. Automatic noncompliance detection can be accomplished by adding these tools to your build process.
Just published a new e-book at Amazon.com: “VMware™ hypervisor fingerprinting”.
You can find it here:
«In this book, we show how to determine hypervisor properties by running commands in the guest operating system, without any special privileges in the host machine running the hypervisor. This can be useful for penetration testing, information gathering, determining the best software configuration for virtualization-sensitive and virtualization-aware software. Finally, we present a reporting tool that unifies all the presented methods, by running them all in sequence and gathering the information in a useful report that can be run from any guest system.»