UM MÉTODO SIMPLES E FUNCIONAL! ADICIONE: *)
Citação:
COLOQUE ESSA FUNÇÃO (NO IMPLEMETATION) *) function GetIPFromHost (var HostName, IPaddr, WSAErr: string): Boolean; type Name = array[0..100] of Char; PName = ^Name; var HEnt: pHostEnt; HName: PName; WSAData: TWSAData; i: Integer; begin Result := False; if WSAStartup($0101, WSAData) <> 0 then begin WSAErr := 'Winsock is not responding."'; Exit; end; IPaddr := ''; New(HName); if GetHostName(HName^, SizeOf(Name)) = 0 then begin HostName := StrPas(HName^); HEnt := GetHostByName(HName^); for i := 0 to HEnt^.h_length - 1 do IPaddr := Concat(IPaddr, IntToStr(Ord(HEnt^.h_addr_list^[i])) + '.'); SetLength(IPaddr, Length(IPaddr) - 1); Result := True; end else begin case WSAGetLastError of WSANOTINITIALISED:WSAErr:='WSANotInitialised'; WSAENETDOWN :WSAErr:='WSAENetDown'; WSAEINPROGRESS :WSAErr:='WSAEInProgress'; end; end; Dispose(HName); WSACleanup; end; (* 1 - um WEBBROWSER (ABA INTERNET) 2 - Dois EDIT 3 - dois button *) /pegar o ip e host da intranet //No button1 digite: Quote procedure TForm1.Button1Click(Sender: TObject);var Host, IP, Err: string; begin Webbrowser1.navigate('http://www.whatismyip.com/automation/n09230945.asp'); if GetIPFromHost(Host, IP, Err) then begin Edit1.Text := Host; Edit2.Text := IP; end else MessageDlg(Err, mtError, [mbOk], 0); end ; //pegar o ip da INTERNET //No button2 digite: Quote procedure TForm1.Button2Click(Sender: TObject); Var S:Variant; begin S := WebBrowser1.Document; EDIT1.TEXT:=(S.Body.innerHTML); end; |
|
sábado, 7 de julho de 2012
Total de visualizações
Menu
- Android Hacking (11)
- Backdors (5)
- Backtrack (7)
- Cursos (9)
- Deface (8)
- Exploits (7)
- Ferramentas Cracker (7)
- Kali Linux (8)
- Linux (35)
- Metasploit (23)
- Noticias Hackers (17)
- Pentest (52)
- Pericia Forense Computacional (16)
- phishing (2)
- PHP Injection (1)
- Programaçao em geral (14)
- Rede (4)
- Security e Hacking (69)
- Sistemas Operacionais (7)
- Sql Injection (7)
- Tutoriais (78)
- Windows (3)
0 comentários:
Postar um comentário