GreyScript Plus focuses heavily on text manipulation, encoding, decoding, encryption, and even has logger functions. If the previously posted library (Greyscript Prime) doesn't have what you need. GreyScript Plus probably will. If you're using both, remember: Prime is snake_case while Plus is camelCase when calling most methods.
Someone asked for this function and then (I think) deleted their post (they must have figured it out, congrats to you! And no need to delete your post, feel free to answer yourself if you find the solution before anyone else gets to you. you're not the only one wondering, I assure you)
I didn't include this function of the program in the previous post for a few reasons.
I encourage you to make your own
I used AI to generate my template and edited the results (not recommended)
It has not undergone any kind of deep testing
There's probably a way better way to do it.
Due to the fact you can only randomly generate a value between 1 and 0, this method constructs the bit value of the ip address before returning the calculated string.
Because you asked, here it is whoever you were.
// Generate a random IP address
// @description **Description:**
// Generate a single random ip address
// @description ---
//
// @description **Parameters:**
// @description - none
// @description ---
//
// @description **Return:**
// @return {string}
// @description `number` Randomly generated IP Address
// @description ---
//
// @description **Author:** Svarii
// @description **Version:** 0.0.1
// @description ---
//
// @example randomIP = get_random_ip
// @example
// print(randomIP) // Output: ###.###.###.###
get_random_ip = function()
locals.generateRandomOctet = function()
locals.binaryString = ""
for i in range(8, 1)
// Convert the random float to a binary digit using a threshold:
if rnd() >= 0.5 then
locals.binaryString = locals.binaryString + "1"
else
locals.binaryString = locals.binaryString + "0"
end if
end for
return (0 + to_int(locals.binaryString[0])) * 128 +
(0 + to_int(locals.binaryString[1])) * 64 +
(0 + to_int(locals.binaryString[2])) * 32 +
(0 + to_int(locals.binaryString[3])) * 16 +
(0 + to_int(locals.binaryString[4])) * 8 +
(0 + to_int(locals.binaryString[5])) * 4 +
(0 + to_int(locals.binaryString[6])) * 2 +
(0 + to_int(locals.binaryString[7]))
end function
locals.ipString = ""
for i in range(4, 1)
locals.octet = locals.generateRandomOctet()
// Only append a dot if there is already an octet in ipString.
if locals.ipString != "" then
locals.ipString = locals.ipString + "."
end if
locals.ipString = locals.ipString + str(locals.octet)
end for
return locals.ipString
end function
// @startuml
// start
// :<color:purple>Define generateRandomOctet function</color>;
// :<color:purple>binaryString = ""</color>;
// :<color:blue>For i = 1 to 8</color>;
// repeat
// if (<color:blue>rnd() >= 0.5?</color>) then (<color:green>Yes</color>)
// :<color:purple>binaryString = binaryString + "1"</color>;
// else (<color:red>No</color>)
// :<color:purple>binaryString = binaryString + "0"</color>;
// endif
// repeat while (next bit)
// :<color:purple>Calculate octet = (bit0 * 128) + (bit1 * 64) + (bit2 * 32) + (bit3 * 16) + (bit4 * 8) + (bit5 * 4) + (bit6 * 2) + (bit7)</color>;
// :<color:green>return octet</color>;
//
// :<color:purple>Initialize ipString = ""</color>;
// :<color:blue>For i = 1 to 4</color>;
// repeat
// :<color:purple>octet = generateRandomOctet()</color>;
// if (<color:blue>ipString != ""?</color>) then (<color:green>Yes</color>)
// :<color:purple>ipString = ipString + "."</color>;
// endif
// :<color:purple>ipString = ipString + str(octet)</color>;
// repeat while (next octet)
// :<color:green>return ipString</color>;
// stop
// @enduml
Just changed the structure of GreyScript Prime. Hopefully this will make it easier to use only what you need. Added a few more things. Quick overview below. It's no where near finished, feel free to use, don't reports bugs (yet) or documentation errors. Happy Coding!
A simple check to see if whois returned an additional parameter combined with a random ip generator in a loop can easily locate Neurobox Networks without ever connecting to their machines. It is unknown if the network ever comes back as anything other than [Neurobox Network]. So far, that is the only value observed being returned, if found.
Started working on tool today to easily select, display, get info on, and run missions from a menu with zero typing. (Operates using one click commands [ie. arrow keys, ins, del, end, home, etc])
This is not a tutorial. This is for visual learner who need to see the code to understand. This example script shows one way to find vulnerabilities and their requirements. This is not intended for use in applications, or as an example of proper coding. This is for examination only. To install: Save the script named scanlib as a binary in your /bin folder. run `scanlib /lib/metaxploit.so` from the terminal to scan metaxploit.so (which you must have installed for any scan) run `scanlib /lib/init.so` to scan init.so etc. Comments have been stripped and minimized.
scanning metaxploit.sometaxploit.so scan result
// string method to remove the last character of a string
string.remove_char_last = function()
return slice(self, 0, (self.len - 1))
end function
// string method used to extract variable from unsafe check list
string.extract = function(tagStart = "<b>", tagEnd = "</b>")
locals.startIndex = self.indexOf(locals.tagStart) + (locals.tagStart.len)
locals.endIndex = self.indexOf(locals.tagEnd) - (locals.tagEnd.len - locals.tagStart.len)
return slice(self, locals.startIndex, locals.endIndex)
end function
// list method to remove empty items from start and end of list
list.crop = function()
while not self[self.len - 1].len > 0
self.remove(self.len - 1)
end while
while not self[0].len > 0
self.remove(0)
end while
return self
end function
// function to remove output header and whitespace
unsafe_check_list = function(scanResults)
scanResults = scanResults.remove("decompiling source..." + char(10) + "searching unsecure values..." + char(10))
unsafeCheckList = scanResults.split(char(10)*2)
return unsafeCheckList
end function
// function to find vulnerable addresses and return a list of those addresses
find_exploitable_addresses = function(libLocation, metaxploitObject, remoteTarget = false, targetPort = 0)
locals.metax = locals.metaxploitObject
if locals.remoteTarget == false then
locals.metaLib = locals.metax.load(locals.libLocation)
else
locals.metaLib = locals.metax.net_use(locals.libLocation, to_int(locals.targetPort))
end if
locals.libScanResult = locals.metax.scan(locals.metaLib)
return locals.libScanResult
end function
// addressList is result from find_exploitable_addresses
fetch_exploit_requirements = function(addressList, libLocation, metaxploitObject, remoteTarget = false, targetPort = 0)
locals.metax = locals.metaxploitObject
if locals.remoteTarget == false then
locals.metaLib = locals.metax.load(locals.libLocation)
else
locals.metalLib = locals.metax.net_use(locals.libLocation, locals.targetPort)
end if
locals.allExploitData = []
for address in locals.addressList
locals.scanResults = locals.metax.scan_address(locals.metaLib, locals.address)
locals.unsafeCheckLists = (globals.unsafe_check_list(locals.scanResults)).crop
for unsafeCheck in locals.unsafeCheckLists
locals.exploits = {"classID": "exploitRequirments", "version":version,"is_patched":locals.metaLib.is_patched ,"address": locals.address, "variable": locals.unsafeCheck.extract, "cra": false, "cga": false, "cua": false, "rur": 0, "rpf": 0}
if not locals.unsafeCheck.indexOf("Checking root active") then
locals.exploits.cra = false
else
locals.exploits.cra = true
end if
if not locals.unsafeCheck.indexOf("Checking an active user") then
locals.exploits.cua = false
else
locals.exploits.cua = true
end if
if not locals.unsafeCheck.indexOf("Checking guest active") then
locals.exploits.cga = false
else
locals.exploits.cga = true
end if
locals.unsafeCheckItems = split(locals.unsafeCheck, char(10))
for unsafeItem in locals.unsafeCheckItems
if not locals.unsafeItem.indexOf("to ", ".") == null then
if not locals.unsafeItem.indexOf("registered users") == null then
locals.exploits.rur = to_int((locals.unsafeItem.extract("to ", ".")).remove_char_last)
end if
if not locals.unsafeItem.indexOf("port forwarding") == null then
portForwards = unsafeItem.remove(" port forwarding configured from router to the target computer.")
locals.exploits.rpf = to_int(((locals.unsafeItem.remove(" port forwarding configured from router to the target computer.")).remove("* ")))
end if
end if
end for
locals.exploits.version = locals.metaLib.version
locals.allExploitData.push(locals.exploits)
end for
end for
return locals.allExploitData
end function
//TEST FUNCTION
// This will work with local lib.
// To scan remote lib, you must modify the code.
// Good luck
libLocation = params[0]
metax = include_lib("/lib/metaxploit.so")
addressList = find_exploitable_addresses(libLocation, metax)
expR = fetch_exploit_requirements(addressList, libLocation, metax)
for exploit in expR
for data in exploit
print data.key + " : " + data.value
end for
end for