📚 OpenRCE is preserved as a read-only archive. Launched at RECon Montreal in 2005. Registration and posting are disabled.








Flag: Tornado! Hurricane!

 Forums >>  Brainstorms - General  >>  Has Anybody Played with Flayer (Taint Analysis and Flow Alteration Tool)?

Topic created on: September 18, 2007 04:56 CDT by ero .

They announced flayer in a post on Google Security's blog.
The paper detailing the tool was presented on woot07.

Just wondering if anyone has played with it and has some thoughts to share.

  jms     September 18, 2007 11:23.10 CDT
Haven't played with this tool yet, but it looks interesting.

  LordMole   September 22, 2007 13:16.43 CDT
it gave me some ideas. it makes it easy to confirm how crappy some protection mechanisms are. this is a script for auto-skipping flexlm on ICC (available for free  anyhow)


#!/bin/bash
# icc_crack.sh:  icc uses flexlm.  This  traces functions involved in the
# license check and forcibly skips the final validation (on success).

# Setup stuff from icc's run script
INTEL_LICENSE_FILE=""
INSTALLDIR=/path/to/cc/9.1.038
LD_LIBRARY_PATH="$INSTALLDIR/lib:${LD_LIBRARY_PATH}"
DYLD_LIBRARY_PATH="$INSTALLDIR/lib:${DYLD_LIBRARY_PATH}";
PATH="$INSTALLDIR/bin:${PATH}";
export PATH DYLD_LIBRARY_PATH LD_LIBRARY_PATH INSTALLDIR INTEL_LICENSE_FILE
export -n IA32ROOT; unset IA32ROOT;

# grabbed from the web
# -----------------------------------------------------
# The HOSTID -- [DEMO|ANY|HOSTNAME=$HOSTNAME|USER=$USER]?
# uncounted -- no need for a server.
# 1-jan-0 -- default infinite license.
# 1-jan-1990 from $(strings iccbin)
# 9999.9999 is an arbitrarily high version number
# "CCompL" was given by FlexLM error messages
# "intel" wad just guessed
cat <<EOF > $INSTALLDIR/bin/cracked.lic
INCREMENT CCompL intel 9999.9999 1-jan-0  \\
uncounted permanent \\
HOSTID=ANY ISSUED=1-jan-1990 ISSUER=lordMOLE NOTICE="Enjoy" \\
SN=00000000000000000000000000000000 START=1-jan-1990 \\
SIGN=010101010101
EOF

function cleanup() {
  rm /tmp/icc.log &> /dev/null
  rm icctest.c icctest  &> /dev/null
}
trap cleanup EXIT

# run icc once under flayer tainting the license file
echo "!! performing exploratory run"
valgrind --tool=flayer --log-file-exactly=/tmp/icc.log --taint-file=yes \
                       --file-filter="$INSTALLDIR/bin/cracked.lic" \
                       --xml=yes \
                       $INSTALLDIR/bin/iccbin &> /dev/null

# get the instruction pointers and see if any are calls we can step over.
echo "!! extracting interesting instruction pointers"
ips=$(grep \<ip\> /tmp/icc.log | # Grab the ips from the xml output
  cut -f2 -d\> |
  cut -f1 -d\< |
  grep 0x8 |
  sort  |
  uniq -c |
  sort -rn  |
  head -30 | # top 30
  tr -s ' ' |
  cut -f3 -d' ' |
  sed 's/\(.*\)/\1:1\n\1:0/g')

# make a test C file
cat <<EOF > icctest.c
#include <stdio.h>
int main() { return printf("cracked\n"); }
EOF

echo "!! $(echo $ips | wc -w) candidates identified"
# Brute force our way to freedom!
trap "" ERR
cmd=""
p=("." "o" "0" "o" "."); r=0
echo -n "!! "
for action in $ips; do
  # no need to trace - use mkf
  cmd="mkf --alter-fn=$action $INSTALLDIR/bin/iccbin"
  echo -en "${p[$((r%5))]}${p[$((r+1%5))]}${p[$((r+2%5))]}${p[$((r+3%5))]}"
  (command $cmd icctest.c -o icctest &> /dev/null;:)
  if [[ -f icctest ]]; then
    echo -en "\r!! cracked in $r attempts"
    break
  fi
  r=$((r+1))
  action=""
done
echo

if [[ ! -z "$action" ]]; then
  echo "!! creating icc-cracked"
  echo "#!/bin/bash" > icc-cracked
  export >> icc-cracked
  echo "$cmd \"\$@\"" >> icc-cracked
  chmod +x icc-cracked
  echo -e "      . o\n   __m_v_m__  thanks you for your patronage\n   lord MOLE"
  exit 0
else
  echo "!! bad luck"
  exit 1
fi

Note: Registration is required to post to the forums.

There are 31,328 total registered users.


Recently Created Topics
[help] Unpacking VMP...
Mar/12
Reverse Engineering ...
Jul/06
let 'IDAPython' impo...
Sep/24
set 'IDAPython' as t...
Sep/24
GuessType return une...
Sep/20
About retrieving the...
Sep/07
How to find specific...
Aug/15
How to get data depe...
Jul/07
Identify RVA data in...
May/06
Question about memor...
Dec/12


Recent Forum Posts
Finding the procedur...
rolEYder
Question about debbu...
rolEYder
Identify RVA data in...
sohlow
let 'IDAPython' impo...
sohlow
How to find specific...
hackgreti
Problem with ollydbg
sh3dow
How can I write olly...
sh3dow
New LoadMAP plugin v...
mefisto...
Intel pin in loaded ...
djnemo
OOP_RE tool available?
Bl4ckm4n


Recent Blog Entries
halsten
Mar/14
Breaking IonCUBE VM

oleavr
Oct/24
Anatomy of a code tracer

hasherezade
Sep/24
IAT Patcher - new tool for ...

oleavr
Aug/27
CryptoShark: code tracer ba...

oleavr
Jun/25
Build a debugger in 5 minutes

More ...


Recent Blog Comments
nieo on:
Mar/22
IAT Patcher - new tool for ...

djnemo on:
Nov/17
Kernel debugger vs user mod...

acel on:
Nov/14
Kernel debugger vs user mod...

pedram on:
Dec/21
frida.github.io: scriptable...

capadleman on:
Jun/19
Using NtCreateThreadEx for ...

More ...


Imagery
SoySauce Blueprint
Jun 6, 2008

[+] expand

View Gallery (11) / Submit