Verwijderd schreef op 08 november 2004 @ 12:52:
Ik moet het gebruiken omdat de server het ook gebruikt. Dat kan wel omgezet worden, maar het moet eigenlijk via NTLM gebeuren.
Het is niet echt een script request, maar meer of iemand de methode's weet die gebruikt worden om de code's samen te stellen (via PHP).
Tnx anyway
NTLM authenticatie is een érrug suckend protocol ben ik achter. Het wordt echt bijna *nergens* gebruikt, en is idd een gesloten protocol dat door reverse engineeren uitgeplozen is...
Het beste wat je kan doen is libCURL gebruiken voor je authenticatie (ik neem tenminste aan dat je door een ISA server heen moet, voorderest wordt NTLM al bijna nergens meer gebruikt)
Ik hoop dat je hier wat aan hebt:
PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
| /**
* Sleur de inhoud van een HTML pagina van internet.
* Met ISA Proxy Authentication
* @param string $proxyserver Proxy Servername
* @param int $proxyport Proxy Port number
* @param string $username proxy Username
* @param string $password proxy Password
* @param string $url te fetchen URL
*/
function curl_fetch($proxyserver, $proxyport, $username, $password, $url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_PROXY, "{$proxyserver}:{$proxyport}");
curl_setopt($ch, CURLOPT_PROXYUSERPWD, "{$username}:{$password}");
curl_setopt($ch, CURLOPT_HEADER, 1);
$result=curl_exec ($ch);
curl_close ($ch);
return ($result);
}
/**
* POST gegevens naar een URL op internet.
* Met ISA Proxy Authentication
* @param string $proxyserver Proxy Servername
* @param int $proxyport Proxy Port number
* @param string $username proxy Username
* @param string $password proxy Password
* @param string $url target URL
* @param array $data Array met te posten gegevens
* @param string $cookie inhoud van de eventuele cookie.
*/
function curl_post($username, $password $url, $data, $cookie)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_PROXY, "{$proxyserver}:{$proxyport}");
curl_setopt($ch, CURLOPT_COOKIE, $cookie);
curl_setopt($ch, CURLOPT_PROXYUSERPWD, "{$username}:{$password}");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
$result = curl_exec ($ch);
curl_close ($ch);
return ($result);
} |
Mocht je echt code willen zien waarin dit uitgeplozen is, dan kan je even op zoek gaan op google naar de volgende string:
Python:
1
2
| # This file is part of 'NTLM Authorization Proxy Server'
# Copyright 2001 Dmitry A. Rozmanov <dima@xenon.spb.ru> |
komt uit een python lib die ik gebruik om m'n whatpulse door de proxy heen te trappen
[
Voor 7% gewijzigd door
SchizoDuckie op 08-11-2004 14:38
]