ALERT!
Click here to register with a few steps and explore all our cool stuff we have to offer!

Jump to content

sunjester's Content

There have been 77 items by sunjester (Search limited from May 22, 2023)


By content type

See this member's


Sort by                Order  

#15250447 Demystifying Radare; In Short

Posted by sunjester on 27 December 2018 - 06:55 PM in Reverse Engineering Guides and Tips

Introduction
Before we start, you should know that is an advanced binary forensics tool. If you are not familiar with some lower level programming or have any kind of understanding about assembly, this isn't for you. There are links on this forum and website that will help you gain a better understanding of architecture and assembly, you should start there.

Radare stands for "Raw Data Recovery". This project was started by a programmer who goes by pancake. This tool has been gaining more and more attraction since 2009, it has been around since 2006. This is an open source free project that is maintained (now) by a community of loyal users. You can visit the official website here, https://www.radare.org. This tool is not only a "tool" but an entire framework that you can use and integrate into your own tools. This software had a full rewrite in 2009 to accommodate the community.

Installation
Do not use the system repositories, use the Github repo, https://github.com/radare/radare2. This is something the author even suggests for you to do. Using the system package mamager to install radare might leave you buggier and out of date. The following are the commands to be executed to install radare2. When you want to check for updates, you can run the sys/install.sh script.

git clone https://github.com/radare/radare2.git
sys/install.sh
sys/user.sh

Documentation

 

Any command in radare has help info along with it, simply put a question mark at the end of a command. For example:

[0x00400470]> s?
Usage: s[+-] [addr]
s 0x320    ; seek to this address
s-         ; undo seek
s+         ; redo seek
s*         ; list undo seek history
s++        ; seek blocksize bytes forward
s--        ; seek blocksize bytes backward
s+ 512     ; seek 512 bytes forward
s- 512     ; seek 512 bytes backward
s.hexoff   ; Seek honoring a base from core->offset
sa [[+-]a] [asz] ; seek asz (or bsize) aligned to addr
sn/sp      ; seek next/prev scr.nkey
s/ DATA    ; search for next occurrence of 'DATA'
s/x 9091   ; search for next occurrence of \x90\x91
sb         ; seek aligned to bb start
so         ; seek to next opcode
sf         ; seek to next function (f->addr+f->size)
sC str     ; seek to comment matching given string
sr pc      ; seek to register

OS Support
This project has support for all major operating systems:

 

File Format Support

  • ELF
  • Mach-O
  • Fatmach-O
  • PE
  • PE+
  • BIOS/UEFI
  • Java class
  • Android boot image
  • Game Boy
  • Nintendo DS
  • Nintendo 3DS

 

Basic Commands
Some of the most basic things you will need to do is search addresses, display data and move around in binary files. For this part of the tutorial I will write a few basic C programs to help you get started with using some of these commands. The example C binaries and code can be found on my github here: https://github.com/t...lsunjester/code.

You will load the binary file simply by typing r2 followed by the binary name.

 

  • a = analyze bytes
  • s = seek
  • pd = disassemble opcodes
  • x = hex dumps
  • / = string searches
  • q = quit

 

Hello World
This will be a crash course into using r2 and some of it's other tools. The code we will be analyzing here is the hello.c file in the git repo mentioned above (https://github.com/t...aster/c/hello.c). You can also find the binary in the repository as well. The first thing we are going to do is use rabin to check the files headers. You can use the -I flag (capital 'i', not an l).

(xenial)sunjester@localhost:~/Downloads/code/c$ rabin2 -I hello
file    /home/sunjester/Downloads/code/c/hello
type    EXEC (Executable file)
pic     false
has_va  true
root    elf
class   ELF64
lang    c
arch    x86
bits    64
machine AMD x86-64 architecture
os      linux
subsys  linux
endian  little
strip   false
static  false
linenum true
lsyms   true
relocs  true
rpath   NONE

Next, let's load it into radare.

(xenial)sunjester@localhost:~/Downloads/code/c$ r2 hello

You will be at a prompt that has an address at the beginning of it. Now, analyze the binary. When you analyze a binary you can use multiple a's. I use aae, but a simple a or even two aa's should be sufficient enough. aae means it will analyze and emulate the binary. Depending on how large the binary file is, depends on how long it will take to analyze. This is a simple hello world c program, so it should be almost instant. When it is done, it will just drop you to a new line at the same address.

[0x00400430]> aae
[0x00400430]>

Now, since I know there is a nice small main function, we can move to that main function (and most of the time in any binary c program) using pdf @main. the pdf command disassembles a function that you give it. Since I knew the name of the function was main and 99.99% of all programs have a main function, it disassembled the function and showed me the disassembly.

[0x00400430]> pdf @main
/ (fcn) sym.main 21
|           0x00400526    55           push rbp
|           0x00400527    4889e5       mov rbp, rsp
|           0x0040052a    bfc4054000   mov edi, str.helloworld
|           0x0040052f    e8ccfeffff   call sym.imp.puts
|              sym.imp.puts(unk)
|           0x00400534    b800000000   mov eax, 0x0
|           0x00400539    5d           pop rbp
\           0x0040053a    c3           ret

Above is out disassembled main function. You can see the addresses and even our string we have in the code "hello world", denoted by str.helloworld. We can move to that strings location using the seek command (s).

[0x00400430]> s str.helloworld

You can also seek up and down by using the dash (minus) or plus signs. s- willmove you down one, s+ will move you up one, as show in the code block below. If you simply type s you will be given the current stack address you are sitting at.

[0x004005c4]> s-
[0x00400430]> s+

You will notice that the address at your prompt has now changed to the address where the string is sitting. You can use pd to show the bytes, I will show the next 10 instructions from the string using pd 10. You can also just show the instruction you are currently at by using pd 1.

[0x004005c4]> pd 10
            ;-- str.helloworld:
            0x004005c4     .string "hello world" ; len=12
   ;      [16] va=0x004005d0 pa=0x000005d0 sz=52 vsz=52 rwx=-r-- .eh_frame_hdr
        |   ;-- section..eh_frame_hdr:
        |   0x004005d0    011b         add [rbx], ebx
        |   0x004005d2    033b         add edi, [rbx]
        |   0x004005d4    3400         xor al, 0x0
        |   0x004005d6    0000         add [rax], al
        |   0x004005d8    0500000020   add eax, 0x20000000
            0x004005dd    fe           invalid
            0x004005de    ff           invalid
            0x004005df    ff8000000060 inc dword [rax+0x60000000]
            0x004005e5    fe           invalid

Searching for Strings
It is a common thing to search for strings. We can search using the /i command, the 'i' means insensitive. You can also search using wide and other things. To see a list, don't use the question mark, /?.

[0x004005c4]> /i hello
Searching 5 bytes from 0x00400238 to 0x004005c4: 68 65 6c 6c 6f
hits: 1
0x004005c4 hit0_0 "hello world"

When you search and radare finds something it stores it as a hit. To view the hit use the s command and the hit it found, as shown int he code block below. Since we are sitting in the spot we are looking for, our prompt didn't change (if you have been following along).

[0x004005c4]> s hit0_0
[0x004005c4]> pd 1
            ;-- hit0_0:
            0x004005c4     .string "hello world" ; len=12

Another way of searching for all the strings is by typing iz, for example, after loading and emulating a binary:

[0x004007c0]> iz
[Strings]
Num Paddr      Vaddr      Len Size Section  Type  String
000 0x00000ce8 0x00400ce8  34  35 (.rodata) ascii \n Error : Could not create socket
001 0x00000d0b 0x00400d0b  25  26 (.rodata) ascii \n inet_pton error occured
002 0x00000d25 0x00400d25  25  26 (.rodata) ascii \n Error : Connect Failed
003 0x00000d3f 0x00400d3f  28  29 (.rodata) ascii \n Usage: %s <ip of server> \n
004 0x00000d5c 0x00400d5c  17  18 (.rodata) ascii [*] Audit Started
005 0x00000d6e 0x00400d6e   9  10 (.rodata) ascii Microsoft
006 0x00000d78 0x00400d78  11  12 (.rodata) ascii [*] NOT IIS
007 0x00000d88 0x00400d88  31  32 (.rodata) ascii Requested Range Not Satisfiable
008 0x00000da8 0x00400da8  15  16 (.rodata) ascii [!!] Looks VULN
009 0x00000db8 0x00400db8  38  39 (.rodata) ascii The request has an invalid header name
010 0x00000ddf 0x00400ddf  17  18 (.rodata) ascii [*] Looks Patched
011 0x00000df8 0x00400df8  52  53 (.rodata) ascii [*] Unexpected response, cannot discern patch status

Conclusion
I hope this will help you along in your quest for becoming a better programmer and hacker.




#15250776 Demystifying Radare; In Short

Posted by sunjester on 27 December 2018 - 07:19 PM in Reverse Engineering Guides and Tips

Thanks for your contribution it is much appreciated. I suggest you hide it though to avoid leechers. Thanks again!

 

let the leechers leech. meh




#15251045 23k HQ Http/s Proxylist 27/12

Posted by sunjester on 27 December 2018 - 07:38 PM in Proxies

You'll be able to see the hidden content once you reply to this topic or upgrade your account.




#15251126 GATHER PROXY 8.9 PREMIUM VERSION

Posted by sunjester on 27 December 2018 - 07:43 PM in Tools

You'll be able to see the hidden content once you reply to this topic or upgrade your account.




#15251691 Huge Password List for LoL Account Cracking

Posted by sunjester on 27 December 2018 - 08:21 PM in League of Legends

You'll be able to see the hidden content once you reply to this topic or upgrade your account.




#15402227 [Gather Proxy V9 Premium]

Posted by sunjester on 04 January 2019 - 12:37 PM in Cracked Programs

You'll be able to see the hidden content once you reply to this topic or upgrade your account.




#16775474 HTML5 Website Templates

Posted by sunjester on 17 February 2019 - 07:16 PM in HTML, CSS, JS & PHP

You'll be able to see the hidden content once you reply to this topic or upgrade your account.

 




#16775489 Informations Stealer [IP,Cookie,Agent,Date,Port,Ref more...]

Posted by sunjester on 17 February 2019 - 07:17 PM in HTML, CSS, JS & PHP

You'll be able to see the hidden content once you reply to this topic or upgrade your account.

 




#16778025 CodeCanyon - AdLinkFly v1.0.0 - Monetized URL Shortener

Posted by sunjester on 17 February 2019 - 09:13 PM in HTML, CSS, JS & PHP

link is dead, any update on this? 

 




#16778163 Direct Downloading Anonfile.com Links

Posted by sunjester on 17 February 2019 - 09:19 PM in Other languages

Hidden Content
You'll be able to see the hidden content once you reply to this topic or upgrade your account.




#16778462 Integrating Malshare with PHP

Posted by sunjester on 17 February 2019 - 09:31 PM in HTML, CSS, JS & PHP

I tried posting this as a forum post but the aggressive cloudflare protection refused, so I had to take a screenshot of my original post.

 

j0FVCFa.png




#16778599 Understanding and Cracking Password Hashes

Posted by sunjester on 17 February 2019 - 09:37 PM in Cracking Tutorials

Again, due to the aggressive nature of the cloudflare protection service I had to take a screenshot of my original tutorial on another forum just to share it here with you guys.

 

xScdQSE.png




#16778655 Creating a User Registration and Login System with PHP and MySQL

Posted by sunjester on 17 February 2019 - 09:39 PM in HTML, CSS, JS & PHP

XKVdujI.png




#16778793 Cloning Doxbin.org for Fun and Not Profit

Posted by sunjester on 17 February 2019 - 09:44 PM in HTML, CSS, JS & PHP

For some reason “doxing” people is some kind of new trend among the hacking communities on the internet. Not only do I not like the word “dox” because it just sounds so noobish but the fact that people think they are accomplishing something special also irritates me. I came across a site named doxbin.org a few weeks back or so.

 

The website allows people to upload text information about someone, with no verification at all for it’s validity. This can work against people trying to “dox” someone. If you simply upload false information about someone over and over again, how do you know the information is correct? I decided I would just clone the website and give it to the masses, maybe a thousand of these dox sites will pop up and people will move away from “doxing” and claiming to have personal information on people.

 

Initial Cloning
The first thing to do when you clone a website is to just save all the pages. I remember using something called HTTTrack or something like that on Windows a long time ago. However, I do not use Windows anymore and try not to use it, ever. I am currently using Ubuntu (xenial), so let’s use wget to download the whole site.

wget -r -nc -p --html-extension -k -np -X upload https://doxbin.org/

We don’t need the upload folder with all the entries so the -X argument is telling wget to exclude the upload directories from the website.

So now we have a base to work with. From here it’s not too difficult to add some kind of admin panel to manage the site. We can also guess at what the database is like from simply using the website and what information it has on it.

 

?url=https%3A%2F%2Frealsunjester.files.w

?url=https%3A%2F%2Frealsunjester.files.w

 

So now if we look at it in our browser, we can see it’s almost good to go, with barely any work, as you can see below. It all works, but nothing is saving to a database of course.

 

?url=https%3A%2F%2Frealsunjester.files.w

 

The links on the front page of our clone is also pointing to the original doxbin.org, but that’s an easy fix.

 

Creating the Database
Looking at the interface we can get a good feel for the inner workings on the database. Below I circled some of the fields we are going to create. The next image is the phpMyAdmin database I created.

 

?url=https%3A%2F%2Fi.imgur.com%2FXcXOJkn

?url=https%3A%2F%2Frealsunjester.files.w

 

We will be using PDO, since it’s more secure and it’s basically the standard now for interacting with a MySQL database through PHP. We will write a class for our database that will make it easier to pass our data to the template files.

The doxbin site seems to use the titles of the dox's as the ID to view the dox that someone uploaded/added. This is a horrible idea since if you add a new dox with the same title, it won’t even add it to the database. This is a flaw that I think shows the skill level of the coder for doxbin.org, which in my opinion is quite low.

 

?url=https%3A%2F%2Frealsunjester.files.w

 

Template Engine
I like to use Smarty. If I get complete control over a project, I always opt to use Smarty instead of a heavy frameworks like Symfony. Using a simple template engine and not a huge framework for small projects like this is beneficial for you and the server. Download smarty here.

unzip -x master.zip
rm master.zip
mv smarty-master/ smarty/

Above, we unzip the master.zip archive (preserving the directory structure) we downloaded, remove the master.zip file, then rename the directory to something more friendly, named smarty. We need to break apart the sections of the site into a header, body, and footer. The website doesn’t have a footer but ours will.

 

?url=https%3A%2F%2Frealsunjester.files.w

 

So basically what we want to do with the template engine is separate our forward facing HTML from our PHP code. This is whole idea behind MVC style programming. This will allow us to update code without breaking other code on the site. We can update classes and then later just plug the data into our templates with ease. As you can see in the image above the body tag is still in the index.php file (the file featured above). I will move it into our nav.tpl file, since that;s where the site starts showing the HTML.

 

?url=https%3A%2F%2Frealsunjester.files.w

 

Pretty URL’s and Redirects
The site makes use of htaccess rewrites, at least, that’s what it seems like. It may be done with PHP but it’s much easier to just use simple htaccess rewrite rules, which is what we are going to use. The raw view and the upload view pages will be redirected.

 

?url=https%3A%2F%2Frealsunjester.files.w

 

Installation System
In order to get this thing to the masses so people can easily run and install this clone, we will need some kind of basic installation system. We will need something that a user can input their database details and other settings. To keep things a bit more secure we are going to need to have these settings our of the reach of the internet. This means writing a file and setting permissions for only the web server user.
The permissions on the config file should be

 

The Captcha
There are a bunch of different captchas out there. Doxbin uses Google’s Recaptcha service. The Google captcha is configured in the installation. If you don’t want the captcha to show, don’t fill out the captcha portion of the install or simply remove the site and secret keys from the config file. If you fail to verify with the captcha you will simply be redirected, no dox entry will be made.

 

Download

https://anonfile.com...qbba/doxbin_zip
https://realsunjeste...and-not-profit/




#16778841 sunjester's URL Shortener

Posted by sunjester on 17 February 2019 - 09:46 PM in HTML, CSS, JS & PHP

b9NCpzC.gif

 

https://anonfile.com...ab8/urlshrt_zip
https://github.com/t...njester/urlshrt