Posts

Basic windows command lines for ethical hacking.

To open command line. Go to start menu and type "cmd" without quotations. And it will start command prompt. To go to C:\> drive type cd\ To create a directory type mkdir directory_name. C:\>mkdir Isuru To insert some text into notepad. C:\>echo Leann will come again. > leann.txt To list tasks. C:\>tasklist To find specific task. C:\>tasklist | findstr firefox To kill a task. C:\>taskkill /PID 6880 /F 6880 is the process id. And /F will kill the task forcefully. To write all tasks into a file. C:\>tasklist > qwe.txt To change color of command prompt. C:\>color a To view all the files in your drive in tree view. C:\>tree To view ip information. C:\>ipconfig To ping any web address. C:\>ping www.google.com To trace route. C:\>tracert 209.85.175.103 Netstat This is to display the TCP/IP network protocol statistics and information. C:\>netstat To list the users. C:\>net user To delete the user. C:\...

Migrate all blogger(blogspot) posts to wordpress.

Image
This video shows how to migrate from blogger to wordpress. There are lots of plugins that can be used for greater blogging experience using wordpress.

Oracle/PLSQL: Execute an SQL script file in SQLPlus

Question: How do I execute an SQL script file in SQLPlus? Answer: To execute a script file in SQLPlus, type @ and then the file name. SQL > @{file} For example, if your file was called script.sql, you'd type the following command at the SQL prompt: SQL > @script.sql The above command assumes that the file is in the current directory. (ie: the current directory is usually the directory that you were located in before you launched SQLPlus.) If you need to execute a script file that is not in the current directory, you would type: SQL > @{path}{file} For example: SQL > @/oracle/scripts/script.sql This command would run a script file called script.sql that was located in the /oracle/scripts directory.

Change Oracle password after installation.

To change a password after installation: Start SQL*Plus: C:\> sqlplus /NOLOG Connect as SYSDBA : SQL> CONNECT / AS SYSDBA   Action SQL Statement Unlock a password ALTER USER username ACCOUNT UNLOCK; Lock a password ALTER USER username ACCOUNT LOCK; Change password of an unlocked account ALTER USER username IDENTIFIED BY password ; Change password of a locked account ALTER USER username IDENTIFIED BY password ACCOUNT UNLOCK;  

Resolving ORACLE ERROR:ORA-20000: the account is locked

From your command prompt, type sqlplus "/ as sysdba" Once logged in as SYSDBA, you need to unlock the hr account SQL> alter user hr account unlock; SQL> grant connect, resource to hr;

Check remote file size in php using PHP5 and cUrl.

To check file size you need PHP5 and Curl. It first try checking headers. But if file size is not specified in headers, it use cUrl to download the file and checks the size. File is saved in memory temporarily. <?php echo get_remote_size("http://www.google.com/"); function get_remote_size($url) {     $headers = get_headers($url, 1);     if (isset($headers['Content-Length'])) return $headers['Content-Length'];     if (isset($headers['Content-length'])) return $headers['Content-length'];     $c = curl_init();     curl_setopt_array($c, array(         CURLOPT_URL => $url,         CURLOPT_RETURNTRANSFER => true,         CURLOPT_HTTPHEADER => array('User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3'),         ));     curl_exec($c);     return curl_getinfo($c,...

Check whether url is valid with php

Use Filter Validator  to validate url. filter_var($url, FILTER_VALIDATE_URL); Example using that, if (filter_var($url, FILTER_VALIDATE_URL) === FALSE) {     die('Not a valid URL'); }