[ Pobierz całość w formacie PDF ]
Text1.Text = ""
End If
End Sub
Private Sub wsk_Close()
wsk.Close
wsk.listen
Text1.Text = Text1.Text & "Remote Intruder Logged Off, Daemon Reset."
& vbCrLf
End Sub
Private Sub wsk_ConnectionRequest(ByVal requestID As Long)
If wsk.State sckClosed Then wsk.Close
wsk.Accept requestID
RMN = DNS.AddressToName(wsk.RemoteHostIP)
RIP = wsk.RemoteHostIP
Label1.Caption = RMN
RMN = Label1.Caption
Text1.Text = Text1.Text & "Remote Intruder Logged On: " & RMN & "(" &
RIP & ")" &
1 vbCrLf
End Sub
Private Sub wsk_DataArrival(ByVal bytesTotal As Long)
wsk.GetData RxData
Text1.Text = Text1.Text & RxData
End Sub
130 D:\KISIU\PDFy\Chudy\Ksią\ki\Hack wars doc\hack wars tom 2 [ PL ]\hack wars tom 2 [ PL ]\01b.doc
Rozdział 1. f& 131
f& Zabezpieczanie portów i usług
f&
f&
Private Sub wsk_Error(ByVal Number As Integer, Description As String,
ByVal Scode
1 As Long, ByVal Source As String, ByVal HelpFile As String, ByVal
HelpContext
1 As Long, CancelDisplay As Boolean)
wsk.Close
If DaemonPort "" Then
wsk.LocalPort = DaemonPort
wsk.listen
End If
Text1.Text = Text1.Text & "Winsock Error: " & Number & ": " &
Description & vbCrLf
Text1.Text = Text1.Text & "Daemon was reset." & vbCrLf
End Sub
' Opcje programu (preferencje)
Private Sub chkBeep_Click()
Dim strINIFILE As String
strINIFILE = APPPATH & INIFILE
If chkBeep.Value = vbChecked Then
WriteINI strINIFILE, "GENERAL", "BEEP", "1"
Else
WriteINI strINIFILE, "GENERAL", "BEEP", "0"
End If
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOk_Click()
ANTI_FLOOD_COUNT = txtConnectTimes
SaveINISettings
Unload Me
End Sub
Private Sub Form_Load()
Me.Icon = frmMain.Icon
txtConnectTimes = ANTI_FLOOD_COUNT
Select Case ANTI_FLOOD_ACTION
Case 1
optResetPort.Value = True
Case 2
optShutPort.Value = True
Case Else
End Select
End Sub
Private Sub optResetPort_Click()
ANTI_FLOOD_ACTION = 1
End Sub
Private Sub optShutPort_Click()
ANTI_FLOOD_ACTION = 2
End Sub
' Tworzenie zasad
Private Sub Cancel_Click()
Unload Me
End Sub
Private Sub cmdOk_Click()
If txtPortNumber "" Then
D:\KISIU\PDFy\Chudy\Ksią\ki\Hack wars doc\hack wars tom 2 [ PL ]\hack wars tom 2 [ PL ]\01b.doc 131
132 Hack Wars. Tom 2. Na tropie hakerów
If IsNumeric(txtPortNumber) = True Then
If txtPortNumber >= 1 Then
If PortExists = False Then
If txtPortName = "" Then
frmMain.lvwPortInfo.ListItems.Add , ,
txtPortNumber
Else
frmMain.lvwPortInfo.ListItems.Add , ,
txtPortName
End If
With
frmMain.lvwPortInfo.ListItems(frmMain.lvwPortInfo.ListItems.Count)
.SubItems(1) = txtPortNumber
.SubItems(3) = "Disabled"
.SubItems(4) = "Never"
.SubItems(5) = "0"
End With
Else
Exit Sub
End If
Else
GoTo bad_port
End If
Else
GoTo bad_port
End If
Else
GoTo bad_port
End If
Unload Me
Exit Sub
bad_port:
MsgBox "You must enter a valid port number to continue!",
vbExclamation, "Error!"
End Sub
Function PortExists() As Boolean
Dim i As Integer
For i = 1 To frmMain.lvwPortInfo.ListItems.Count
If frmMain.lvwPortInfo.ListItems(i).SubItems(1) = txtPortNumber
Then
MsgBox "That port is already guarded!", vbExclamation,
"Error!"
PortExists = True
Exit Function
End If
Next i
PortExists = False
End Function
Private Sub Form_Load()
Me.Icon = frmMain.Icon
End Sub
Private Sub txtPortName_GotFocus()
txtPortName.SelStart = 0
txtPortName.SelLength = Len(txtPortName)
End Sub
Private Sub txtPortNumber_GotFocus()
txtPortNumber.SelStart = 0
132 D:\KISIU\PDFy\Chudy\Ksią\ki\Hack wars doc\hack wars tom 2 [ PL ]\hack wars tom 2 [ PL ]\01b.doc
Rozdział 1. f& 133
f& Zabezpieczanie portów i usług
f&
f&
txtPortNumber.SelLength = Len(txtPortNumber)
End Sub
' Analizator wtargnięcia
Private Sub cmdListen_Click()
Select Case cmdListen.Caption
Case Is = "Listen"
If opTCP.Value Then
Inet.Protocol = sckTCPProtocol
Inet2.Protocol = sckTCPProtocol
Inet.LocalPort = CInt(txtLocalPort.Text)
Inet.RemoteHost = txtRemoteIP.Text
Inet.RemotePort = CInt(txtRemotePort.Text)
txtLocalPort.Enabled = False
txtRemoteIP.Enabled = False
txtRemotePort.Enabled = False
cmdListen.Caption = "Reset"
Inet.Close
Inet.listen
log "I>Capturing TCP traffic on " & Inet.LocalIP & ":" &
Inet.LocalPort
Else
Inet.Close
Inet2.Close
Inet.Protocol = sckUDPProtocol
Inet2.Protocol = sckUDPProtocol
Inet.LocalPort = CInt(txtLocalPort.Text)
Inet2.RemoteHost = txtRemoteIP.Text
Inet2.RemotePort = CInt(txtRemotePort.Text)
txtLocalPort.Enabled = False
txtRemoteIP.Enabled = False
txtRemotePort.Enabled = False
cmdListen.Caption = "Reset"
Inet.Bind CInt(txtLocalPort.Text)
log "I>Capturing UDP traffic on " & Inet.LocalIP & ":" &
Inet.LocalPort
End If
Case Is = "Reset"
Inet.Close
txtLocalPort.Enabled = True
txtRemoteIP.Enabled = True
txtRemotePort.Enabled = True
cmdListen.Caption = "Listen"
End Select
End Sub
Private Sub Command1_Click()
txtLog.Text = ""
End Sub
Private Sub Form_Load()
txtLocalIP.Text = Inet.LocalIP
End Sub
Private Sub Form_Resize()
If Not Me.WindowState = vbMinimized Then
txtLog.Width = Me.ScaleWidth
txtLog.Height = Me.Height - 850
End If
End Sub
D:\KISIU\PDFy\Chudy\Ksią\ki\Hack wars doc\hack wars tom 2 [ PL ]\hack wars tom 2 [ PL ]\01b.doc 133
134 Hack Wars. Tom 2. Na tropie hakerów
Private Sub Inet_Close()
log "I>INET EVENT: CLOSED CONNECTION"
Inet2.Close
cmdListen_Click
cmdListen_Click
End Sub
Private Sub Inet_Connect()
log "I>INET EVENT: CONNECT"
End Sub
Private Sub Inet_ConnectionRequest(ByVal requestID As Long)
log "I>INET EVENT: CONNECTION REQUEST [ " & requestID & " ]"
If Inet.State sckClosed Then Inet.Close
log "I>CONNECTING 0 TO " & txtRemoteIP.Text & ":" &
CInt(txtRemotePort.Text)
Inet2.Close
Inet2.Connect txtRemoteIP.Text, CInt(txtRemotePort.Text)
Do Until Inet2.State = sckConnected
DoEvents
Loop
Inet.Accept requestID
End Sub
Private Sub Inet_DataArrival(ByVal bytesTotal As Long)
Dim sData As String
Dim bData() As Byte
If opTCP.Value Then
Inet.PeekData sData, vbString
Inet.GetData bData(), vbArray + vbByte
Inet2.SendData bData()
Else
Inet.GetData sData
Inet2.SendData sData
End If
log "I>" & sData
Exit Sub
erred:
Inet.Close
Inet2.Close
cmdListen_Click
cmdListen_Click
End Sub
Private Sub Inet_Error(ByVal Number As Integer, Description As
String, ByVal Scode
As Long, ByVal Source As String, ByVal HelpFile As String, ByVal
HelpContext
1 As Long, CancelDisplay As Boolean)
[ Pobierz całość w formacie PDF ]
-
Archiwum
- Strona pocz±tkowa
- BuśÂyczow Kiryl Dziewczynka z przyszśÂośÂci
- Arthur C. Clarke 2010 Odyseja kosmiczna
- Demon Zimna
- Joe R. Lansdale Collins & Pine 06 Captains Outrageous (com v4.0)
- McMahon Barbara Jak znaleśÂć dobrego mćÂza
- 553ab_SP7_1.0_PV2_ENVY15_2
- Jack L. Chalker WOS 3 Gods of the Well of Souls
- Laurie King Anne Weverley 01 The Birth Of A New Moon
- Dane, Cameron A Fostered Love
- May Karol W podziemiach Mekki
- zanotowane.pl
- doc.pisz.pl
- pdf.pisz.pl
- rafalradomski.pev.pl