News for hackers. Stuff that matters.
Re:I was asked to crack a program in a job interview, part 2 by earlz on Monday September 22, 2014 @12:07PM (#8351134)
Stuff like this deeply fascinates me. However, I can't help but feel like a lot of it could be improved with the help of some automation tooling.

Is there anything out there for like a "language" of sorts (or API, etc) that can automate some of the debugging things required? Like I imagine very "active" debugging and code modification like "When we are at this location, and the past few instructions exected were X, Y, and Z at addresses A, B, and C, pop this item off the stack and push this hard coded value on the stack" Things that would take forever to do manually, especially when called in a loop, but would be fairly trivial to formalize into a programming language

Re:I was asked to crack a program in a job interview, part 2 by AustinDizzy on Monday September 22, 2014 @12:12PM (#8351168)
A lot of debuggers and disassemblers do exactly that. They're getting smarter every day, but they still take some knowledge of assembly and lower-level computer science concepts.

IDA Pro [0] is a good example of an excellent debugger with plentiful features and productive disassembling tools.

[0]: https://www.hex-rays.com/products/ida/

Re:I was asked to crack a program in a job interview, part 2 by tptacek on Monday September 22, 2014 @03:14PM (#8352037)
Most people here (and people I know in the industry) use programmable debuggers --- Ruby and Python libraries that implement the OS debug hooks.

If you're on a Mac, like most people who do software security, Hopper.app is a fantastic alternative to IDA.

Re:I was asked to crack a program in a job interview, part 2 by SEJeff on Monday September 22, 2014 @12:24PM (#8351219)
gdb actually has amazingly good python scripting built in if you're using a reasonably new version of it. Redhat lead the charge[1] with what they called 'Project Archer', which was merged into gdb mainline as the python scriptability.

[1] http://sourceware.org/gdb/wiki/ProjectArcher

Re:I was asked to crack a program in a job interview, part 2 by earlz on Monday September 22, 2014 @12:37PM (#8351286)
That's pretty interesting. I'll have to look at that more
Re:I was asked to crack a program in a job interview, part 2 by rjzzleep on Monday September 22, 2014 @12:49PM (#8351330)
It all went downhill, when compuware bought numega and killed softice. yes, ollydbg and windbg work fine, but still...
Re:I was asked to crack a program in a job interview, part 2 by DEinspanjer on Monday September 22, 2014 @02:11PM (#8351688)
Hehe.. I worked for Numega back then. I did tech support and I still remember how often we got tech support requests from people and companies wanting a way to prevent SoftIce from being used to crack their software. So many times I tried to explain to people that there just wasn't really a good way to detect that it was happening that couldn't just be circumvented by the debugger.
Re:I was asked to crack a program in a job interview, part 2 by smilbandit on Monday September 22, 2014 @10:23PM (#8353704)
I handled the website at the time. Watching the referer entries in those logs would give you a who's who list of cracker sites from around the world.
Re:I was asked to crack a program in a job interview, part 2 by yaur on Monday September 22, 2014 @12:24PM (#8351225)
One thing to keep in mind is that there are only a handful of really good disassemblers and that anyone semi serious about keeping you away can throw in code that will confuse and/or crash them.
Re:I was asked to crack a program in a job interview, part 2 by tptacek on Monday September 22, 2014 @03:15PM (#8352040)
Disassemblers aren't at all hard to write. Tripping up IDA might be a decent bang-for-the-buck countermeasure, given how straightforward it can be, but it's a speed bump.
Re:I was asked to crack a program in a job interview, part 2 by sillysaurus3 on Monday September 22, 2014 @12:27PM (#8351242)
It's possible to confuse or crash IDA Pro, Ollydbg, and Cheat Engine? If one tool won't work, just switch to another.
Re:I was asked to crack a program in a job interview, part 2 by drblast on Monday September 22, 2014 @01:18PM (#8351459)
It's very possible. Recently I had to manually patch code that was (in assembly) a conditional jump on conditions that at runtime were always true or always false, so the "conditional" part was a red herring.

The fact that the conditional was there confused IDA such that it miscalculated the stack usage for many of the functions in the binary and refused to designate them as procedures (which can be decompiled).

The telling part was that these conditionals had no other purpose other than to confuse IDA, so you could see the intent was malicious.

That's just one example. You REALLY have to know what's going on with the hardware and the intentions of malware authors so you don't blindly accept what your tools are telling you. That's what makes the difference between someone who can do reverse engineering for a living and someone who is good at it.

EDIT: One more thing...debugging malware is a last resort; it's very easy to behave one way for a debugger while doing something completely different elsewhere. If you start with automated detection/debugging tools you spend most of your time working around debug detection.

If you'd like to know more my email address is in my profile.

Re:I was asked to crack a program in a job interview, part 2 by sillysaurus3 on Monday September 22, 2014 @01:35PM (#8351538)
That's very interesting. Thank you for correcting me. I'd like to know more, but everyone else probably would, too. Personally, I'm curious about the backstory behind that particular piece of software, and also about any other tricks you've noticed.
Re:I was asked to crack a program in a job interview, part 2 by drblast on Monday September 22, 2014 @07:11PM (#8353211)
The backstory is pretty simple; I analyze malware and this was a sample. It's difficult to talk about publicly because if you reveal too much, it's a chance for the malware authors to recognize they've been made and change what they're doing.

What's interesting is that if you've seen enough samples, you can make educated guesses about the authors, their intentions, and level of competence. In this case, the authors were obviously aware that someone might try to reverse engineer the software so they threw that little red herring in. I have no idea why, and it was only in certain functions and not others. But you do know the authors had a clue about IDA and similar static analysis tools and were trying to make it more painful to analyze. It certainly wasted a couple of hours of my time.

Fortunately the obfuscations make software like that easier to detect, so it's a balancing act the author has to play.

If I ever stop analyzing malware there might be a very interesting blog series on all the boneheaded mistakes malware authors make when they obfuscate their code. I could teach a six-month course on what not to do with crypto just from all the approaches I've seen.

Re:I was asked to crack a program in a job interview, part 2 by yaur on Monday September 22, 2014 @10:05PM (#8353680)
I played around in the cheat scene as a kid and what you are describing sounds like someone who didn't know what they were doing either a) copy-pasting from or b) using a toolkit provided by someone that did.
Re:I was asked to crack a program in a job interview, part 2 by sillysaurus3 on Monday September 22, 2014 @10:23PM (#8353703)
What would someone who knew what they were doing do?
Re:I was asked to crack a program in a job interview, part 2 by yaur on Monday September 22, 2014 @01:15PM (#8351434)