Code a port scanner in C | linux

Tcp connect port scanning Tcp connect port scanner works by trying to establish a connection with every port that is to be scanned. If a connection is established then the port is open otherwise closed. This technique of port scanner is the most basic form of port scanning. However it is the slowest and not very stealthy and easily caught by ...

Php – parse text and convert urls into hyperlinks

The following function will parse a given text and convert all the urls into links. It does this using regular expressions. It converts email addresses to mailto links as well. Code function parse_links($str) { $str = str_replace('www.', 'http://www.', $str); $str = preg_replace('|http://(+)|', '<a href="http://$1">$1</a>', $str); $str = preg_replace('/((+)(.+)*@(+.)+{2,6})/', '<a href="mailto:$1">$1</a>', $str); ...

C Packet Sniffer Code with libpcap and linux sockets

Libpcap Libpcap is a packet capture library for linux 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 ...

Packet Sniffer Code in C using sockets | Linux

Packet sniffers Packet sniffers are programs that intercept the network traffic flowing in and out of a system through network interfaces. So if you are browsing the internet then traffic is flowing and a packet sniffer would be able to catch it in the form of packets and display them for whatever reasons required. Packet sniffers are used for various needs like ...

Slow Internet on Ubuntu when using a switch

Switches, Routers, Wires and speed 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 ...

Install Postgresql, phpPgAdmin and pgadmin on Ubuntu

Install Postgresql , phpPGAdmin and pgadmin 3 can be installed from synaptic. $ sudo apt-get install postgresql phppgadmin pgadmin3 After installation some configuration needs to be done. First of all setup the password of the user 'postgres' which is the default user of postgresql. Type the following in the terminal $ sudo -u postgres psql This will start the postgresql shell/console. Now to change the password type ...

Run php scripts from cron

Automatic Running In a web application there are many cases, when a certain piece of code or script needs to run automatically in the background to perform certain tasks, without the need of any user to start it. Like scraping, extracting or crawling data from web or perform some regular tasks like sending emails, system maintenance or administration, taking backups or ...

Install Apache Tomcat 5.5 on Ubuntu 8.04 Hardy

To install and run Tomcat on Ubuntu (8.04 over here) the following packages should be installed from synaptic : 1. tomcat5.5 2. tomcat5.5-webapps 3. sun-java6-jdk They can be installed from command line using the command sudo apt-get After synaptic finishes installing them open /etc/default/tomcat5.5 and edit it as follows : Find : #JAVA_HOME=/usr/lib/jvm/java-6-sun Change : Remove the # so that it is uncommented. JAVA_HOME=/usr/lib/jvm/java-6-sun It points to the java home ...

Access Windows File Sharing from Ubuntu

Some GUI tools that can be used to access windows shares (SMB) are :1. xSMBrowser2. Smb4K3. TkSmbGet them all from Synaptic. They are basically gui frontend for the smbclient command.Nautilus and Konqueror have the View Network options too and if they dont work the above 3 utilities may.Links :1. Setting Up Samba ...

Php set_time_limit wont take into account socket operations

The PHP function set_time_limit is used to set a time limit on the maximum execution time of a script. But if the script has socket operations using fsockopen , fread and fwrite or even CURL then the set_time_limit may not appear to have any effect on the scripts timelimit or timeout. Again if safe mode is on then also set_time_limit has ...



Connect with us