Browsing articles from "April, 2009"
Apr
30
2009

TCP Connect Port Scanner Source Code in C with Winsock

TCP connect() scanning is the most basic form of TCP scanning. The program performs a connect() command on those ports of the target machine which are to be checked. If the port is open then the connect() command will succeed and a connection will be established. If the port is closed the connect() function would simply timeout in the connection attempt. The simple steps would be : 1. Start a loop for the port number [...]

Apr
28
2009

TCP Connect Port Scanner with Linux Sockets (BSD)

TCP Connect Port Scanner works by trying to establish a connection with every port that is being scanned. If a connectio is established then the port is open otherwise closed. The steps are simple : 1. Create a socket2. Run a Loop to connect with each port on the remote system ; if connection established then port open otherwise closed. Code :

Apr
28
2009

PHP parse text and change urls into links

Regex can be used to convert all urls in a plain text into links i.e. with anchor tags. Code :

Apr
28
2009

C Packet Sniffer Code with Libpcap and Linux Sockets (BSD)

Libpcap is a packet capture library which can be used to sniff packets or network traffic over a network interface. Pcap Documentation gives a description of the methods and data structures available in the libpcap library. To install libpcap on your linux distro you can either download the source from the website and compile it and install. Or if you are on a distro like ubuntu then it can be installed from synaptic package manager. [...]

Apr
26
2009

Packet Sniffer Code in C using Linux Sockets (BSD)

To code a sniffer in C (Linux) the steps would be : 1. Create a Raw Socket. 2. Put it in a recvfrom loop. A raw socket when put in recvfrom receives all incoming packets. The following code shows an example of such a sniffer. Note that it sniffs only incoming packets. For sniffing all traffic on a network a packet capture library like libpcap can be used. Code : sniffer.c Compile : gcc sniffer.c [...]

Apr
23
2009

Javascript Image Cropper with Mootools and PHP

MooCrop is a library which can be used to create a cropping interface in your webpage. With this library after a crop region is selected a php script can be called to crop the image on serverside. The moocrop interface provides four values that is the width , height , left and top of the crop region ; these values can be used by a php script to crop an image. So these values can [...]

Apr
17
2009

Konqueror Dolphin not accessing Windows FTP Server

Hmmm, so it looks like that konqueror or dolphin wont access a windows ftp server properly whereas its absolutely fine and fast with linux ftp servers. One reason for this could be the NTLM authentication that windows ftp servers use. So using gftp or filezilla or fireftp in this case is a better option.

Apr
15
2009

Slow Internet on Ubuntu when using a switch

As usual internet was fast on ubuntu as it used to be till I needed to plug more PCs into the adsl route lying nearby. After connecting all computers and the adsl router to a switch I noticed that on one of the PC (Ubuntu 8.04) internet became really slow. Rest of the 2 PCs one on Ubuntu 8.10 and another on Ubuntu 8.04 had internet working fine. This slow internet PC was also the [...]