Fire Eye Flare-On challenge 2017: Challenge 1

Leave a comment

Write up

Challenge 1: (Very Easy)

Java script code.

File name: login.html

<!DOCTYPE Html />
<html>
<head>
<title>FLARE On 2017</title>
</head>
<body>
<input type=”text” name=”flag” id=”flag” value=”Enter the flag” />
<input type=”button” id=”prompt” value=”Click to check the flag” />

document.getElementById(“prompt”).onclick = function () {
var flag = document.getElementById(“flag”).value;
var rotFlag = flag.replace(/[a-zA-Z]/g, function(c){return String.fromCharCode((c = (c = c.charCodeAt(0) + 13) ? c : c – 26);});
if (“PyvragFvqrYbtvafNerRnfl@syner-ba.pbz” == rotFlag) {
alert(“Correct flag!”);
} else {
alert(“Incorrect flag, rot again”);
}
}

</body>
</html>

How to solve it:

First solution:

It is easy to visualize a comparison

if (“PyvragFvqrYbtvafNerRnfl@syner-ba.pbz” == rotFlag)

So,it is doing some stuff with input flag and then comparing it with

“PyvragFvqrYbtvafNerRnfl@syner-ba.pbz”

as we know the last bytes of the flag so comparing it we can see it is simple ROT 13. Where character is moved 13 step ahead.

so flag is
ClientSideLoginsAreEasy@flare-on.com

Second Solution:

Open the page in browser
and it looks like this
Capture

now enter the encoded flag in here and put the break point where is doing the comparison and voila here you got the flag.
which is same as above mentioned.
Capture_2
Thanks, soon Will publish write up for other flags too.

Advertisements

Fire Eye Flare-On challenge 2017: Challenge 2

Leave a comment

Challenge 2:

SHA1 of Binary: BEBC79DC955050E4F7F50609E5810751D287A59D

Windows Binary: PE (Portable Executable) file

Solution:

The man loop

checks

2 subroutines: one is for input the flag and 2nd for flag matching.

While based upon it it will take the decision for left ie.e G00d j0b! or Right N0t t00 h0t

Looking inside the Flag_Matching subroutine

xor_loop

Here it is doing the matching, checking the pseudo C doe for the subroutine
Flag

So here what is doing is XOR the nth element with n-1 the element and making last element hard as 0x04

We wrote a small script to automate this XOR
enc= [0x0D,0x26,0x49,0x45,0x2A,0x17,0x78,0x44,0x2B,0x6C,0x5D,0x5E,0x45,0x12,0x2F,0x17,0x2B,0x44,0x6F,0x6E,0x56,0x09,0x5F,0x45,0x47,0x73,0x26,0x0A,0x0D,0x13,0x17,0x48,0x42,0x01,0x40,0x4D,0x0C,0x02,0x69]
key = 0x4
flag = ‘
‘for c in enc[::-1]:
v = key ^ c
key = v
flag = flag + chr(v)
print flag[::-1]

Flag:

And so the flag is
R_y0u_H0t_3n0ugH_t0_1gn1t3@flare-on.com

 

File less Infection-1

Leave a comment

A File less infection is one where the infection never never the disk and it always remains in Primary memory.

As no file is over disk so it is hard for security products to detect and remove such kind of infections. The first ever case of File less infection was seen in early 2000, with the worm name Code Red, where the worm was using IIS server Remote Code execution  exploit and was injecting the malware payload in memory.

Though the issue with such kind of malware is they are gone after the reboot. SO they were not persistent and as they were not persistent so targeting the machine whose up time is very low (For example Home PC) is not very useful.

But with in Year 2014 Poweliks did the break though and found mechanism of remaining persistent or reinfecting the victim after the reboot.
So, we can call it as surviving the reboot.

The malware was found to be spreading by notorious Exploit Kit Angler.

The poweliks found a very interesting way to remain persistent in memory by injecting the payload in run registry entry so when system restart it reinfect itself.

And it create 2 component

  1. Watchdog: Which keep an eye over registry entry, if entry is removed it recreate it. This part is always in memory.
  2. Payload: The real payload of malware, which perform the malware action.

In Last couple of year’s I have done some in deep research over File-less infection,

As a result of which I was able to publish few research papers.
My Research papers can be found over
1) One-Click File less infection : Presented At Virus Bulletin 2016, Denver
2) Living Off the land and file less attack techniques : Published with Symantec

Payload of malware is in registry.

filelessmalware3

This was a brief overview of file less infection.
I hope you guys like it, will try deep diving into the matter in next blog post.
Cheers

Fun with Metasploit

Leave a comment

Metasploit is a framework developed in Ruby by H.D. Moore

It provide multiple very easy to use interfaces, which can be used for

  1. Fingerprinting
  2. Exploitation
  3. Post exploitation

And it comes with cool tools which are used for exploit development and fuzzing, which makes it kind of complete toolkit for penetration tester, and I personally have seen  almost all pentesters have used and are still using metasploit one way or another.

And most of the guys who start with security they start with metasploit.

In this tutorial we will discuss how to setup metasploit.

Metaspoit is available for Windows and Linux platforms.

Though I would suggest you to use Kali Linux which come pre install with metasploit and a lot of other cool software which you might be needing during pentesting or hacking.

In these tutorials I will be using msfconsole which is the most famous very stable and cool looking Command Line Interface, Though I can create a writeup for Armitage

It’s usage and other stuff (For that hit me or comment over here)

Let’s start with explaining what above 3 points are

Finger Printing:  It means finding the identity of the victim.
Metasploit is equipped with Nmap which is Swiss army knife for post scanning, OS scanning and multiple other things.

Which can be used for fingerprinting the victim, alone with it metapsloit is equipped with multiple auxiliary modules for fingerprinting.

Exploitation: It means misusing some service so we can get access to the victims machine.

Metasploit got multiple exploits few are client exploit few are server, in few cases they need interaction and in few no interaction needed at all so we can get our backdoor delivered to the victim, this phase is known as exploitation.

Post Exploration: Metasploit got multiple backdoor code which is then used to execute at victim so we can get the access of the victim’s machine.

Metsploit is equipped with multiple encoders too so we can obfuscate the payload before delivering it to victim, for evading security products.

I think this much of theory is enough for now let’s get to practical metasploit.
For these tutorials I will be using Kali VM.

Download Kali from here-> https://www.kali.org/downloads/
And create Virtual machine using VM ware or any other hypervisor.

Though I will be using virtual box can be downloaded form here ->https://www.virtualbox.org/wiki/Downloads

for all my blog post I will try using free tools as much as possible.

Once you are done with installation jump inside the Kali setup.

Start terminal and fire

service ssh start
ifconfig

The above command will start ssh serviced over the VM so you can login to your VM from your machine, and stack hacking.
and yeah ifconfig so you know the IP where you have to log in 😉
Once SSH services are started, log in to your machine.
now SSH at the IP address.
Once it is done fire

msfconsole

This will start the CLI version of metasploit which looks like
msf-console_389x214

It might take some time to load the msfconsole.
Once it is done fire command

msfupdate

This command will update your metasploit with all the new exploits and payloads and any other updates.

I guess this is it for this post. Will publish chapter very soon.

Cheers.

Getting Started With CTF

Leave a comment

Hello Reader

I Am back after such a very long time.

This post and few more post from here on are going to be Super n00b, As these are going to target very basic stuff . If you are expecting some research project then I would suggest better follow me over my Twitter @anand_himanshu or DM/ Email .

Recently I have developed interest in CTF (Capture The Flag) events. For those who don’t know CTF, It is hacking the application to get the Secret which is known as FLAG.

As per my experience till date I can divide CTF events in following categories

  1. Exploits
  2. Reversing files
  3. Crypto
  4. Human Error

I am not saying these are the only categories, there could be other which I might not aware of at present and most of the times one challenge is dependent over the another for capturing the flag.

Here I will try to cover one topic at one single time.

Will cover few of the very tools for now like

Metasploit
Nmap
Debuggers (No Link as Will try covering most of it Ex are IDA, Olly)
(Do Comment if you are interested in any specific tool)

And eventually will try to increase the lvl.

If You are looking for some super cool CTF Blogs and write up and solution then I would suggest you guys to must visit

Gynvael , The guy is super cool he do live hacking over YouTube and he is like rock start.

And another super cool guy LiveOverFlow.

Follow these guys over Twitter, YouTube and learn from them.

And If you are looking for some Cool CTF challenges Then I would suggest you to
1) http://reversing.kr  (For Reversing challenges)
2) https://www.root-me.org (Almost all kind of challenges)

Remember guys, it’s like a puzzle sometimes you might have to spend hours and get hell lot of frustration, Not Giving up is the key to Flag.

If I have missed something or some information is incorrect then inform me.

Cheers and Happy Hacking 😉

Digital to braille..!!

Leave a comment

Heading sounds exciting.
There is a MIT’s event going to happen next week (8th of July 2013), I was planning to participate but unfortunately I was not be able to get in and so I wanted to everyone else to know what I was thinking since last 2-3 weeks.
I am not much a electronics guy and trying to learn electronics, So please do tell me my mistakes so that I may improve it.

This concept is just a concept which I haven’t demo it yet and was planning to create a prototype in the event but unfortunately not selected so trying to tell everyone so that I may have inputs form them and if someone like it then they may implement it.

Link to the event is here

I personally believe that there are not much of the good devices are in market which would give the realtime experience to the visually challenged people.

So this concept is to convert every digital media to the braille.
Best part of this is it is not just for english or something it would be able to all symbols and languages to braille.
Person readin the reader will have experience of reading the real book and not just books we may convert webpages and other digital media to braille.

There are not much pictures available but will try to provide you that within few days as I got no camera and no electronics which I may provide.

Constraints for present Prototype:
I am converting all the data to 1 particular font for present and I am keeping the size to tbe constant for every media.

Screen used: Something similar to magnetic slate thing which works on the principe of magnetic field.
Link to Magnetic slate

I have no idea how to do this so this is my next task to make this screen work something similar to that of kindle reader.
and increase the magnetic field by providing the power.(not sure how research in progress)
As my research says the E-ink technology works we may develop something similar with it as that of kindle screen which is a Ebook reader.

Let’s place this screen directly above a bread board, which got office pins in it.
Now as the image produce over the screen it will produce a magnetic filed which will pull the office pins towards it.
As we all know that magnetic force would be vectorial in nature, for those who don’t read it from here http://hyperphysics.phy-astr.gsu.edu/hbase/magnetic/magfor.html
Now those pins which are directly below the screen will pull those pins towards it and the pins which are not directly below will face the force component in some specific degree so it won’t be pulled up that much as that of the pins directly below the symbols (remember that symbols are magnetic)
Now time is mesure the distance with which the pins are up than.
This is all what I am sure about after that I an not sure about things

First

We may use the pins to trigger the circuit for the specific pattern and produce the content over the electronic braille screen or refreshable braille screen.

Second

We may trigger the circuit by measuring the moved screens from below the bread board and then to trigger the screen.

Advantages:
1) It is fast
2) Will convert the all those alphabets to braille which are shown in the screen.
3) will have the real feel of reading the book or watching the webpage in realtime.
For now the only constraint of font and size and I am not sure this really matters or not.

Different ideas which are kind of similar and this idea is inspired form them
1) A braille reader can read up to 200 words per minute
http://www.epokh.org/blog/?p=235
2) Zixel: A 2.5-D Graphical Tactile Display System
http://anirudh.me/2011/05/zixel-a-2-5-d-graphical-tactile-display-system/
3) World’s 1st Braille Smartphone for Blind People
http://updateszone.com/worlds-1st-braille-smartphone-for-blind-people-coming-soon/

Comments and views required.
Would love if someone feel like to implement this at there end and would love to extend this 🙂

My work for autistic people is over my another blog, This was my 1st blog for Visually challenged people, Will post more updates over this work very soon.
Link to my another block
http://www.techautismandme.wordpress.com

Handling error 402: Payment Required with malicious domain #MMD

4 Comments

Link from where I started:

http://urlquery.net/report.php?id=1858750

And this link directed me to here:

h00p://xfecajsmipichbex[dot]in/s5c1fN0XuiI0WhDF0sxHb0Xavz0a4mO0bg7N0NyYL/vSdOqASe.jar

Error 402 and payment Required .

Request URL:h00p://xfecajsmipichbex[dot]in/s5c1fN0XuiI0WhDF0sxHb0Xavz0a4mO0bg7N0NyYL/vSdOqASe.jar
Request Method:GET
Status Code:402 Payment Required
Response Header
Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Content-Length:0
Content-Type:text/html; charset=utf-8
Date:Mon, 08 Apr 2013 13:16:25 GMT
Expires:Thu, 19 Nov 1981 08:52:00 GMT
Pragma:no-cache
Server:nginx/0.7.64
X-Powered-By:ASP.NET version 4
X-Powered-By:HPHP

 

Suspicious isn’t it..

So I proceeded by getting in the sub directories of the server and it resulted in the link

h00p://xfecajsmipichbex[dot]in/s5c1fN0XuiI0WhDF0sxHb0Xavz0a4mO0bg7N0NyYL

Which automatically lead to a blank webpage.

Response for h00p://xfecajsmipichbex[dot]in/s5c1fN0XuiI0WhDF0sxHb0Xavz0a4mO0bg7N0NyYL/pdfx.html

Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Content-Length:817
Content-Type:text/html;charset=utf-8
Date:Mon, 08 Apr 2013 15:49:50 GMT
Expires:Thu, 19 Nov 1981 08:52:00 GMT
Pragma:no-cache
Server:nginx/0.7.64
X-Mode:HTML
X-Powered-By:ASP.NET version 4
X-Powered-By:HPHP

Response for “h00p://xfecajsmipichbex[dot]in/s5c1fN0XuiI0WhDF0sxHb0Xavz0a4mO0bg7N0NyYL/zmiohek.html”

Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Content-Encoding:gzip
Content-Length:1676
Content-Type:text/html;charset=utf-8
Date:Mon, 08 Apr 2013 15:49:51 GMT
Expires:Thu, 19 Nov 1981 08:52:00 GMT
Pragma:no-cache
Server:nginx/0.7.64
X-Mode:HTML
X-Powered-By:ASP.NET version 4
X-Powered-By:HPHP

 

When I tried to analysed its source then find out a variable storing the web address.

<script>
var icEVKt;
var Owsfe;CvkiFV='RHaLS';if (CvkiFV=='Yiwvd') vPUR='CnYEdy';
var XXwVKa="h00p://xfecajsmipichbex[dot]in/dkCSD30yLXI0ANWV0N3ab0JYAK0i1gr0xpz10m3aM0kkMd0odNL0RERP17ZDG16mRL0N8KM0XG9d0S0XG0GzNV05JZ10HrMA02rUm0AUgY0kQdn11pUL0qQQt0DZQ012fm611kpG0FebV0oNUn08f3o0gxYY0MaW413LKv03FP40Er9118am10Jld80lyyk11HiD0gmv2/TL7vbliVHL.exe?IUABFhcBXOgtL0ce=m&h=32";
</script>

now use

wget –save-headers -d h00p://xfecajsmipichbex[dot]in/dkCSD30yLXI0ANWV0N3ab0JYAK0i1gr0xpz10m3aM0kkMd0odNL0RERP17ZDG16mRL0N8KM0XG9d0S0XG0GzNV05JZ10HrMA02rUm0AUgY0kQdn11pUL0qQQt0DZQ012fm611kpG0FebV0oNUn08f3o0gxYY0MaW413LKv03FP40Er9118am10Jld80lyyk11HiD0gmv2/TL7vbliVHL.exe?IUABFhcBXOgtL0ce=m&h=32

-d for debugging and –save-headers for saving the headers.

Or

Simply paste this in your browser to download the exe 😉

Now this is the Analysis Report of this file using Virus total and it says 8/45

https://www.virustotal.com/en/file/cb92c51ba26391eae67d85b968b61a71e33cea4a82894f10fa6777ae9938e7e8/analysis/

Anubis Report for this exe

http://anubis.iseclab.org/?action=result&task_id=1956ca7159064b544fd05dd3c6c72cd5e&format=pdf

Dig Report

dig XFECAJSMIPICHBEX.IN ANY
; <<>> DiG 9.8.3-P1 <<>> XFECAJSMIPICHBEX.IN ANY
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 5853
;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;XFECAJSMIPICHBEX.IN. IN ANY
;; ANSWER SECTION:
XFECAJSMIPICHBEX.IN. 28800 IN A 192.210.150.43
XFECAJSMIPICHBEX.IN. 7200 IN SOA erdomain.mercury.orderbox-dns.com. founderapi.email.com. 2013040403 7200 7200 172800 38400
XFECAJSMIPICHBEX.IN. 38400 IN NS erdomain.mars.orderbox-dns.com.
XFECAJSMIPICHBEX.IN. 38400 IN NS erdomain.venus.orderbox-dns.com.
XFECAJSMIPICHBEX.IN. 38400 IN NS erdomain.mercury.orderbox-dns.com.
XFECAJSMIPICHBEX.IN. 38400 IN NS erdomain.earth.orderbox-dns.com.
;; Query time: 401 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Tue Apr 9 11:42:38 2013
;; MSG SIZE rcvd: 239

 

whois xfecajsmipichbex.in
Domain ID:D7196301-AFIN
Domain Name:XFECAJSMIPICHBEX.IN
Created On:04-Apr-2013 21:46:01 UTC
Last Updated On:04-Apr-2013 21:46:03 UTC
Expiration Date:04-Apr-2014 21:46:01 UTC
Sponsoring Registrar:Webiq Domains Solutions Pvt. Ltd. (R131-AFIN)
Status:CLIENT TRANSFER PROHIBITED
Status:TRANSFER PROHIBITED
Status:ADDPERIOD
Registrant ID:WIQ_27213783
Registrant Name:founder api
Registrant Organization:N/A
Registrant Street1:foundap 4
Registrant City:new york
Registrant State/Province:New York
Registrant Postal Code:10006
Registrant Country:US
Registrant Phone:+1.5274563219
Registrant Email:founderapi@email.com

Domains hosted over Same IP Virus total report:
https://www.virustotal.com/en/ip-address/192.210.150.43/information/

 

If you check the WhoIs for every domain you will find the same credentials like phone number,

 

Screen shot for h00p://192.210.150.43/

                            

Screen shot for Geographical address locator.

According to the  http://wepawet.iseclab.org/view.php?hash=453609c244e3925ce0fe662a71eba0a8&t=1365501256&type=js

Code there are 2 PDF but able to download just 1 of those 2.

 

Pdf downloaded

TLfeaOwS.pdf

Header for page “h00p://xfecajsmipichbex[dot]in/s5c1fN0XuiI0WhDF0sxHb0Xavz0a4mO0bg7N0NyYL/TLfeaOwS.pdf”

 

PDF Data over browser:

 

%PDF-1.6 %�•� 18 0 obj <> endobj 6 0 obj <> endobj 22 0 obj <> endobj 8 0 obj <> stream 1.6511*pdf Piexnlaypa

endstream endobj 20 0 obj <> endobj 23 0 obj <> endobj 5 0 obj <> endobj 1 0 obj <> endobj 21 0 obj <> endobj 7 0 obj <> /XObject <<>>>> endobj 19 0 obj <> endobj xref 0 24 trailer <> startxref 802 %%EOF
Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0</pre>
Content-Encoding:gzip
Content-Length:5531
Content-Type:text/html;charset=utf-8
Date:Tue, 09 Apr 2013 13:17:17 GMT
Expires:Thu, 19 Nov 1981 08:52:00 GMT
Pragma:no-cache
Server:nginx/0.7.64
X-Mode:HTML
X-Powered-By:ASP.NET version 4
X-Powered-By:HPHP

Virus total report for the pdf file

https://www.virustotal.com/en/file/e0be674422a6579361b0724da99eee4c9b33e137239a7268c530f1afea0c1b3d/analysis/1366874391/

Which confirm this as malicious.

Screen Shot 2013-04-25 at 4.47.15 PM

Snap Shot of all the files.

Every time you download the file it’s goign to give some random name to it.

 

#MalwareMustDie

Older Entries