ELF file reader (Linux).

Last updated :- 29/July/2006.[download]
The ELF file stucture is defined in /usr/include/linux/elf.h. This tool the name of which is Alf, parses the contents of the ELF file and puts them on the screen or where ever the output is being redirected.

Alf, the current version parses and displays the ELF-header, Programm-headers, Section-headers, Dynamic section, Relocation-sections/tables, Symbol-sections(both dynamic and static) and it can also dump the contents of any/desired section or segment.

Click here to see the info generated by the Alf with option -[a | -all | -ALL] for the /bin/cp file.
Click here to see the info generated by the Alf with option -[d | -dynamic] for the /bin/cp file.
Click here to see the info generated by the Alf with option -[r | -relocs] for the /bin/cp file.


Alf, command line options and arguments.

-The name of the elf file to parse.
Any where in the command line, when a token appears with no preceeding single hyphen or preceeding double hyphens; the token is considered a file name. Only one such token(file name) is accepted.

-To get help....
[-H | --help]

-To get the version number....
[ -V | --version ]

-To get/display all the output generated by the options -d, -h, -l, -r, -s, -S ....
[-a | --all | --ALL]

-To get/display the dynamic section....
[-d | --dynamic]

-To get/display the elf-header....
[-h | --file-header]

-To get/display the programm headers....
[-l | --programm-headers | --sections]

-To get/display the relocation sections....
[-r | --relocs]

-To get/display the section headers....
[-s | --section-headers]

-To display the symbol table...
[-S | --syms | --symbols]

-To dump the contents of any section....
[-x<.name> | --hex-dump <.name>]


[download]


ting(ping, traceroute and path-MTU) .

Last updated :- 26/September/2006.[download]
You know what ping does, and what is a traceroute. This is my implementation of them. Written purely to study the the protocol headers of IP/ICMP and raw-sockets. I call it the ting, the name ting makes sense to me because this programm pings and traces the route. ting is written in C++ . ting can also be used to find the path-MTU. This is not the final code. It will be improved and extended in the future.
You are advised in your own interest. Though you can spoof and with change in the code, ting could be used to launch a flood of ICMP requests. But this is a criminal activity so please donot do this. Just have fun.





ting, command line options and arguments.

[help]
  example :- ./ting help
  This option will generate a help screen.

<src x.x.x.x dst x.x.x.x> [mtu <n>] [ttl <n>]
  The "x.x.x.x" are the source and destination IP addresses. The n are the number. With option ttl, n could go upto 255. With option mtu, n is maximum size of the datagram. You'll use option ttl to trace the route. You'll use the option mtu to find the path-MTU.

--If option ttl is not used then the ttl of the outgoing datagram is set to MAX_TTL(a macro defined in file stuff.h).
--If option mtu is not used then the the size of outgoing datagram is the combined size of IP and ICMP headers.
--If mtu is less than the combined size of IP and ICMP headers then the size of the outgoing datagram is the combined size of the IP and ICMP headers.


[download]


DNS client(Linux).

Last updated :- 29/july/2006[download]
I've written this client to better my understanding of DNS potocol. As a client side implementation it was an easy protocol to work with. I've tried to implement many(if not all) RR(resource record) requests. You can use this client to study the DNS protocol or to test the configuration of DNS servers(BIND).

It's an early version. Lot has to be done yet :-( . It does not mean that current version(0.0.9.beta) is doing nothing....
Click here to see the reply generted by dnsCli for the A RR type at linuxpakistan.net
Click here to see the reply generted by dnsCli for the A RR type for authoritative record at linuxpakistan.net
Click here to see the reply generated by dnsCli for SOA RR type at linuxpakistan.net


- The opcodes implemented in this version .
Query
IQUERY   (Inverse Query)

- Opecodes to be implemented in the future versions .
Status
Notify
Update

- RR types implemented in this version .
A   (Address)
NS   (Name Server)
CNAME  (Canonical Name)
HINFO  (Host Information)
MX  (Mail Exchange)
AXFR  (Request for zone transfer)
ANY  (All)
PTR  (Pointer)
SOA  (Start of authority)   New
TXT  (Text string)   New

- RR types to be implemented in the future versions .
WKS   (Well Known Services)

Please note:- if you get the runtime error segmentation fault, increase the value of macro REPLY. This macro is defined in the file dnscli.h. 



DnsCli, command line options and arguments.

-To give the name of the DNS sever....
[ -s | -S | --server ] examples would be....
dnsCli -s202.10.10.1
dnsCli --server 202.10.10.1

-To give the name of the domain....
[ -d | -D | --domain] examples would be....
dnsCli -dlinux3.soni.pk
dnsCli --domain linux1.soni.pk

-To get the version number....
[ -V | --version ]

-To get help....
[ -h | -H | --help ]

-To give the ID number....
[ -i | -I | --id ] examples would be....
dnsCli -i1000
dnsCli --id 900

-To give the IP address for inverse query....
[ -p | -P | -* | --pointer | --ptr] examples would be....
dnsCli -p202.10.10.1
dnsCli -*202.10.10.1

-To give the RR type....
[ -t | -T | --type-of-record | --type | --tor ] examples would be....
dnsCli --type mx
dnsCli -ta

-To get the authoritative reply....
[ -a | -A | --authority ]

-To get more detail....
[ -v | --verbose ]

-To set the connection timeout....
[-c | -C ]
By default the timeout value is 5 seconds.


[download]