Autor Beitrag
Flolo
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 146

Win 3.11, Win 98, Win 2000 Pro, Linux 6-10.3 Pro, OS/2 Warp 3, OS/2 Warp 4.0, Ms-Dos 6.22,Ms-Dos 7, DR-Dos, Oberon ...
Turbo Pascal 6,D7 Pers, Kylix 3
BeitragVerfasst: Mo 13.02.06 21:16 
Ich hab da mal eine Frage: Ist es mit wenig Quelltext möglich, alle Verbindungen die in den Rechner bzw aus im heraus kommen anzuzeigen, und diese bei bedarf zu Blockieren?
Wenn ja dann wie?

_________________
>> DarkRock <<
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Mo 13.02.06 21:18 
Wozu soll das gut sein? Ein solches Thema hatten wir außerdem bereits; Fazit: es gibt genug kostenfreie bis -günstige Firewalls :roll:

AXMD
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Mo 13.02.06 21:19 
Das hört sich nach einer Firewall an.
Anzeigen weiß ich net. Aber du könntest versuchen, offene Ports mit den Sockets zu blockieren, indem du einen Serversocket(oder Clientsocket - ka) auf diesen Port stellst und aktivierst.

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Flolo Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 146

Win 3.11, Win 98, Win 2000 Pro, Linux 6-10.3 Pro, OS/2 Warp 3, OS/2 Warp 4.0, Ms-Dos 6.22,Ms-Dos 7, DR-Dos, Oberon ...
Turbo Pascal 6,D7 Pers, Kylix 3
BeitragVerfasst: Mo 13.02.06 21:21 
Schon klar, dass es viele Firewalls gibt, mich interressiert nur ob und wie das geht.

_________________
>> DarkRock <<
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Mo 13.02.06 21:24 
Du könntest dir einen Portscanner basteln. Mit den Sockets alle Ports probieren und wenn ne Exception kommt dann ist dieser zu.

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Flolo Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 146

Win 3.11, Win 98, Win 2000 Pro, Linux 6-10.3 Pro, OS/2 Warp 3, OS/2 Warp 4.0, Ms-Dos 6.22,Ms-Dos 7, DR-Dos, Oberon ...
Turbo Pascal 6,D7 Pers, Kylix 3
BeitragVerfasst: Mo 13.02.06 21:27 
Keine schlechte idee, Welche componente verwende ich da ma besten? (von indy) die TCP-Server oder?

_________________
>> DarkRock <<
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Mo 13.02.06 21:33 
Indy kenn ich nich so gut.
Welche Version hast von Delvieh? :wink:
Benutze - falls du sie hast - TServersocket bzw. TClientsocket.

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Flolo Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 146

Win 3.11, Win 98, Win 2000 Pro, Linux 6-10.3 Pro, OS/2 Warp 3, OS/2 Warp 4.0, Ms-Dos 6.22,Ms-Dos 7, DR-Dos, Oberon ...
Turbo Pascal 6,D7 Pers, Kylix 3
BeitragVerfasst: Mo 13.02.06 21:40 
Was ist DELVIEH? Ich hab indy 9! und Delphi 7 Personal. (und in 24Min auch Delphi 2005 PE) :lol:

_________________
>> DarkRock <<
UGrohne
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Veteran
Beiträge: 5502
Erhaltene Danke: 220

Windows 8 , Server 2012
D7 Pro, VS.NET 2012 (C#)
BeitragVerfasst: Di 14.02.06 00:06 
Mit dem Commandutil netstat könntest Du aktuelle Verbindungen anzeigen. Einfach die Ausgabe des Tools nehmen und sie parsen. Das ist die einfachste Möglichkeit.

Um diese Verbindungen zu blockieren, kannst Du aber nicht einfach nen Socket aufmachen. Denn wenn z.B. Apache einen Socket auf Port 80 aufgemacht hat, dann kannst Du keinen Socket mehr auf Port 80 aufmachen. Damit würdest Du den Verkehr zu diesem Port nicht blockieren können.
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Di 14.02.06 01:21 
Colin Wilson hatte auf seiner Seite mal was für NT ff: www.wilsonc.demon.co.uk/delphi.htm Musst du mal durchgucken.
Flolo Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 146

Win 3.11, Win 98, Win 2000 Pro, Linux 6-10.3 Pro, OS/2 Warp 3, OS/2 Warp 4.0, Ms-Dos 6.22,Ms-Dos 7, DR-Dos, Oberon ...
Turbo Pascal 6,D7 Pers, Kylix 3
BeitragVerfasst: Di 14.02.06 20:59 
@UGrohne: Höhrt sich garnet so schlecht an, hast du ein Beispiel?

_________________
>> DarkRock <<
UGrohne
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Veteran
Beiträge: 5502
Erhaltene Danke: 220

Windows 8 , Server 2012
D7 Pro, VS.NET 2012 (C#)
BeitragVerfasst: Di 14.02.06 21:04 
Ein Beispiel? Geh doch einfach mal in die Kommandozeile und ruf netstat auf oder netstat /? ein, dann siehstes ;-) Du brauchst das dann nur noch zu parsen.
Flolo Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 146

Win 3.11, Win 98, Win 2000 Pro, Linux 6-10.3 Pro, OS/2 Warp 3, OS/2 Warp 4.0, Ms-Dos 6.22,Ms-Dos 7, DR-Dos, Oberon ...
Turbo Pascal 6,D7 Pers, Kylix 3
BeitragVerfasst: Di 14.02.06 21:12 
Das will ich nun selber in einem Delphiprogramm haben!

_________________
>> DarkRock <<
UGrohne
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Veteran
Beiträge: 5502
Erhaltene Danke: 220

Windows 8 , Server 2012
D7 Pro, VS.NET 2012 (C#)
BeitragVerfasst: Di 14.02.06 21:17 
Hmm, versuchs mit dieser Prozedur:
ausblenden volle Höhe Delphi-Quelltext
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:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
function GetConsoleOutput(const Command: Stringvar Output, Errors: TStringList): Boolean;
var
  StartupInfo: TStartupInfo;
  ProcessInfo: TProcessInformation;
  SecurityAttr: TSecurityAttributes;
  PipeOutputRead: THandle;
  PipeOutputWrite: THandle;
  PipeErrorsRead: THandle;
  PipeErrorsWrite: THandle;
  Succeed: Boolean;
  Buffer: array [0..255of Char;
  NumberOfBytesRead: DWORD;
  Stream: TMemoryStream;
begin
  //Initialisierung ProcessInfo
  FillChar(ProcessInfo, SizeOf(TProcessInformation), 0);

  //Initialisierung SecurityAttr
  FillChar(SecurityAttr, SizeOf(TSecurityAttributes), 0);
  SecurityAttr.nLength := SizeOf(SecurityAttr);
  SecurityAttr.bInheritHandle := true;
  SecurityAttr.lpSecurityDescriptor := nil;

  //Pipes erzeugen
  CreatePipe(PipeOutputRead, PipeOutputWrite, @SecurityAttr, 0);
  CreatePipe(PipeErrorsRead, PipeErrorsWrite, @SecurityAttr, 0);

  //Initialisierung StartupInfo
  FillChar(StartupInfo, SizeOf(TStartupInfo), 0);
  StartupInfo.cb:=SizeOf(StartupInfo);
  StartupInfo.hStdInput := 0;
  StartupInfo.hStdOutput := PipeOutputWrite;
  StartupInfo.hStdError := PipeErrorsWrite;
  StartupInfo.wShowWindow := sw_Hide;
  StartupInfo.dwFlags := STARTF_USESHOWWINDOW or STARTF_USESTDHANDLES;

  if  CreateProcess(nil, PChar(command), nilnil, true,
  CREATE_DEFAULT_ERROR_MODE or CREATE_NEW_CONSOLE or NORMAL_PRIORITY_CLASS, nilnil,
  StartupInfo, ProcessInfo) then begin
    result:=true;
    //Write-Pipes schließen
    CloseHandle(PipeOutputWrite);
    CloseHandle(PipeErrorsWrite);

    //Ausgabe Read-Pipe auslesen
    Stream := TMemoryStream.Create;
    try
      while true do begin
        succeed := ReadFile(PipeOutputRead, Buffer, 255, NumberOfBytesRead, nil);
        if not succeed then break;
        Stream.Write(Buffer, NumberOfBytesRead);
      end;
      Stream.Position := 0;
      Output.LoadFromStream(Stream);
    finally
      Stream.Free;
    end;
    CloseHandle(PipeOutputRead);

    //Fehler Read-Pipe auslesen
    Stream := TMemoryStream.Create;
    try
      while true do begin
        succeed := ReadFile(PipeErrorsRead, Buffer, 255, NumberOfBytesRead, nil);
        if not succeed then break;
        Stream.Write(Buffer, NumberOfBytesRead);
      end;
      Stream.Position := 0;
      Errors.LoadFromStream(Stream);
    finally
      Stream.Free;
    end;
    CloseHandle(PipeErrorsRead);

    WaitForSingleObject(ProcessInfo.hProcess, INFINITE);
    CloseHandle(ProcessInfo.hProcess);
  end
  else begin
    result:=false;
    CloseHandle(PipeOutputRead);
    CloseHandle(PipeOutputWrite);
    CloseHandle(PipeErrorsRead);
    CloseHandle(PipeErrorsWrite);
  end;
end;

Diese gibt Dir die Ausgabe eines Konsolenkommandos als StringList zurück, dann kannst Du das parsen. Aber das musst Du selbst übernehmen, weil ich dafür leider kein Beispiel parat habe. Sollte sich aber mit Hilfe der Suche genug dazu finden.
Flolo Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 146

Win 3.11, Win 98, Win 2000 Pro, Linux 6-10.3 Pro, OS/2 Warp 3, OS/2 Warp 4.0, Ms-Dos 6.22,Ms-Dos 7, DR-Dos, Oberon ...
Turbo Pascal 6,D7 Pers, Kylix 3
BeitragVerfasst: Di 14.02.06 21:23 
OJE :lol: Danke erstmal, ich bin erstmahl bedient! :wink:

_________________
>> DarkRock <<
Flolo Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 146

Win 3.11, Win 98, Win 2000 Pro, Linux 6-10.3 Pro, OS/2 Warp 3, OS/2 Warp 4.0, Ms-Dos 6.22,Ms-Dos 7, DR-Dos, Oberon ...
Turbo Pascal 6,D7 Pers, Kylix 3
BeitragVerfasst: Di 14.02.06 21:54 
Der Quellcode funktioniert irgentwie nicht! Da kommt folgende Meldung:

Zugriffsverletzung bei Adresse 00413FED in Modul 'Projekt1.exe'. Lesen von Adresse 03AE011A.

Woran ligt das?

_________________
>> DarkRock <<
Flolo Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 146

Win 3.11, Win 98, Win 2000 Pro, Linux 6-10.3 Pro, OS/2 Warp 3, OS/2 Warp 4.0, Ms-Dos 6.22,Ms-Dos 7, DR-Dos, Oberon ...
Turbo Pascal 6,D7 Pers, Kylix 3
BeitragVerfasst: Sa 18.02.06 21:22 
Dieser Fehler lässt sich auch nicht durch ein anderes Delphi beheben, liegt das vielleicht an meinem Computer? Der meldet nämlich sehr gerne diesen Fehler!

_________________
>> DarkRock <<
Flolo Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 146

Win 3.11, Win 98, Win 2000 Pro, Linux 6-10.3 Pro, OS/2 Warp 3, OS/2 Warp 4.0, Ms-Dos 6.22,Ms-Dos 7, DR-Dos, Oberon ...
Turbo Pascal 6,D7 Pers, Kylix 3
BeitragVerfasst: Do 09.03.06 17:20 
Also: Ich hab mir den Quelltext genauer angeguckt, und hab festgestellt, dass das ergebnis des folgenden Befehls immer false ist:
ausblenden Delphi-Quelltext
1:
2:
3:
  if  CreateProcess(nil, PChar(command), nilnil, true,
  CREATE_DEFAULT_ERROR_MODE or CREATE_NEW_CONSOLE or NORMAL_PRIORITY_CLASS, nilnil,
  StartupInfo, ProcessInfo) then ...


Kann mir jemand sagen warum?

_________________
>> DarkRock <<