Godleydemon

Athena Hotspot 2

Feb 20th, 2016
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 3.42 KB | None | 0 0
  1. @echo off
  2.  
  3. title Athena Network Monitor
  4.  
  5. color 0A
  6.  
  7.  
  8.  
  9.  ::Set your ssid/password here
  10.  
  11. set ssid=Athena
  12.  
  13. set password=Frankenstien123
  14.  
  15.  
  16.  
  17.  :: is the wlan compatible?
  18.  
  19.  
  20.  
  21. if exist "%HOMEDRIVE%%HOMEPATH%\Desktop\drivers.txt" (
  22.  
  23. netsh wlan show drivers >%HOMEDRIVE%%HOMEPATH%\Desktop\drivers.txt
  24.  
  25. timeout /t 2 >nul
  26.  
  27. ) else (
  28.  
  29. type NUL >%HOMEDRIVE%%HOMEPATH%\Desktop\drivers.txt
  30.  
  31. timeout /t 2 >nul
  32.  
  33. netsh wlan show drivers >%HOMEDRIVE%%HOMEPATH%\Desktop\drivers.txt
  34.  
  35. )
  36.  
  37. for /f "delims=: tokens=2" %%c in ('findstr /c:"Hosted network supported" %HOMEDRIVE%%HOMEPATH%\Desktop\drivers.txt') do set "compatible=%%c"
  38.  
  39. if %compatible%=="no" (
  40.  
  41. Echo Your Wlan is not compatible with Athena
  42.  
  43. del "%HOMEDRIVE%%HOMEPATH%\Desktop\drivers.txt"
  44.  
  45. PAUSE
  46.  
  47. ) else (
  48.  
  49. Echo Starting...
  50.  
  51. del "%HOMEDRIVE%%HOMEPATH%\Desktop\drivers.txt"
  52.  
  53. )
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  :: Beginning of loop
  60.  
  61. :top
  62.  
  63.  
  64.  
  65.  :: Detect whether clients.txt exists or not
  66.  
  67. if exist "%HOMEDRIVE%%HOMEPATH%\Desktop\clients.txt" (
  68.  
  69. netsh wlan show hostednetwork >%HOMEDRIVE%%HOMEPATH%\Desktop\clients.txt
  70.  
  71. ) else (
  72.  
  73. type NUL >%HOMEDRIVE%%HOMEPATH%\Desktop\clients.txt
  74.  
  75. )
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  :: assign status to a variable
  82.  
  83. for /f "delims=: tokens=2" %%t in ('findstr /c:"Status" %HOMEDRIVE%%HOMEPATH%\Desktop\clients.txt') do set "started=%%t"
  84.  
  85.  
  86.  
  87.  :: assign max clients to a variable
  88.  
  89. for /f "delims=: tokens=2" %%m in ('findstr /c:"Max number of clients" %HOMEDRIVE%%HOMEPATH%\Desktop\clients.txt') do set "maxclients=%%m"
  90.  
  91.  
  92.  
  93.  :: assign authentication to a variable
  94.  
  95. for /f "delims=: tokens=2" %%l in ('findstr /c:"Authentication" %HOMEDRIVE%%HOMEPATH%\Desktop\clients.txt') do set "authmode=%%l"
  96.  
  97.  
  98.  
  99.  :: Get Sent Bytes
  100.  
  101. for /f "tokens=3" %%a in ('netstat -e ^| findstr /i bytes') do set "sent=%%a"
  102.  
  103.  
  104.  
  105.  :: Get Received Bytes
  106.  
  107. for /f "tokens=2" %%a in ('netstat -e ^| findstr /i bytes') do set "rec=%%a"
  108.  
  109.  
  110.  
  111.  :: Shorten to KB accuracy to avoid batch math error
  112.  
  113. set sentkb=%sent:~0,-3%
  114.  
  115. set reckb=%rec:~0,-3%
  116.  
  117.  
  118.  
  119.  :: Do some math
  120.  
  121. set /a sentMB = %sentkb% / 1000
  122.  
  123. set /a recMB = %reckb% / 1000
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  :: Set our client variable
  130.  
  131. for /f "delims=" %%a in ('FINDSTR c:"Number of clients" %HOMEDRIVE%%HOMEPATH%\Desktop\clients.txt') do set "clients=%%a"
  132.  
  133.  :: for /f "delims=" %%p in ('arp -a|findstr /i 192.168*.*|findstr /V 192.168.173.1') do set "ratta=%%p"
  134.  
  135.  
  136.  :: I'm pretty part
  137.  
  138. cls
  139.  
  140. Echo ===============================================================================
  141.  
  142. Echo                             Athena Network Monitor
  143.  
  144. Echo.
  145.  
  146. Echo     SSID: %ssid%
  147.  
  148. Echo    %authmode%: %password%
  149.  
  150. Echo     Status: %started%
  151.  
  152. Echo.
  153.  
  154. Echo ===============================================================================
  155.  
  156. Echo        Bytes Used
  157.  
  158. Echo ===============================================================================
  159.  
  160. Echo     %sentMB% MB Uploaded - %recMB% MB Downloaded
  161.  
  162. Echo.
  163.  
  164. Echo ===============================================================================
  165.  
  166. Echo        Clients Connected
  167.  
  168. Echo ===============================================================================
  169.  
  170. Echo %clients% /%maxclients%
  171.  
  172. Echo.
  173.  
  174. arp -a|findstr /i 192.168*.*|findstr /V Interface|findstr /V 255
  175.  
  176. timeout /t 2 >nul
  177.  
  178. if %started%=="Not Started" (
  179.  
  180. netsh wlan set hostednetwork mode=allow ssid=%ssid% key=%password% keyUsage=persistent
  181.  
  182. timeout /t 2 >nul
  183.  
  184. netsh wlan start hostednetwork
  185.  
  186. timeout /t 2 >nul
  187.  
  188. )
  189.  
  190. goto top
Advertisement
Add Comment
Please, Sign In to add comment