Tag: information

C#

Get USB information in C#

We will see how we can retrieve various information about usb devices in C#. We need the class ManagementObjectSearcher and Win32_DiskDrive class. To use this class we have to add a reference to System.Management namespace. and now.. the interesting part: 1 2 3 4 5 6 7 8 9 10 ManagementObjectSearcher theSearcher = new ManagementObjectSearcher("SELECT …

Enumeration, Network, Tools

NetBIOS name enumeration

We are going to use nbtscan tool to enumeratate NetBIOS names. NBTscan is a program for scanning IP networks for NetBIOS name information. It sends NetBIOS status query to each address in supplied range and lists received information in human readable form. To install it in Ubuntu: sudo apt-get install nbtscansudo apt-get install nbtscan How …

Databases, MySQL

Retrieve useful information from MySQL

Today we will see how can we retrieve various information from mysql server using SQL queries. Get all users: SELECT * FROM mysql.user;select * from mysql.user; Get top 10 tables in size: SELECT concat(table_schema,’.’,TABLE_NAME) TABLE_NAME, concat(round(data_length/(1024*1024),2),’M’) data_length FROM information_schema.TABLES ORDER BY data_length DESC LIMIT 10;SELECT concat(table_schema,’.’,table_name) table_name, concat(round(data_length/(1024*1024),2),’M’) data_length FROM information_schema.TABLES ORDER BY data_length DESC …

Apache, Linux

Retrieve useful information from Apache logs

Common locations where you can find Apache logs are /var/log/apache2 and /var/log/httpd/. You can extract valuable information from your apache logs. Here are some useful examples! Extract unique IP addresses: cat /var/log/apache2/access.log | awk ‘{print $1}’ | sort | uniqcat /var/log/apache2/access.log | awk ‘{print $1}’ | sort | uniq   Extract unique IP addresses with …

Apache, Servers/Services

Hide Apache version from hackers

A first line of defense in web application world is to hide as much info as possible from HTTP headers! In this article we will see how easy it is to hide apache’s version number. 1. Keep a backup of file /etc/apache2/apache2.conf. 2. Open /etc/apache2/apache2.conf file for edit. For ubuntu users issue the following command: …