Tag: name

PHP

Getting visitors country from their IP

geoplugin geoPlugin is a free and easy webmaster resource to provide geolocation technology to your pages. $xml = simplexml_load_file(’http://www.geoplugin.net/xml.gp?ip=’.$visitor_ip_address);   foreach ($xml as $key => $value) { echo $key , ‘= ‘ , $value , ‘<br>’; }$xml = simplexml_load_file(‘http://www.geoplugin.net/xml.gp?ip=’.$visitor_ip_address); foreach ($xml as $key => $value) { echo $key , ‘= ‘ , $value , ‘<br>’; …

C

Get Process ID by name

We are going to use the following functions: CreateToolhelp32Snapshot Process32First Process32Next CloseHandle Source #include <stdio.h> #include <stdlib.h> #include <windows.h> #include <tlhelp32.h> #define INVALID_PID_VALUE -1;   DWORD GetProcessID( const char * processName );   int main(int argc, char* argv[]) { DWORD pid;   if(argc>1) { printf("rnSearching for the process id of ‘%s’ …rn", argv[1]);   pid …

Linux, Ubuntu

Change the hostname or computer name in linux

1. Open a terminal window. 2. Type the following command and hit Enter: sudo gedit /etc/hostnamesudo gedit /etc/hostname 3. Replace the current computer name with the desired new name and save. 4. Type the following command: sudo gedit /etc/hostssudo gedit /etc/hosts 5. Change the old 127.0.1.1 line to your new hostname. 6. Reboot

Linux

Get information about the processor – Linux

Gather all information about your processor: cat /proc/cpuinfocat /proc/cpuinfo Get the number of processors on your system: cat /proc/cpuinfo | grep processor | wc -lcat /proc/cpuinfo | grep processor | wc -l Get the model of your processor/s: cat /proc/cpuinfo | grep -m 1 "model name"cat /proc/cpuinfo | grep -m 1 "model name"

Brute-force, Enumeration, Network, Tools

Brute force directories and files names on web application

OWASP DirBuster is a multi threaded java application designed to brute force directories and files names on web application servers. DirBuster will attempt to find hidden pages and directories with a web application. Comes with a total of 9 different lists and it is extremely effective at finding hidden files and directories. It also has …

Microsoft SQL Server

Get Field Name and Type of Database Table

Today we will see how we can retrieve table’s columns’ names and types. USE mydatabase GO   SELECT column_name, data_type FROM information_schema.columns WHERE TABLE_NAME = ‘mytable’;use mydatabase go SELECT column_name, data_type FROM information_schema.columns WHERE table_name = ‘mytable’;

Microsoft SQL Server, MySQL, Oracle

SQL column name with blank space

Let’s see how we can write queries when a column name contains spaces:   Microsoft Sql Server SELECT [COLUMN Name] FROM TABLE_NAME;SELECT [Column Name] FROM table_name; MySQL SELECT ‘Column Name’ FROM TABLE_NAME;SELECT ‘Column Name’ FROM table_name; Oracle SELECT "Column Name" FROM TABLE_NAME;SELECT "Column Name" FROM table_name;