Saturday, March 28, 2015

What's in the honeypot? CVE-2014-4019 - Attack on SOHO Router to Download Admin Password

Looking at the honeypots one more time today I found the miscreants searching for an unprotected router configuration that provides the username and password.  By utilizing the router it has been known that they can modify the DNS settings of these routers to conduct man-in-the-middle attacks intercepting or relaying all traffic through their servers.

Below is the log entry that I found:

According to the exploit published by exploit-db located here by requesting, through a GET request, the rom-0 file contains the admin username and password.  Then in the following link are instructions how to decompress the file.

The following CVE's have been recorded for these vulnerabilities that have been identified:
Also applicable is

Here is an article by SC Magazine about 300,000 SOHO routers that were compromised due to this vulnerability:

I am also interested in the IP Address that touched the honeypot looking for this vulnerability.  IP Address is  Looking at the following record is pulled:

When you search for this IP Address on nothing comes up about this IP Address. 

However, as you search the web you find a history for this IP Address as shown below:

If you do a reverse DNS lookup no PTR records are identified.  

What's in the honeypot? Shellshock to Remote Control / DDoS Bot

Today in searching through what is gathered in the honeypots we found yet another attempt attempt at executing commands through the Shellshock vulnerability.  Below is the log that we are going to look at closer.

Looking at the information provided in the log above we gather the following 2 IP Addresses. - Using the below information is returned about the IP Address
descr:CHINANET shanghai province network
descr:China Telecom
descr:No1,jin-rong Street
descr:Beijing 100032
country:CN - Using the below information is returned about the IP Address
descr:CHINANET jiangsu province network
descr:China Telecom
descr:A12,Xin-Jie-Kou-Wai Street
descr:Beijing 100088
Inside the User Agent where they are executing the command through the shellshock vulnerability is the download of a file called java. After downloading this file you can see that it is a "ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, for GNU/Linux 2.2.5, not stripped"

If we look at the strings of this file we are able to pull out a few artifacts of interest.  The first is an email address of "".  This email is probably not related to the malware, possibly is referenced in a library that they use inside of the malware.

Then looking at the strings you can identify what the malware after it is executed is being used for:

It appears that this is being used on a Linux server to play a part in DDoS attacks.  You can see the Attack on UDP (Possilby NTP), SYN attack, ICMP Attack, DNS, DNS Amplification attacks, and others.  Then in the strings you come across a list of IP Addresses.  As I looked at a few of these addresses they appeared to be in Asia.

Looking at the IP Addresses I am not sure if these are targets of the DDoS, IP Addresses to avoid, or just a list of IP Addresses they decided to place in the malware.

Upon executing the malware it makes a static connection over port 25000 back to the IP Address that the malware came from.

The malware also copies itself into /usr/bin and creates a hidden file called .sshd.

After uploading the malware to virustotal its initial detection went back to early March.  It confirmed my theory of it being a tool used in DDoS and to remotely control the server.  If you would like to go to the information on click here.

Also in the research I found that it was trying to do a DNS lookup for the following domain
This domain on virustotal is flagged and you can see the results here.

Looking at the parent domain of you identify that it is related to other activity that is flagged by virustotal.

You also learn that it is registered at  The above information can be found here.  Looking at the history of this domain it has an interesting past going back to June 6, 2014.

Wednesday, March 25, 2015

What's in the honeypot? SSH Scanning leads to Interesting Domain

SSH scanning appears to be a popular activity for a honeypot to capture.  I thought I would share what I have seen in my honeypots thus far.

Below are the top 10 IP Addresses that have scanned my honeypots with the number of occurrences they appear in the logs:
1: - 2,390
2: - 2,332
3: - 2,125
4: - 2,104
5: - 1,728
6: - 1,683
7: - 1,604
8: - 1,555
9: - 1,472
10: - 1,371

These statistics were pulled from multiple honeypots into a single file and then I wrote the below python script to aggregate the total number of occurrences:


file = open('stats.temp', 'r')
for line in file:
item = line.split(' ')
if priorLine == item[0]:
priorLine = item[0]
priorCalc = priorCalc + int(item[1])
print priorLine + " " + str(priorCalc)
priorLine = item[0]

From the top 10 IP addresses above I wanted to see if any of them appeared in more than 1 honeypot. Surprisingly enough the below 3 IP Addresses appeared in more than 1:

Using a whois lookup on these IP Addresses the below information can be derived.  Again the information returned does not provide attribution in any way to the country or owners of the IP Addresses.

IP Address:
IP Range: -
Country: CN (China)

IP Address:
IP Range: -
Description: CHINANET jiangsu province network
Description: China Telecom
Country: CN

IP Address:
IP Range: -
Description: China Telecom
Country: CN

I also wanted to see if these IP Addresses showed up in virustotal as serving malware or having a history of malicious websites associated with them:

IP Address: came back with no malicious domains being associated so far.

IP Address: came back with the following information:
IP Address: came back with the following information:

From the above research about the IP Addresses we identify some domains and URL's of interest. First I am going to look at the registrations of the domains:

IP Address:
By searching for this domain the following IP Addresses over time have been associated with it.
It appears in the above listing the most recent URL utilized for this domain is currently pointing to IP Address  After looking at this IP Address I wanted to see if the last file uploaded from that domain still existed.  Sure enough the below file I could still download:

Finding that the file was an APK or an Android package I pulled it down.  An APK file is nothing more than a zip file.  We are looking for the dex file inside of the APK so I unzipped it with the following command:

Checksum of APK: 77696c5fc37ce4881a319c1b962b74f1
unzip sosmap_android.apk classes.dex

Then with the classes.dex file I needed to extract the Java source code.  I can convert the dex file to Java class files by executing the following command:

Checksum of the dex file: fee0756c47a10382161d720083342c65
dex2jar classes.dex

This creates the following file of classes_dex2jar.jar.  Then the jar file can also be unzipped at this point-in-time.  

The decompiled jar file has a checksum of the following: 06538782eaa69970f54b59f1d30c60bc

Well I have chased this down the rabbit hole as far as I want to go.  Enjoy!


Monday, March 23, 2015

What's in the honeypot? Banner Information Gathering System by

I have been watching for a while the IP Address of which would appear in the logs almost everyday as shown in the picture below:

Noticing the URL or what appears to be a URL in the banner.  I wanted to know more about this scan or these scan occurrences.  First I googled and then I visited the site and this is what you see upon visiting "":

I find this project intriguing that they are collecting the banners and then monitoring them as they change.  This would provide information of patches that are deployed to webservers, up-time, and change amongst the web servers.  I thought I would go a little further and try and find if they release this information on their website at

From the links provided at this site I could not find this information but I did find the following links to be of interest:

Emerging Cyber Threats Report 2015 

2014 Georgia Tech Cyber Security Summit

Sunday, March 22, 2015

What's in the honeypot? "The Moon" malware is self-replicating and impacts Linksys E Routers - CVE-2013-5122

As I was looking through the logs of the honeypot I found the following occurring:

Well if you google "/tmUnblock.cgi" you find that this scan is related to "The Moon" malware.  This malware impacts Linksys E series routes that are used by multiple home users.  After a Linksys E series router is infected it will then scan and try and find other routers that are vulnerable and infect them.
Since this malware came out Linksys has since patched the vulnerability but to implement it a firmware update has to be done on the router.  Well, maybe the IP addresses that are scanning my honeypot are infected Linksys routers.

Well without actually scanning them I will not know if they are vulnerable, but I thought I would look up using or other registrars to see if the network the IP is on indicates it possibly could be based on being a residential ISP or a small business. - PT Metroptix Lintas Nusa - Indonesia - RRMA Time Warner Cable - US - Insight Communications Corp - US - Net-Core-BB-3 - Charter Communications - US - CBeyond Communications LLC - US - MediaCom Communications Corp - US
Again I am not sure but looking at the subnet ranges it appears that all but one is possibly a residential ISP or a small business.

Well if the router is infected with this malware, this is an indicator that the router can be used to cause a DDoS attack or be in a mesh of other devices to cover the tracks of miscreants causing trouble.  

Here is the link to the vulnerability as described by Cisco who owns Linksys:

The link to the CVE that describes the vulnerability is located here:

Saturday, March 21, 2015

What's in the honeypot? CVE-2012-1823 execute arbitrary code in PHP before 5.3.12 and 5.4.x before 5.4.2

I thought I would create a series of posts about what I have collected and will collect in my honeypot that is running.  This is again only meant for educational purposes, and as I discuss what is found I am not attributing it to anyone.

Here is one of the first items that I would like to touch on:

The POST request to the honeypot was not found and displayed the 404 error.  However, I wanted to understand what was hex encoded.  I dug back into my archive and found my hex decoder at the following link.

Notice also that when I copy the hex encoded pattern the letters are in upper-case and my decoder is in lower-case.  So I found a quick sed command to convert the letters to lower-case, as shown below.

After I decoded the hex I found the following text:

Ok noticing that the -d looks to be an option.  So I did a search for PHP options.  

So from the above command switch it appears that they are trying to change the php.ini entries.  Then after a little more searching the following exploit published to exploit-db came up addressing CVE-2012-1823.  The exploit is located here.

Evaluating the pststr() variable that is created it matches the same patterns as I have seen in the honeypot.

Also reading about the exploit you find that the payload is actually in the POST data that is sent with the web request.  The description of the vulnerability as posted on the CVE page is, "sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not properly handle query strings that lack an = (equals sign) character, which allows remote attackers to execute arbitrary code by placing command-line options in the query string, related to lack of skipping a certain php_getopt for the 'd' case".

Friday, March 6, 2015

The One Who Inspired My Career in Computers passed on Recently

The man who inspired me at an early age to get into computers, recently died, so I would like to take a moment and post about him.  I will refer to him as @brothersthree through-out this post.  Just prior to his passing I received from him multiple items that he continued to maintain in his possession.

@brothersthree went to college and during his time their he became familiar with computers and took an interest in them.  He decided to take some classes in which he would have to rent time on the mainframe to complete his assignments.  The access to the mainframe was limited based on seats and scheduling.  Most of the scheduling was taken up due to those advanced further in their collegiate courses.  The times that were available were often during late hours of the night or early in the morning hours.

Then a telephone line or modem access was made available to the mainframe, again this was limited to number of connections but alleviated some of the congestion.  I am not sure if at this time or before he purchased a Kaypro II computer.

I remember barely the clicky keyboard, with large 5 1/4 drives, and a handle on the back to carry it.  Out of curiosity I had to look up the type of processor and memory that it had.  According to Wikipedia it contained a 2.5Mhz Zilog Z80 Processor with 64kb of RAM.  I remember being allowed to use Wordstar on the computer and thinking how amazing it was.

As a young child I had dreams of working on this multiple times and was drawn to the click of the keyboard and the display of what I was typing on the screen.  After a small period of time and I am not sure if it was on his KayPro or a new 8086/8088 that he introduced me to what I consider my first computer programming language.  I was introduced to Turbo Pascal.  In the items I received from him was a 5 1/4 disc of Turbo Pascal version 3.01.

In this language, he wrote one of the first personal checkbook programs for the computer.  Amongst the items was version 4.0 of the checkbook programs source code that had been printed.  
This program and probably others inspired @brothersthree to start a software company called "Brothers Three Software".  At the time of when I imagine version 1 came about in 1987-89 it was a foreign concept to most people to store your checkbook on a computer.  His efforts to market and sell this software never took off in his mind, however, I bet it inspired multiple people that he spoke with, well maybe it was only me.

Amongst the items I received were the original MS-DOS 6.22 disks as shown below:
Windows 3.11 3 1/4 discs, Windows 95, Windows 98 SE Boot Disc and Windows 98 SE install CD.

Also in the items were a few old sticks of memory as shown below:

He always had a passion for computers through-out his life.  I remembered and found a letter that he sent to me in early January 2000 about the impact of the Y2K bug:

"The Y2K bug died with very little things happening.  One state in October sent car titles out that were [made in the year] 2000 cars, but the state computer put them as [made in the year] 1900 cars and listed them as antiques.  So the state made the corrections.

The only real trouble with computers was in Delaware, where at the stroke of midnight a big computer went down.  The only thing it caused was 800 slot machines would not work, so the casino was not able to get any more money from the slots." 

This man, @brothersthree, inspired me at the age of about 7 years of age to get into computers.  One of the first computer books that he introduced me too was the following:

I learned a little Turbo Pascal, progressed into BASIC, and then into Visual Basic and now into VBA, PHP, Visual Studio Products, Python, Bash, Perl, and many others.  May the legend of @brothersthree live on as being an early pioneer of computers and computer programming in Turbo Pascal.

Monday, March 2, 2015

Utilizing PowerUp.ps1 to Escalate Privileges on Windows 7 using an Unquoted Path Vulnerability

I found a great write-up by the Veris Group on how to use PowerUp.ps1 @  I thought I would take some time and walk through this tutorial on a Windows 7 box with a non-privileged user.

Following the Veris groups instructions:

1. I downloaded the PowerUp.ps1 script from their github repo at  Notice as of Dec 2014 this repo is no longer supported.

2. Drop the file PowerUp.ps1 into a location you can write to.  I have a folder I created called c:\PowerUp.

3. Then execute "powershell.exe -nop -exec bypass" to enable the execution bypass.

4. Then execute "import-module c:\PowerUp\powerup.ps1" of the full path plus the filename of the powershell script.

5. To setup the stage of having a vulnerable service to demonstrate with, I modified the following registry key to allow for an unquoted path vulnerability.

6. I removed the quotes around the path listed in the ImagePath of the registry.  Sometimes this is as easy as checking to see if your user can modify these paths on any service that has started.

7. Then I modified the permissions to the VMWare folder to where the user can read/write to the directory.

8.  With that the service normally it does not start automatically so I changed it to start automatically.

9. Now with this setup we can utilize the PowerUp.ps1 script to create a user account using this service.  

10. Using powerup.ps1 we now execute "Invoke-AllChecks".  The first check that it runs is for an unquoted path vulnerability and it finds the one that we setup.

11. Then we create the file that will create the backdoor account by the following command:

12.  The service.exe file was created now we copy that file into the directory of "C:\Program Files\VMWare" and call it VMWare.exe.  It will execute instead of going into the directory of "VMWare Tools".  However we do not have access to restart this service so we need to wait for the user to reboot the machine.  However, with limited access you could generate some errors for the user which would give them an indication that it needed to be rebooted.

13.  After the workstation restarted then the service loads as the local service account and  creates the account "backdoor" as an administrator on the workstation.

This is only one method of exploiting the unquoted path vulnerability on a workstation or server to gain administrative privileges on the computer.

Sunday, March 1, 2015

Extract List of IP Addresses from a File using grep

I have run into multiple occurrences where I only want to see the IP Addresses in a given file.  Today I found with the help of Command Line Fu a quick way to parse a file and only return the unique IP Addresses found:

cat tmp.txt | grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}' | sort | uniq

Sometimes I will use this to quickly parse out IP Addresses in an email.  The regulary expression can be changed to extract domain names out of an email also.

Powershell - Gather Mapped Drives from a List of Computer Names

I created the following Powershell script to gather remotely the mapped drives that users had in their profiles.  I had to create the script...