Sponsor

Security Videos
Sunday
Feb102013

Regex Practice Quiz 1 - Understanding Patterns

I created a quick Regular Expressions (Regex) quiz to help students with a basic understanding of Regex begin to understand patterns that it can be applied to.  You can find the google doc version of this quiz here. If you are not familiar with Regex already you can view a tutorial here.

For those who prefer to see the questions directly on TekDefense, here they are:

1. Write a Regular Expression that will match a date that follows the following standard “YYYY-MM-DD”.

2. Write a Regular Expression that will match a traditional SSN.

3. Write a Regular Expression that will match an IPv4 address.

4. Write a Regular Expression that will match an email address.

5. Given the example text that follows, which of the Regular Expressions will match only the MD5 hashes. Circle all that apply.

785158d78c22517b8f16dcf55b36668f  ./bombed.prt.1
db9118916aa2fe73bf3b35eadc19b728  ./YHM Phantom.JPG
8aaf18163366f4e950b43868f630a360  ./Sound_Moderator_MK2.stl
91997d2b885ac0116e3e4188c5f5706f  ./AR-15.Flash.Suppressor.Helical_Flute.stp
df15f45f8fcc56c0a3b56e9e59f263de  ./45_ammo_box.STL
ba0b20b7ebbbfcfd7f822a4c13fa080e  ./223_Round.stl
21667be06c1274fc460f9999054977f9  ./Fit Tester.JPG
9f823495a72bf9dd57c46c1516a8ada7  ./Simple22 - FCGPins^gen2-1.STL
3a78812c085baedad73cdb0223a1b6ef  ./BARREL - 5in (.40 S+W)(SPRINGFIELD XD TACTICAL
8ce382837a30b8c72c29a0096e851b33  ./lts-take-on-the-yhm-phantom-flash-hider.zip
b3e24968e7c53e07fcc1294ce01025ae  ./Silencer.stl
6457743d2008849a2251d79350e60eef  ./Renderings/MAC 10 SMG 001.JPG
1086eff0e881ad35e672f1db83b490c7  ./Renderings/Glock-22 Suppressor.JPG
48ac39a820cea6e7c35deecaff6f945b  ./Renderings/Flash Hider.JPG
cc096e493a1551dd5a58df524163fded  ./Renderings/22LR.JPG
60135661c95ee2f9e50a4516b0781c66  ./Renderings/Magazine view 420120101-16245-1yqg4mg.jpg
b0e15afe4cfaf31ccedefdb570c15c52  ./Renderings/f-120111026-21312-1hx76q3.png

A. \w\w\w\w\w\w\w\w\w\w\w\w\w\w\w\w\w\w\w\w\w\w\w\w\w\w\w\w\w\w\w\w
B. \w{32}
C. [a-f0-9]{32}
D. [a-f0-9]+

6.  From your answer to question 5 which of the valid Regular Expressions for an MD5 hash is the most specific and reusable for finding MD5 hashes in the future.

** Warning Answers below this line **

--------------------------------------------

Answers: Keep in mind that as this is Regex, there are many right answers.  If you have something different than what I have below it may still be right.  The best way to check is to test it out. You can test with Notepad++ or take a different route such as RegExr.  The answer to the fourth question will not work with all email addresses.  There are much more complex expressions that will catch a greater sum of the email addresses.  This one is focused on the format of john@example.com.

1. \d{4}\-\d{2}\-\d{2}

2. \d{3}\-\d{2}\-\d{4}

3. \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}

4. .+\@\w+\.\w{2,3}

5. A,B, and C

6. C

Sunday
Feb102013

Tektip ep21 - Drive Traffic to your Honeypot 


In this episode of TekTip, I am going to show a unique method to drive traffic to your Honeypot.  While I use Kippo as the example this approach will work for any Honeypot.

*If you do not know what Kippo is, shame on you. Watch this, this, and this to get caught up.

Now let's get to it.  The first thing we need to do is prep our Kippo Instance so that we can measure the results of the approach. Log into your Kippo Honeypot, probably on HoneyDrive.  Once logged in go to your kippo install directory and navigate to the data folder.

If using Honeydrive it will look something like this:

cd /opt/kippo/data

Now use the cat command to see what you currently have as allowable credentials in your userdb.txt.

cat userdb.txt
root:0:123456
root:0:abc123
root:0:p@ssw0rd

This is what I have.  As you can see I allow 3 of the top 10 most used passwords.  Now we want to add credentials that will be unique enough that they should not be attempted by your average attacker. Open userdb.txt in your favorite text editor and add a new line with the credentials you want to use. I added one for root:0:IamSo1337!. Running "cat userdb.txt" again shows the following:

cat userdb.txt

root:0:123456
root:0:abc123
root:0:p@ssw0rd
root:0:IamSo1337!

That takes care of the prep. Now if you are doing this with something other than Kippo, those previous steps won't apply. If whatever Honeypot you are using has the ability to let attackers authenticate you will want to set up a unique set of credentials for the experiment.  If not, press on.

We will now use Social Networks against are attackers.  To put it simply we are going to post login information for our Honeypot on a public site like pastebin, and then alert attackers to the information by posting a link to the paste file on social networks like Twitter.

You may want to keep the rest of the activity as anonymous as possible, so fire up Tor Browser or use proxychains to hide your IP information. Once anonymized go to pastebin.com.

The trick to getting this to work properly is to utilize keywords that attackers may have PasteLerts set up for. For instance you will want to include keywords such as ssh, login, username, password, root, and many others.  Make sure you use some of these keywords in the title as well.  Here is a sample one I put together:

Submit this and get your pastebin url.  Now this will be enough to bring in a few extra hits already, from people who are monitoring pastebin. To get even more folks to see this though we will need to take it a step further.

While still anonymizing your activity create a throwaway twitter account. As many people as there are that monitor pastebin, there are even more that monitor twitter (at least I am guessing so). In particular there are certain twitter users and list that people follow to get password dumps as they occur. My favorite of these is @PastebinDorks.

With your new twitter account create a tweet that mentions @PastebinDorks or another account like that.  Have it say something along the lines of, "Check out this one! http://pastebin.com/qi7wzp8h".  Now anyone that follows @PastebinDorks will see your post.  You may get lucky enough to have someone retweet it a few times.

Now you can just sit back and wait for the conenctions to roll in.  While I used twitter and pastebin in my example, this can be done with any like tools. The point is to get the data out there in the public and then use social networks to increase exposure.

To monitor your kippo logs to see when attackers use the user/pass combination you specified in the userdb.txt. navigate to your kippo logs directory and and do the following:

 

honeydrive@honeydrive:/opt/kippo/log$ cat kippo.log | grep 'login attempt'

2013-02-10 13:04:46+0000 [SSHService ssh-userauth on HoneyPotTransport,9237,193.200.88.100] login attempt [root/abcd1234] failed

2013-02-10 13:04:48+0000 [SSHService ssh-userauth on HoneyPotTransport,9238,193.200.88.100] login attempt [root/1234] failed

2013-02-10 13:04:53+0000 [SSHService ssh-userauth on HoneyPotTransport,9239,193.200.88.100] login attempt [root/redhat] failed

2013-02-10 13:04:59+0000 [SSHService ssh-userauth on HoneyPotTransport,9240,193.200.88.100] login attempt [oracle/oracle] failed

2013-02-10 13:05:02+0000 [SSHService ssh-userauth on HoneyPotTransport,9241,193.200.88.100] login attempt [test/test] failed

2013-02-10 13:05:04+0000 [SSHService ssh-userauth on HoneyPotTransport,9242,193.200.88.100] login attempt [root/1] failed

2013-02-10 13:05:07+0000 [SSHService ssh-userauth on HoneyPotTransport,9243,193.200.88.100] login attempt [root/123] failed

2013-02-10 13:05:09+0000 [SSHService ssh-userauth on HoneyPotTransport,9244,193.200.88.100] login attempt [root/123456789] failed

2013-02-10 13:05:12+0000 [SSHService ssh-userauth on HoneyPotTransport,9245,193.200.88.100] login attempt [root/12345678] failed

2013-02-10 13:05:14+0000 [SSHService ssh-userauth on HoneyPotTransport,9246,193.200.88.100] login attempt [root/1234567] failed

2013-02-10 13:05:17+0000 [SSHService ssh-userauth on HoneyPotTransport,9247,193.200.88.100] login attempt [root/12345] failed

2013-02-10 13:05:20+0000 [SSHService ssh-userauth on HoneyPotTransport,9248,193.200.88.100] login attempt [teamspeak/teamspeak] failed

2013-02-10 13:05:22+0000 [SSHService ssh-userauth on HoneyPotTransport,9249,193.200.88.100] login attempt [teamspeak/ts3] failed

2013-02-10 13:05:25+0000 [SSHService ssh-userauth on HoneyPotTransport,9250,193.200.88.100] login attempt [nagios/nagios] failed

2013-02-10 13:05:28+0000 [SSHService ssh-userauth on HoneyPotTransport,9251,193.200.88.100] login attempt [postgres/postgres] failed

2013-02-10 13:05:30+0000 [SSHService ssh-userauth on HoneyPotTransport,9252,193.200.88.100] login attempt [root/qwe] failed

2013-02-10 13:05:33+0000 [SSHService ssh-userauth on HoneyPotTransport,9253,193.200.88.100] login attempt [root/1q2w3e] failed

2013-02-10 13:05:40+0000 [SSHService ssh-userauth on HoneyPotTransport,9254,193.200.88.100] login attempt [root/1q2w3e4r] failed

2013-02-10 13:05:43+0000 [SSHService ssh-userauth on HoneyPotTransport,9255,193.200.88.100] login attempt [root/qweqwe123] failed

2013-02-10 13:05:45+0000 [SSHService ssh-userauth on HoneyPotTransport,9256,193.200.88.100] login attempt [root/qazwsxedc] failed

2013-02-10 13:05:48+0000 [SSHService ssh-userauth on HoneyPotTransport,9257,193.200.88.100] login attempt [root/1qa2ws3ed] failed

2013-02-10 13:05:57+0000 [SSHService ssh-userauth on HoneyPotTransport,9258,193.200.88.100] login attempt [root/123123] failed

2013-02-10 13:06:00+0000 [SSHService ssh-userauth on HoneyPotTransport,9259,193.200.88.100] login attempt [root/abcd1234] failed

2013-02-10 13:06:03+0000 [SSHService ssh-userauth on HoneyPotTransport,9260,193.200.88.100] login attempt [root/qazwsx123] failed

2013-02-10 13:06:05+0000 [SSHService ssh-userauth on HoneyPotTransport,9261,193.200.88.100] login attempt [root/abc123] succeeded

2013-02-10 13:06:22+0000 [SSHService ssh-userauth on HoneyPotTransport,9262,193.200.88.100] login attempt [root/toor] failed

2013-02-10 13:015:24+0000 [SSHService ssh-userauth on HoneyPotTransport,9263,64.185.229.236] login attempt [root/IamSo1337!] succeeded

If you have any other tips or tricks like this, let me know by leaving a comment or sending me an email at 1aN0rmus@TekDefense.com 

Friday
Feb082013

The Kippo Kronicles - Ep2 OMG APT

In this episode of the Kippo Kroicles we replay the attack of the most advanced of all attackers, the APT Attacker.  Okay, not quite.  In fact calling this guy (or maybe gal) an APT'er is like calling your chubby friend slim.  I get typing dir in once on accident, but to repeatedly try to type dir in linux, come on now.  Anyways, I have a ton of logs stored up and ready to videotize.  More to come.

Friday
Feb082013

Automater 1.1 Release - IPVoid data fixed

Update: Automater gets its own project page http://www.tekdefense.com/automater/

Automator as most of you know, pulls IP and URL information from various sources in order to make analysis easier on the analyst.  Recently IPVoid changed up their site a bit, because of this I needed to make some modifications to Automater to get it to function appropriatley. To be specific I needed to modify the regular expressions to match the format of the new site.

I have some other changes that I will be making soon as well:

  • Extra export options (csv, html)
  • Malware domainlist checker
  • Source engine selection 
  • Re-write to utilize BeautifulSoup

If anyone has any other feature requests please let me know.

To see more about what Automater is and how it functions check out the tutorial.

1aN0rmus@TekDefense.com

 

Tuesday
Jan222013

The Kippo Kronicles - Ep1

Welcome to the first of many Kippo Kronicles.  In this series I will use the replay function of Kippo to show what attackers have attempted to do on my honeypot.  I hope you enjoy.

Page 1 ... 5 6 7 8 9 ... 13 Next 5 Entries »