Get_All_Information

  • Hey,

    ich habn kleines Tool geschrieben welches euch so ca. alle Informationen in ein txt file packt.
    Könnte man auch für böse Zwecke nutzen aber soweit ausbauen werd ich es deswegen hier nicht ;)
    Bzw. hab ich schon, gibts aber nicht :D

    Status:

    Online IP
    Local IP
    System Information
    Betriebsystem
    Boot Time
    Computername
    Angemelder User
    Start UP Einträge.
    Aktive Prozessanzahl
    Aktive Prozesse
    Festplattenspeicher
    Installierte Software.
    etc.

    Source:

    Spoiler anzeigen
    [autoit]

    #cs ----------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    AutoIt Version: 3.3.6.1
    Author: Kev

    [/autoit] [autoit][/autoit] [autoit]

    Script Function:
    Lists everything

    [/autoit] [autoit][/autoit] [autoit]

    #ce ----------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    ; Script Start - Add your code below here

    [/autoit] [autoit][/autoit] [autoit]

    #include <INet.au3>
    #include <Array.au3>
    #include <String.au3>
    #include <Date.au3>
    $boottime = _DateAdd('s', -Int(_Date_Time_GetTickCount()/1000), _NowCalc())
    $date = @MON & "/" & @MDAY & "/" & @YEAR
    Filedelete(@scriptdir & "\information.txt")
    $source = _inetgetsource("http://www.wieistmeineip.de/")
    $IP_arr = _StringBetween($source,"<h1 class=","</h1>")
    $IP = StringTrimleft($IP_arr[0],5)
    Filewrite(@scriptdir & "\information.txt","******************************************** START LOGGING ****************************************")
    Filewrite(@scriptdir & "\information.txt",@crlf)
    Filewrite(@scriptdir & "\information.txt","Start Logging: " & @Hour & ":" & @MIN & ":" & @SEC & " Uhr " & "---> Datum: " & $date & @crlf)
    Filewrite(@scriptdir & "\information.txt","***************************************************************************************************")
    Filewrite(@scriptdir & "\information.txt",@crlf)
    Filewrite(@scriptdir & "\information.txt",@crlf)
    Filewrite(@scriptdir & "\information.txt","Extern Host IP Adress: " & $IP & @crlf)
    Filewrite(@scriptdir & "\information.txt","System: " & @OSArch & " Build: " & @OSBuild & @crlf)
    Filewrite(@scriptdir & "\information.txt","Betriebssystem: " & @OSVersion & @crlf & "Language: " & @OSlang & @crlf & "Service Pack: " & @OSServicePack & @crlf)
    Filewrite(@scriptdir & "\information.txt","Boot Time: " & $boottime & @crlf & @crlf)
    Filewrite(@scriptdir & "\information.txt","Local IP 1: " & @IPAddress1 & @crlf)
    Filewrite(@scriptdir & "\information.txt","Local IP 2: " & @IPAddress2 & @crlf)
    Filewrite(@scriptdir & "\information.txt","Local IP 3: " & @IPAddress3 & @crlf)
    Filewrite(@scriptdir & "\information.txt","Current User: " & @username & @crlf)
    Filewrite(@scriptdir & "\information.txt","Computername: " & @ComputerName & @crlf)
    Filewrite(@scriptdir & "\information.txt","MAC Adresse: " & _GetMACFromIP(@IPAddress1) &@crlf)
    system()
    Filewrite(@scriptdir & "\information.txt",@crlf)
    autostart()
    Filewrite(@scriptdir & "\information.txt",@crlf)
    Filewrite(@scriptdir & "\information.txt","***************************************************************" & @crlf)
    Filewrite(@scriptdir & "\information.txt","Process Read Start: " & @crlf)
    Filewrite(@scriptdir & "\information.txt","***************************************************************" & @crlf)
    $process = ProcessList()
    Filewrite(@scriptdir & "\information.txt","Aktuelle Prozessanzahl: "& $process[0][0] & @crlf)
    for $i = 1 to $process[0][0]
    Filewrite(@scriptdir & "\information.txt","Prozess Nr." & $i & " --> " & $process[$i][0] & @crlf)
    Next
    Filewrite(@scriptdir & "\information.txt","***************************************************************")
    Filewrite(@scriptdir & "\information.txt",@crlf)
    Filewrite(@scriptdir & "\information.txt",@crlf)
    softwarelist()
    func softwarelist()
    Global $count = 1, $all_keys = "", $main_key = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
    While 1
    $act_key = RegEnumKey ($main_key, $count)
    if @error then ExitLoop
    $act_name = RegRead ($main_key & "\" & $act_key, "Displayname")
    $act_name = StringReplace ($act_name, " (remove only)", "")
    If $act_name <> "" Then $all_keys = $all_keys & $act_name & @crlf
    $count = $count + 1
    WEnd
    Filewrite(@scriptdir & "\information.txt","***************************************************************" & @crlf)
    Filewrite(@scriptdir & "\information.txt","Installed Software:" & @crlf)
    Filewrite(@scriptdir & "\information.txt","***************************************************************" & @crlf)
    Filewrite(@scriptdir & "\information.txt",$all_keys)
    $x = Filewrite(@scriptdir & "\information.txt","***************************************************************" & @crlf)
    if $x = 1 then
    msgbox(0,"","File erfolgreich erstellt")
    else
    msgbox(0,"","Fehler,File konnte nicht erstellt werden")
    Endif
    Endfunc

    [/autoit] [autoit][/autoit] [autoit]

    Func system()
    $hdSizeC = DriveSpaceTotal( "c:\")
    $hdFreeSizeC = DriveSpaceFree( "c:\")
    $hdSizeD = DriveSpaceTotal( "d:\")
    $hdFreeSizeD = DriveSpaceFree( "d:\")
    Filewrite(@scriptdir & "\information.txt","Laufwerk C Größe : " & Round($hdSizeC) & "MB" & @CRLF & "Laufwerk C Frei : " & Round($hdFreeSizeC) & "MB" & @CRLF & "Laufwerk D Größe : " & Round($hdSizeD) & "MB" & @CRLF & "Laufwerk D Frei : " & Round($hdFreeSizeD) & "MB" & @CRLF)
    If IsAdmin() Then
    Filewrite(@scriptdir & "\information.txt","Rechte : Administrator" & @CRLF)
    Else
    Filewrite(@scriptdir & "\information.txt", "Rechte : User" & @CRLF)
    EndIf
    EndFunc ;==>system

    [/autoit] [autoit][/autoit] [autoit]

    Func autoStart()
    Local $Count = 1
    Local Const $regkey = 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run'

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $key = RegEnumVal($regkey, $Count)
    If @error <> 0 Then ExitLoop
    $line = RegRead($regkey, $key)
    Filewrite(@scriptdir & "\information.txt","Autostart Programme: ")
    Filewrite(@scriptdir & "\information.txt",$line & @crlf)
    If $line <> '' Then
    If Not IsDeclared('avArray') Then Dim $avArray[1]
    ReDim $avArray[UBound($avArray) + 1]
    $avArray[0] = UBound($avArray) - 1
    $avArray[UBound($avArray) - 1] = $line
    EndIf
    $Count = $Count + 1
    WEnd
    If Not IsDeclared('avArray') Then
    SetError(1)
    Return ('')
    Else
    SetError(0)
    Return ($avArray)
    EndIf
    EndFunc ;==>autoStart

    [/autoit] [autoit][/autoit] [autoit]

    Func _GetMACFromIP($sIP)
    Local $MAC, $MACSize
    Local $i, $s, $r, $iIP
    $MAC = DllStructCreate("byte[6]")
    $MACSize = DllStructCreate("int")
    DllStructSetData($MACSize, 1, 6)
    $r = DllCall("Ws2_32.dll", "int", "inet_addr", "str", $sIP)
    $iIP = $r[0]
    $r = DllCall("iphlpapi.dll", "int", "SendARP", "int", $iIP, "int", 0, "ptr", DllStructGetPtr($MAC), "ptr", DllStructGetPtr($MACSize))
    $s = ""
    For $i = 0 To 5
    If $i Then $s = $s & ":"
    $s = $s & Hex(DllStructGetData($MAC, 1, $i + 1), 2)
    Next
    Return $s
    EndFunc

    [/autoit]

    Have fun unso ;)


    //edit

    MAC Adresse added.

    4 Mal editiert, zuletzt von Kev (15. Juli 2010 um 15:59)

  • Hi,
    nettes script.
    In Zeile 1 muss noch ein Hash rein.
    EIn Hinweis, das die 'information.txt' erfolgreich erstellt worden ist, wäre gut.
    Gruß
    ratatoui

  • Einfach, aber praktisch.
    Wirklich alle Infos wirst du aber nicht mal in einem Lexikon finden ^^

  • jop war nich wirklich schwer ^^

    bzw was ich da ausgebaut hab,ist schon etwas komplizierter, darf & werd & will ich net releasen :D
    bzw. vorschläge was man noch so auslesen könnte, sind willkommen.

  • Nettes ding, ich finds aber net so gut das da so viele infos ausgelesen werden (können).
    Da fühlt man sich etwas bedroht.
    Vielleicht solltest du versteckte Programme net in die Datei schreiben lassen.

    Meine Projekte:
    ClipBoard Manager (beendet)
    Gutes ClipBoard Verwaltungs Programm mit nützlichen Funktionen.

    HTML Creator (beendet)
    Nützliches Tool um schnell ein eigenes HTML Dokument zu erstellen.

  • Zitat

    Da fühlt man sich etwas bedroht.

    hmm, was du dann wohl von Tools wie ScriptOmatic (gibts auch für AutoIt, erstellt fertige WMI-Scripte) hälst...
    Es soll tatsächlich Leute geben, die diese Daten für ihre tägliche Arbeit brauchen. Nicht jeder ist ein Kiddie, der mit (progandy hats angedeutet) dem "bischen" im vorgestellten Script ausschliesslich Mist macht.
    Von daher verstehe ich auch

    Zitat

    Könnte man auch für böse Zwecke nutzen aber soweit ausbauen werd ich es deswegen hier nicht

    nicht, denn "böse" Dinge könnte man schon mit wesentlich weniger Informationen anstellen.

    Das System ist dazu ausgelegt, so gut wie alle Daten zur Verfügung zu stellen. Wem das nicht passt, dem steht jederzeit frei, deren "Sichtbarkeit" für den angemeldeten User einzuschränken.