Jump to content

Find Proxmox web interface ( or any local site really )


Go to solution Solved by argumentum,

Recommended Posts

Posted (edited)

I needed to ping Proxmox but it didn't so, let's "ping" the web interface ( or any TCP IPv4 in sight really ).
If it connects, there is something there.

  Reveal hidden contents

Not much of an example but I scanned my network in under 30 secs. Nice toy to have :)

Edit: added a hint of what may be at that IPv4 and comma delimited ports can be used.

Edit2:  Version with IP and mask:

image.png.37f4dcb68f0c341d30f963bcc9fabd86.png

  Reveal hidden contents

for those that may need it. ( or just @MattyD :D )

Edit3: Compiled it and placed it in the download area.
..and I should have put the data in a listview with a click-click to open the finding but, how many times will one not find their computers :lol:

Edit4: Added the listview to double-click and go to the ip:port.

Edit5: The script assumed that only port 80 was HTTP so I fixed that. Also added nicer save to file report.
           All in all, the script is twice the size, so is now in a ZIP in the downloads section.

Edited by argumentum
newer version

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

  • 2 weeks later...
Posted (edited)

Nice, I was more thinking along the lines of something like this though - it'll allow you scan to scan an entire subnet if you're not using a /24.

GetRange("10.0.0.78", "255.255.240.0")

Func GetRange($sIP, $sNetMask)
    Local $aIPRange[2][4], $iIP, $iMask
    $aIP = StringSplit($sIP, ".", 2)
    $aMask = StringSplit($sNetMask, ".", 2)

    For $i = 0 To 3
        $iIP = BitShift($iIP, -8)
        $iMask = BitShift($iMask, -8)
        $iIP += $aIP[$i]
        $iMask += $aMask[$i]
    Next

    Local $iNet =  BitAND($iIP, $iMask)
    Local $iFirst = $iNet + 1
    Local $iBCast = BitOr($iNet, BitNot($iMask))
    Local $iLast = $iBCast - 1

    Local $sIP2, $iIP
    For $i = $iFirst To $iLast
        $iIP = $i
        $sIP2 = ""
        For $j = 1 To 4
            $sIP2 = BitAND($iIP, 0xFF) & "." & $sIP2
            $iIP = BitShift($iIP, 8)
        Next
        ConsoleWrite(StringTrimRight($sIP2, 1) & @CRLF)
    Next
EndFunc

you'd then just nest the for loops...   On second thought, its probably better to calculate the dotted notation on the fly. - Updated example!
 

Edited by MattyD
Posted (edited)

>GetRange("10.0.0.78", "255.255.240.0")
GetDefaultGateway() gets the IP but I'll need a get-default-mask() and I don't know a simple ( copy'n'paste ) way to do it. Can you give me that ?
Else, I'll do it searching line by line ( ugly looking ) 🤔

Edit: done.

  On 9/21/2024 at 2:52 PM, MattyD said:

its probably better to calculate the dotted notation on the fly

Expand  

on that regard, I'll build an array so the estimated-time() has a min/max to calculate that :)

Edited by argumentum
done

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Posted
  On 9/10/2024 at 9:19 AM, argumentum said:

for those that may need it. ( or just @MattyD :D )

Expand  

hehe - looking good. Pulling that default mask is a nice touch.

It's obviously not an issue, but to be hyper nit-picky there's no real need to keep expanding that array.  ($iLast - $iFirst) + 1 will get you a count :)

Also putting that limit on IP addresses was probably a good idea too. God help anyone who actually has need of a /16 subnet!!

Posted (edited)

Hey mate, just a correction from my side -

I've found our IP integer rolls over to a "double" in some scenarios, which invalidates the bit-wise operations later in the function. So it looks like we'll need to force the values to be 32 bit at line 189

Never mind, I can't reproduce the issue - so I've probably done something dumb. (I thought I was pulling an incorrect range).

Edit 2: Ok so we're getting the double type because we're incrementing with a string. Essentially we're doing things like $iNetMask += "255".  The the bitwise funcs do look to be  converting back to 32bit for their operations though.

Just as a float  255.255.255.0 (0xFFFFFF00) was showing up as (0xC070000000000000).  I had assumed BitAnd etc was complaining about that!

Edited by MattyD
Posted
  On 9/22/2024 at 2:10 PM, MattyD said:

...so I've probably done something dumb...

Expand  

Well, is your code !  :P

Yes, ...when releasing code for general consumption, the code should have stupid checking error checking because the user may enter something outside the scope of the code's evaluation. Say : mask = 256.256.256.0 or some other non-sense that in a moment of ... oops ?, may/will crash the script.

If you find that something should be better post the code or let me know. :) 

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...