#cybersecurity

7 messages · Page 46 of 1

fair trail
#

I will use SHA256 so 64 characters. I'm not terribly concerned about collisions because the hash is only used to obfuscate/authenticate a relatively small amount data.

#

BTW I watched a short HAMC explainer on youtube and yes this is pretty much what I was thinking.

sinful cliff
sinful cliff
#

you could store the key directly as 32 bytes if the storage can store 8 bit data per byte without doing anything fancy with it or you could hex encode it and store it as a 64 character string

summer mason
#

does anyone know if there is a bypass for this regex : /["'&<>]/ to filter the xss?

sinful cliff
summer mason
#

ig not?

sinful cliff
summer mason
sinful cliff
summer mason
#

ah yes good point

sinful cliff
# summer mason ah yes good point

client side filtering is just a way to give quick feedback to the user, but they can always circumvent that and send what ever they want to the server, hence the filtering on the server side is what really matters

wise pecan
#

Never trust the client, always validate server sid

#

You don't control the client after it's distributed

thorn obsidian
#

"Never trust user input"

Golden rule

sinful cliff
#

yeah, or even, never trust users 😉

wise pecan
#

They're a tricky bunch

#

Complain to much in my experience!

gray narwhal
#

code

past starBOT
#

Hey @gray narwhal!

You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.

gray narwhal
thorn obsidian
gray narwhal
#

sorry i don't understand python

thorn obsidian
#

U should use a editor that converts tabs to spaces

wise pecan
#

Might be a better topic for another channel

#

As I look for an appropriate channel though I don't really see one like "learn python"

thorn obsidian
#

Yes but as u see he’s new so that’s ok

wise pecan
#

Yeah it's okay he just may get more help somewhere else

thorn obsidian
#

And it wasn’t a big topic

wise pecan
#

@gray narwhal probably first thing to do is turn on whitespace rend[er]ing in whatever editor you have too. Will help you spot this, but converting tabs to spaces is probably the best advice

gray narwhal
past starBOT
#

Hey @gray narwhal!

You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.

gray narwhal
wise pecan
#

Alright, well a big part of learning to write code, (and I'm kind of assuming this is your first language) is reading the errors from compilers and interrupters and fixing things. This is telling you there's an issue on line 31, you think config is a dictionary, but its null / none

#

So you need to trace the how your code executes and find out why that is

gray narwhal
wise pecan
#

Same difference

gray narwhal
#

somehow code is 8 year old and it's broken

#

and when i fix one error i get another

wise pecan
gray narwhal
#

well i try to convert a51tables with kraken

wise pecan
#

Oh that's why you're in security

gray narwhal
#

yes

wise pecan
#

Yeah, so if this code ever worked it seems like it might be an issue with how you invoked it.

#

potentially

gray narwhal
#

well i download kraken and i try to run ./Behemoth.py /root/a51tables and get error

wise pecan
#

Alright, well I'm not going to go through and review some rando's fork of a package I've never heard of. Ill say this looks like someone playing around on an afternoon and you might want to look for something else to use

gray narwhal
#

well there is second option with phone connected to rpi but if i connect phone minicom somehow won't connect phone with minicom interface

wise pecan
#

Hmm I get the sense you're doing something I may not want to help with

#

Don't crack your GF's phone, they always find out ;)

#

(wild speculation based on personal experience, don't take it as an accusation)

#

Oh, I see its WPA GSM cracking

gray narwhal
#

WPA not WPA

#

GSM

#

only for personal use

#

i have 40 = 1.6TB rainbow tables

#

i follow crazy danish hacker tutorial

wise pecan
#

I think this might be a place for talking about how to secure code, vs cracking/hacking.

#

Or, Ill say even if it isn't I don't know you and won't give you help with the latter

gray narwhal
#

😦

wise pecan
#

I work for a sec company I need to keep my nose clean

gray narwhal
#

oh ok

austere lodge
#

do they teach the Linux command line in Cybersecurity classes?

surreal glen
#

not a whole lot

austere lodge
#

so do I have to learn it before I enter CyberSec

zinc field
zinc field
smoky turtle
# austere lodge Alright thanks man

I have the opinion learning linux is extremely extremely important for cybersecurity. Your question would be like asking is physical fitness a pre requisite for playing sports at the high level. Good news is that using a gnu/linux operating system isnt hard at all.

raven frost
raven frost
#

Also some things you should just learn on your own. I mean I don’t know about you but I was interested in computing because I was interested in computing, not because it was on some syllabus. Eventually in your career you will need to do something that you were never formally taught, so knowing how to learn independently is important.

#

Some of the best engineers I’ve known just tinker a lot. They don’t just wait around for some course.

dire osprey
#

Whats the prerequisites for cyber security and how do I get started with it?

thorn obsidian
dire osprey
thorn obsidian
#

If you take the time to read the file, you can see it's listed below.

pale briar
#

cybersecurity is really a broad term for a range of jobs

#

like are you trying to be a cybersecurity analyst? ethical hacker? pentester? cybersecurity engineer?

wise pecan
#

I would say people with strong networking backgrounds have a leg up, but specifically application testing doesn't require it as much. Ill say the last line of defense for most compromised entities are well segmented networks

pale briar
#

a little bit of programming

wise pecan
#

Yeah

#

Especially for specific app testing, instead of like ... 'holistic" security

#

But you don't have to be a Staff Engineer or anything :D

#

Also I gave you info for the jobs that pay a lot $$$, so its geared towards corporate america. Consumer grade still is kind of a different beast

#

IE phones, consumer grade net gear, etc. I have a few freinds that go nutz and segment their networks at home, don't use wifi, have wire racks and shielded CAT in their house, but I have ... strange friends.

wise pecan
#

So it depends on which area you're interested in and want to specialize in.

wise pecan
pale briar
#

yeeeh my friend is in college for sec i think??

#

he already has a good starting point though

#

he's certified in python, C++, and java

#

not certified in ethical hacking but im 99% sure when he gets certified he will be able to get that certificate

#

but he wants to get his degree first

wise pecan
#

I went into software eng and then just happened to know a guy who ended up working for one of the big 3 "vulnerability management" software providers

#

I'm not much of like hacker/cracker guy, I can fsk about but he's the real deal

#

His first job he asked an ecom store if he could pen test their site for free then emailed them a list of all their customers CCs

#

lolol

pale briar
#

holy

#

that's badass lmao

wise pecan
#

Yeah I worked for them too for a bit after school, it wasn't like amazon, this was a "mom and pop" store, though it was doing mulitimillion $$ business online

#

Their code was a shit show

pale briar
#

i feel a lot of smaller companies either don't want to pay the money for cybersecurity or they think they have good enough code to protect themselves because nothing bad has happened to them yet... until something happens

#

in the upcoming years more and more companies will want more protective measures

#

as technology advances and hackers get smarter

wise pecan
#

I mean log4shell was pretty bad

#

only thing worse was maybe heartbleed, shellshock really sucked

#

I was at this sec company for all of those

#

and back then I was one of the guys who wrote checks for this stuff

#

Got assigned to do shellshock for smtp servers, and I'd only been on the job for like 6 mo at that point

thorn obsidian
#

Eternal Blue was way worse in some terms/points compared to the ones you've listed, as of today's data.

#

Same for Kaminsky

wise pecan
#

Those are weapons grade things, yeah its not good but these [the three I listed] were just, dumb as shit, easy to exploit and ubiquitous

#

That's what I mean

#

And the things you mentioned use like a constellation of exploits IIRC , yeah the NSA made them push button, but they're not the same, where as a script kiddie could go fuz 1000s of IPs for log4shell

#

Oh sorry you mentioned Kaminsky, yeah that sucks but that was before my time in the industry

pale briar
wise pecan
#

I mean the GD thing turned up on fucking MC servers first

#

well first rep'd

#

I lawld

#

"hacking java for budder and ice in MC"

pale briar
#

ngl my friend told me the best way to get into ethical hacking/pentesting is to start off as a script kiddie but analyze how scripts are made until you learn how to make your own scripts

#

that's what he did apparently

thorn obsidian
#

It's not a bad thing, just like for coding, you just need to at least have some fundamentals.

pale briar
#

and don't take other mfs scripts and call yourself a master hacker

#

bc you know how to launch the scripts and use them

thorn obsidian
#

And even as a professional pentester you use pre-made scripts and tools. So it's not a drama to use them.

pale briar
#

yeah

#

you just get honored more i guess if you make your own scripts and use those

thorn obsidian
#

Not really no

pale briar
#

oh idk

#

im relatively new to cybersecurity

thorn obsidian
#

You won't remake Burpsuite just because you don't want to be a script kiddie.

pale briar
#

true

thorn obsidian
#

How you conduct your tests is irrelevant for the companies. As long as you have a professional and full result they're fine with it.

pale briar
#

i see

#

because the company just wants the job done

thorn obsidian
#

In your results however, you will have to explain steps to how you got to that result. Which will then give a score of how dangerous the vulnerability is.

#

If you ran a simple command like anyone could do in 2 seconds, it will be easy for anyone to remake, hence it will be marked as very important.

#

Sometimes it's not even that bad to run basic tools everyone knows on the targets you're given.

pale briar
#

and the harder it was for you to exploit the vulnerability the less dangerous it is

#

?

thorn obsidian
#

Not really

#

How easily doable it is, is one factor

#

There are other factors to take in consideration

#

A pentesting report is really long and detailed

wise pecan
#

Yeah if you need a bank of super computers to crack weak encryption that is not the same as an RCE on a network service

#

But nationstates are all out there being shitters, and can throw some serious hardware and brain power at stuff now, so "dangerous" might be relative to the client and their likely exposure to that kind of attack

pale briar
thorn obsidian
#

What is the difference for you.

pale briar
#

what ive learned is pentesters usually are exploiting a specific thing the company is asking for while ethical hackers have access to everything

thorn obsidian
#

Not really no

#

Pentesters are nothing but a subset of all ethical hacking techniques

#

Mainly focused on system weaknesses

pale briar
#

oh i see

thorn obsidian
#

Pentesters still have to write reports

pale briar
#

so ethical hackers do other things such as trying to socially engineer employees to give critical data?

#

that's just what i've read online

thorn obsidian
#

any attack vector
I don't really like this

#

When you're given a pentest you have a meeting with people in the company which then also defines your scope and/or targets.

#

Social engineering is typically directly removed from the techniques allowed to be used in a pentest

pale briar
#

oh i see

#

some websites say sometimes ethical hackers are sometimes required to socially engineer employees

#

this is also another thing i found

#

and thanks for having patience with me because im inexperienced with this

thorn obsidian
#

Yeah well, you can't really specifically say which technique is (not) allowed to be used.

#

Everything is clarified during the meeting, along with the authorized targets.

thorn obsidian
thorn obsidian
#

You might be allowed to conduct tests on everything you want using anything you want, or not

#

Who here is into pentesting?

cedar junco
#

Yo guys

#

What tool should i learn after nmap ?

#

@thorn obsidian

#

@pale briar

#

@wise pecan

#

i am very confused right now

#

some people tells to learn metasploit, others aircrack-ng, and others tells me to learn a programmming language such py or c

wise pecan
#

I'd vote Metasploit but you should learn to program

thorn obsidian
#

You don't really need to learn any tool specifically. Knowing how to interact with it is sufficient.

wise pecan
#

And if you learn to program but only as a skill vehicle for sec, scripting is best, and say python to boot

thorn obsidian
#

I would definitely learn programming first, lots of people use C or Python yet it's a personal choice at the end.

cedar junco
#

Yeah i already know python

#

basics

thorn obsidian
#

And of course learn the fundamentals first, this will be 90% theory. But it is needed theory to know.

thorn obsidian
#

You mostly will see what you should start to learn and focus on, before "learning" a tool.

#

Just knowing how to use tools basically makes you a script kiddie. Same if you only know the theory but can't understand it correctly and still learn the tools one by one, try to learn the theory and make, for example, nmap by yourself to see how you would do it.

cedar junco
#

You mean i write tools with my own programming skills

#

@thorn obsidian

thorn obsidian
#

Kind of, yeah

#

Having these 5 pillars of knowledge will help you increase your knowledge and get yourself more involved

cedar junco
#

Are you an expert in hacking ?

#

@thorn obsidian

#

Anyways would you tell the sources to learn the fundementals

thorn obsidian
#

Remember that cyber security is not running around tools or scripts only. There is a lot of theory you need to know.

cedar junco
#

Thanks a lot @thorn obsidian

thorn obsidian
#

No problem fastnod

cedar junco
#

I will message you when i need

thorn obsidian
#

Sure thing

thorn obsidian
cedar junco
#

I tooked a look about the 5 pillars and i found what i was searching about

#

@thorn obsidian

thorn obsidian
#

Nice nice

cedar junco
#

now i'm wondering if i should learn them in oprder or what

thorn obsidian
#

I'd personally follow them

cedar junco
thorn obsidian
#

Yeah

cedar junco
#

How long you've been in this field

thorn obsidian
#

Quite some time 😅

cedar junco
#

xD

thorn obsidian
#

I'd guess around 5-6 years?

#

At the beginning of course not that much active as nowadays

cedar junco
thorn obsidian
#

19

#

Started early, same for coding (11 years old)

cedar junco
#

And if i may ask where are you from ?

thorn obsidian
#

Switzerland

cedar junco
#

Ohh, beautiful country you have there

thorn obsidian
#

Yup, and you?

cedar junco
#

Im russian

#

and i m 15 years old

thorn obsidian
#

Nice nice, also starting early :D

cedar junco
#

i just started my career

#

i think its the time

thorn obsidian
#

Yep

cedar junco
#

It seemes that learning gonna take a while

thorn obsidian
#

It does, it's a long time

cedar junco
#

I'm ready for the journey

thorn obsidian
#

Then that's good, motivation is the key

cedar junco
#

no doubt

#

I will start from tommorw

dire osprey
raven frost
thorn obsidian
#

Yep, it's also basically one of my only way to spend my time on things - along with cyber security

dire osprey
thorn obsidian
#

Yes there are, depending on what you need Python can help you automate some small things and exploits

dire osprey
#

Such as?

thorn obsidian
#

That would go against the channel topic.

dire osprey
#

Wdym

#

Is it not related?

thorn obsidian
#

Securing code against hacking through techniques such as data sanitization and encryption, and protecting yourself and your devices.

#

It's about securing, not really about a tutorial on how to exploit or use a library to do so

#

I'm sure you can find enough resources on the Internet about the libraries often used

dire osprey
#

Does one not need to learn the exploits to be able to defend against them?

thorn obsidian
#

That is your job to do

wise pecan
#

Yeah Im not going to get into it for the same reason I didn't help that person looking at GSM hacking yesterday

#

I dunno you and this aint the channel for it

thorn obsidian
#

We won't teach you how to exploit something

dire osprey
#

Ah I see, ty anyways :)

raven frost
#

@dire osprey go get books like black hat Python and gray hat Python but otherwise that’s off topic here

#

Man I think I see more people asking about how to hack in here than how to secure. That right there shows you the world is doomed lmao 🤣

thorn obsidian
#

The thing is that this channel is technically not even about general security knowledge, which is sad, it's just oriented to securing your Python code.

wise pecan
#

nawh TV just made it seem mysterious and dangerous like being a gangster but as with most things like that the truth is a lot more mundane and weeds people out

thorn obsidian
#

TPH has a 'kind of' a better channel for that

raven frost
#

On a more serious note though, people come into this thinking hacking is this flashy sexy thing and in reality it’s not - it’s extremely difficult and requires tens, hundreds, or thousands of hours of failing over and over and trying to find weaknesses.

thorn obsidian
#

Just throw them some assembly lul

wise pecan
#

lololol

raven frost
#

I remember one time I was working trying to reproduce an exploit. Across the street were some roofers. They finished the entire roof before I got it working. That’s hacking

wise pecan
#

"you must know ASM or GTFO, what do you mean you dont have a copy of IDA!?!?"

dire osprey
raven frost
#

That’s only one type of vuln - memory vulns

#

There are many others. Logic bugs, input sanitization, path traversal

thorn obsidian
#

Might want to take a look at web vulnerabilities - for example in Flask code

raven frost
#

Even still, Cpython is implemented in C which IS subject to memory vulns, so it’s possible to write a script which exploits a memory vuln in the Python interpreter anyway

#

I’ve had to analyze those type of vulns before at work

dire osprey
dire osprey
thorn obsidian
#

Best of luck

dire osprey
#

Ty

wise pecan
thorn obsidian
#

Learning from failing

thorn obsidian
#

I can relate that

#

When I started to solve CTF challenges at first it’s was hard but I learned new stuffs there and I move on

#

And I have to say still tonnes of things to learn

thorn obsidian
#

Yeah, CTFs you just got to play more and more

raven frost
#

Yeah it’s annoying that a lot of those type of competitions get this stigma that they are measurement of pure intelligence and those who are good are just “smarter” and while intelligence helps a ton of it is just domain specific knowledge, experience and practice just like anything else. It’s like who do you think will ace the binary search tree interview? Someone who writes them every day for fun who has a normal programmers IQ or someone who has one of the highest IQs but has never written anything like that? I bet on the former.

cold plaza
#

Hello

#

I need help with a script

thorn obsidian
#

For us to help you we need the script and the issue you're facing. Otherwise nobody will be able to help you.

wise pecan
#

Okay, so what do you think about the advice about "setting up a lab" I just gave that to someone. Basically you've got your main PC you can do research, and if you can swing it setup a second one to run VMs / software on to tinker and toy with. Screw up the lab? no problem just jump on your main and research how to fix this

#

But this how I learned Linux OSes, networking and info sec in general like 15 years ago now

#

(I also STILL do this but work is pretty satisfying for this now)

#

I dunno if someone would give different advice now

#

Actually the whole set it up -> break it on accident -> research the fix, rinse repeat was basically how I learned everything, and also similar to how I write software (write -> test -> tweak -> repeat)

raven frost
#

I think that’s an effective way to learn. If I break a VM and I don’t have time to try to fix it I just restore a snapshot though 😆 but yeah if I were new it would be more valuable to try and fix it

pale briar
#

there's industry standards for everything in computers

#

certifications matter more than college degrees

raven frost
raven frost
wise pecan
#

Anyone hearing chatter about DDOS going on right now

#

Eh nothing probably my provider, just some goofy shit going on with my cnx over here

#

and a few other people in my area

pale briar
wise pecan
raven frost
wise pecan
#

I ran everything right on the metal when I started out, madness!

naive bridge
#

hi

#

i hope everyone okay

#

i have been Learning OSINT for the past 2 years

#

been applying for some remote jobs and they mentioend about programming skills to automate tasks

im new to programming too

#

didnt know how to get started to automate OSINT with python

#

any suggestion related to this will help alot

raven frost
#

There isn’t like a OSINT.do() method, it’s a bunch of different things that can be automated to various degrees probably using beautiful soup, and various web APIs

near abyss
#

lmao

cedar junco
#

Is A+ course enough to teach me general comouting which is the first pillar ?

#

@thorn obsidian

thorn obsidian
#

Good question, what exactly do you mean with "A+"?

thorn obsidian
#

In order to start in security area, do you guys have any advice or docs for me?

#

I mean, to get started

thorn obsidian
#

Thank you. I aprecciate that

cedar junco
#

I mean is A+ enough for "**General Computing **"

grave glade
#

I have auth that begins with "Basic".
I was able to decode it using base64 decoder to see what the username and password is.

I have another auth which begins with "Espresso".
Wondering what decoder I can use to decode this "Espresso" auth?

fallen zenith
#

can someone help me

sinful cliff
grave glade
sinful cliff
grave glade
#

Oh that was my bad, when I saw Bearer and Digest earlier I thought it was steps for authentication/hashing.
But all those are different authentication methods

thorn obsidian
# cedar junco The first pillar " **General Computing** " is related with the A+ course

I'd personally not put a limit to how much you want to learn. Stopping at, for example, A+ because you think it's enough is not a good idea and not a way to learn I personally like. It's never enough when it comes to learning, you will never know too much or everything. And you shouldn't try to learn the least possible by thinking something like "Yeah A+ is enough for that".

snow sedge
thorn obsidian
#

Pretty much, yeah

dark socket
#

Certifications are a necessity in this industry. They are far more valuable than a college degree.
ehhhhh

thorn obsidian
wise pecan
#

(None of mine have lol)

outer copper
#

hello, do u know file label

#

for exp : very secret , secret vs.

thorn obsidian
#

What exactly do you mean?

rustic peak
#

Does anyone know how I can protect my website and secure it like a cybersecurity tutorial?

rancid kiln
#

never trust input from the user

scarlet shore
#

does anyone know good reference material for the cissp certification?

austere lodge
#

How do I start learning how to bypass firewalls for example?

zinc field
past starBOT
#

5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.

austere lodge
#

my bad

austere lodge
thorn obsidian
#

Like networking, headers, etc

austere lodge
#

But is there a way to just learn how to bypass almost anything

thorn obsidian
#

that question is just to big to answer.

#

there isn’t one way to learn and do it

austere lodge
#

Alright

austere lodge
#

Do u have any websites that I can learn

thorn obsidian
#

learning firewall bypass,

austere lodge
#

yeah

thorn obsidian
#

I don’t know any website related to this topic

sinful cliff
thorn obsidian
thorn obsidian
#

As said above, don't expect it to be like in movies where they bypass something within a few seconds. That is just totally unrealistic, or the firewall is completely wrongfully set-up.

onyx phoenix
#

I'm working on a web app using flask. I was wondering if this login system is considered secure, or shall I employ another strategy?

@app.route("/login", methods=["POST"])
def login():
    # already logged in
    if "key" in session and session["key"] in app.sessions:
        return redirect(url_for("index"))
    else:
        user = get_user_info(request.form["username"])
        if user is None:
            return render_template("login.html", failed=True)
        else:
            if user["password"] == hasher(request.form["password"], user["username"]):
                session["key"] = secrets.token_hex()
                app.sessions[session["key"]] = datetime.utcnow()
                return redirect(url_for("index"))
            else:
                return render_template("login.html", failed=True)

get_user_info will fetch the user profile from the database, this is username, email and salted + hashed password (plus a few unrelated bits and pieces)
hasher is this simple helper function:

def hasher(pw: str, salt: str) -> str:
    return hashlib.sha512((pw + salt).encode("utf-8")).hexdigest()
#

feel free to @ me if you reply

thorn obsidian
#

Not related to your question but usually you go for stateless nowadays

sinful cliff
#

but generally it's more and more stateless like jwt:s and the like, might even be short lived that are renewed ever so often during the lifetime of the session

faint dune
#
def login():
    username = input('Enter username: \n')
    cur.execute(f"SELECT * FROM users WHERE username = '{username}'")
    
    if not cur.fetchone():
        print('Username does not exists')
        login()
        
    user = cur.execute(f"SELECT * FROM users WHERE username = '{username}'").fetchall()
    
    entered_password = input('Enter password: \n')
    
    d = check_password_hash(entered_password, user[0][2])

why this always return false even if the passwords are the same?

sinful cliff
sinful cliff
sinful cliff
# faint dune can you explain?

if you include strings that a user can control directly into the query in one way or another (with interpolation like you are, or with any of the format methods), the user can launch what is called a sql injection attack
i will not go in to how one does that, but that is very easy to find online, just know that you will be vulnerable if any of your sql statements look even remotely like what you showed from your code

faint dune
sinful cliff
# faint dune can you explain?

to avoid sql injection vulnerabilities you should always use sql placeholders, for most database connectors/drivers you do it like this:

def login():
    username = input('Enter username: \n')
    user = cur.execute('SELECT password FROM users WHERE username = ?', (username, )).fetchone()
    
    if not user:
        print('Username does not exists')
        login()
    
    entered_password = input('Enter password: \n')
    
    d = check_password_hash(entered_password, user[0])

now, i have quite a few issues with the code beside that, but i only went in and fixed the database related stuff
for example, i wouldn't tell the user that the username does not exist, i would let them enter both username and password, then check them both (even if i don't have a password to match against i would hash the input password to avoid side-channel timing attacks), and if anything went wrong i would just report back to the user that the login failed without revealing anything more than that

#

the side-channel timing attack is a more advanced topic and might be overkill for your purposes
for me it's more a force of habit to try to include protections to whatever i can

timber patio
#

To prevent them escaping the statement to the file's code or executing something in the database if you give the raw input to the db

thorn obsidian
#

Yeah that's actually 1 to 1 exactly what they explained above just paraphrased..

timber patio
#

lol

sinful cliff
# timber patio Sanitize the input 😄

something could slip trough if you just rely on sanitizing of input when there are better techniques available such as sql placeholders in this case
but yes, one should never ever trust user input/data and always sanitize it as thoroughly as one can

faint dune
sinful cliff
# faint dune well thank you so match, btw what are the other problems?

i would also prefer to close the cursor, but i don't know how the rest of your code looks like and i would use something strong like argon2id probably through passlib or similar for the password "hashing" instead of a simple hash (but now i'm just assuming that is a simple hash because of the function name) and would use a salt for the password as well

thorn obsidian
#

Well, I don't know where you plan to use this but input() seems like a locally executed script.

#

Which then contains the database credentials, just don't distribute the files randomly

sinful cliff
#

yeah, why try to crack the user password when you can just read the whole database locally 😉
have not seen the connection string so don't know if it is a local database, i was just assuming it was, like sqlite3 or something
probably just a toy project to start to learn python and databases i'm guessing

thorn obsidian
#

Most likely, hence my warning to not distribute files

faint dune
#

I'm just doing a password manager, nothing crazy
its not the most secure app ever created but I'm trying to make it somewhat secure

sinful cliff
faint dune
carmine sparrow
#

is this the last one?

sinful cliff
past starBOT
#

8. Do not help with ongoing exams. When helping with homework, help people learn how to do the assignment without doing it for them.

thorn obsidian
#

For anybody seriously vested in security, has learning and becoming proficient in python been an irrevocable benefit?

carmine sparrow
sinful cliff
lethal shell
#

That said, knowing how programs work because you know how they might be programming is a tremendous help when trying to evaluate the security (or lack thereof) in a program or system of programs.

#

For most position I would say that knowing programming well is a nice bonus, but not what separates a good <title here> from a mediocre one.

#

(Source: I've worked as a security consultant and am a certified penetration tester, but also biased towards my own personal experience from work, training and my own conversations with my peers and friends.)

cerulean sphinx
#

Can someone tell me what modifications look suspicious using RPM how do I know whats good or bad what am I looking for???

#

It shows several changes made but I dont know what is okay and what is not

thorn obsidian
#

From my experience I wouldn't say it was an irrevocable benefit.

#

we all make mistakes

#

?

#

My point was that learning Python was a benefit but not a super duper mega benefit.

#

ahh, thought you were taking aim as to it not being the proper word to use in the context lol. Sorry I tend to over analyze.

#

Ah no not at all

#

over analyze == be dumb

#

lol

#

Put in italic to show that it wasn't that much of a benefit but still somewhat useful

#

Yeah, slight misunderstanding. I have to work on putting things in the best light possible first before jumping the gun. I'm a good portion into a course a this point. Seems easy enough. Readability wise.

#

All good peepoSheep

cerulean sphinx
thorn obsidian
#

What is for you a "best cyber guy"

cerulean sphinx
#

the ability to modify and create your own material for security without using someone elses stuff

thorn obsidian
#

Interesting definition

#

Some sets of people would then be excluded, such as myself, from your definition. I don't consider myself a "best cyber guy" but you get my point

#

And do note that the original question was about Python, not programming overall

#

Can penetration tests be efficiently conducted with an automated program? I believe PTaaS companies promote this but it's kind of hard to believe unless they use it as a baseline of assessment

lethal shell
#

@thorn obsidian you doing the cyber apocalypse ctf? 👀

thorn obsidian
#

Nope, focusing on other stuff right now

#

Might do some more in the future

lethal shell
#

same lol

cerulean sphinx
# thorn obsidian Can penetration tests be efficiently conducted with an automated program? I beli...

Yes you can automate just about all processes if you know what your looking for and you can even create your own programs to run all your needs effectively that’s the benefit it gives you but it is also hard to get to that point another benefit is the ability to change and modify already existing programs that already do that and you can change it to work more for you then everyone if that makes sense

thorn obsidian
#

Yeah, perfectly. I find all of this so d@mn interesting. Hopefully in time I'll gain the knowledge to give back to this server what you helpful people have given me :)

lethal shell
#

You can automate testing for SQL Injections for example, but you can't (easily) automate performing a pentest on, say, Microsoft Word or Our New Game Client.exe

lethal shell
cerulean sphinx
lethal shell
#

A Nesus report is not a pentest

cerulean sphinx
severe cipher
#

I wanna a virus file... so send me it asap

#

Hey anyone alive?

#

I want to test it on my VM

thorn obsidian
#

We will not send viruses to other people as it breaches the Terms of Service of Discord and can get our account terminated.

#

If you need virus samples you can find a ton on the Internet by searching, but we will not give you any.

restive lotus
#

!rules

past starBOT
#

The rules and guidelines that apply to this community can be found on our rules page. We expect all members of the community to have read and understood these.

cerulean sphinx
thorn obsidian
#

Yes.

scarlet shore
#

What are some good material for studying the cissp certification?

analog fox
#

sa

scarlet shore
#

Thank you!

cedar junco
#

Can anyone explaines to me the " sudo " command?

sinful cliff
cedar junco
#

All the root privileges ?

#

@sinful cliff

sinful cliff
# cedar junco All the root privileges ?

that depends on how you configure sudo, but many distributions default sudo configurations allow full root privileges to any user that is a member of the wheel user group, but this can be changed and be much more restricted with reconfiguration of sudo

thorn obsidian
#

Can someone explain me how can I wrie AES 128 from scratch in python, I watched some videos and some documents from our good old fellow, google, but I couldn't find anything useful...
Note: I'm a begginer in python

thorn obsidian
#

You definitely don't want to make your own implementation of AES 128 as a Python beginner.

sinful cliff
#

other then for learning about cryptography, but don't use it for anything else than that, it will be inherently insecure and with very bad performance as it will not utilize hardware offloading available in the cpu

thorn obsidian
#

What should i do 😑?

#

Tell him it's not normal to have to make an AES implementation in a language you are a beginner in

sinful cliff
sinful cliff
# thorn obsidian What should i do 😑?

if it in fact is to implement the algorithm from scratch; sure, do the assignment, but at the same time it's not an implementation that should be used for anything else then just completing the assignment, never ever use it in the real world

thorn obsidian
#

I wouldn't even understand why a teacher asks someone who is a beginner in a language to make their implementation of AES 128

#

That doesn't help you learn the language or anything, it will just make you confused and demotivated

sinful cliff
#

maybe the class is more about cryptography then programming and python is just chosen because it's one of the easier programming languages to learn 🤷

thorn obsidian
#

also, he told us about toy cipher or smth like that, which we can make instead of AES. what's that then, I thought they were the same thing @sinful cliff

thorn obsidian
#

Toy ciphers are "much" easier to make compared to AES, same for the CTC cipher

#

But what kind of teacher asks you to do that if it's not a cryptography class and you have a beginner level of Python

#

Makes no sense at all

#

I have bad teachers but never someone like that

thorn obsidian
sinful cliff
# thorn obsidian also, he told us about toy cipher or smth like that, which we can make instead o...

encryption and decryption with a toy substitution ciphers like rot13 https://en.wikipedia.org/wiki/ROT13 will be much much simpler to implement than AES

there is even something easier that that which just happens to be the most secure cipher in the world
the one-time pad which is basically just a bitwise xor operation, but it's only secure if it's handled correctly and it's unfeasible to use most of the time https://en.wikipedia.org/wiki/One-time_pad

thorn obsidian
sinful cliff
# thorn obsidian The teacher eventually meant the CTC cipher, not a toy cipher. For the one-time ...

oh, CTC is certainly more specific and more involved then just any toy cipher such as rot13

i didn't have time to go into length about using true random as the key and never ever reuse the key stream as well as the problem with secure key distribution and exchange with such keys
but given that you can handlel those challenges it is the only cipher known to be totally unbreakable (mathematically proven) given even huge amounts of only cipher text and endless computational power and time and even future developments in cipher analysis or new technologies such as quantum computers
that's why I stand by the statement that it is the most secure cipher in the world, but I agree that it isn't without its challenges

sinful cliff
#

it should probably be added that by it self it only provides confidentiality, nothing more, which of course can be seen as a drawback and something other algorithms addresses

cedar junco
#

Guys i need an explainig of the application layer in OSI model ?

#

I'm facing some problems to understand the term end-user

thorn obsidian
#

It’s just the application ur using like http,ftp,ssh anything interaction

past starBOT
#

Hey @thorn obsidian!

It looks like you tried to attach file type(s) that we do not allow (.log). We currently allow the following file types: .gif, .jpg, .jpeg, .mov, .mp4, .mpg, .png, .mp3, .wav, .ogg, .webm, .webp, .flac, .m4a, .csv, .json.

Feel free to ask in #community-meta if you think this is a mistake.

cerulean sphinx
#

Hey random question what would be the benefit to double encrypting something like you write code to encrypt then just do the same thing again or even put it on a while loop?

runic bloom
#

Do ethical hacker use python?

thin peak
#

Depends

thorn obsidian
#

If you take the same algorithm and the same key it won't change a lot, it will in fact just make it slower during bruteforce.

#

Encrypting multiple times is also pretty much useless, if you have heard of Kerckhoff.

#

The security of a message does not rely on how strong the algorithm is, but the key.

#

A very basic example would be a Caesar cipher, you can encrypt the message as many times as you want, in the end 1 out of 25 keys will be valid.

#

In some algorithms, such as Caesar or RSA, if you encrypt with key A and then with key B, the result will be just like encrypting with key C.

#

If you plan to do that for passwords or similar think about the following:
Encrypting a second time makes the password two times harder to bruteforce it.
Adding one character to the password makes it around 50-60 times harder to bruteforce it.

cerulean sphinx
#

thank you that was a pretty good explanation

thorn obsidian
#

are there any good obsfucators

thorn obsidian
#

Yes, if you use the correct settings

#

Just Python is not really made to be obfuscated

#

It's just like JavaScript

#

Can be reverted to semi readable code easily

raven frost
#

he goes over implementation too. It is in C++ but it'll be easy to port that to Python.

sinful cliff
# cerulean sphinx Hey random question what would be the benefit to double encrypting something lik...

what was said about the time for a brute-force attack was very simplified but true under the assumption that the same key is used for the iterations
using the same algorithm a number of times will only make the brute-force attack take that many times longer, just like the encryption and decryption will also that an equal amount of times longer

regarding kerckhoff, that is not at all what it's about
what kerckhoff said is that one should never rely on the secrecy of the algorithm to keep a crypto system secure
one should assume that an adversary will learn about the algorithms and the methods used
the only part of the crypto system that should be required to be kept secret is the key

different algorithms are of different strengths
using more than one algorithms for different passes will add protection if someone found a flaw or shortcut in one of the algorithms as they would need to find similar flaws in the other(s) as well, but only if used with separate keys

raven frost
#

@thorn obsidian Christof Paar is great but as you stated it's mostly the "on paper"/academic/design stuff

#

the videos are also indexed now, so you can easily skip around

thorn obsidian
#

If you didn't managed to understand that, in that case copy pasting what he said won't change anything

#

What he said is exactly

The security of a message does not rely on how strong the algorithm is, but the key.
formulated with the secrecy, hence the strength and security of the algorithm
So yes, if you blindly read and learn, or search, words by words what he said you won't come to that. That goes into the blindly learning by heart category.

sinful cliff
# thorn obsidian And that's exactly the point of kerckhoff, if the algorithm gets public it shoul...

i'm a 100% with you on:

if the algorithm gets public it shouldn't be that much of a big deal as it's not what makes the algorithm secure, but the key itself.
as well as:
so the secrecy of the algorithm must not be an issue if once made public
the part i don't agree with is when you say:
It doesn't matter how strong the algorithm is

he never says that the strength of the algorithm doesn't matter, but that the security of the algorithm should/must not require the algorithm to be secret
otherwise we would all be fine with using ciphers now deemed insecure as long as we are using a secret key, which we aren't
of course the security (not secrecy) and strength of the cipher matters, the algorithm must be able to withstand basic crypto analysis such as frequency analysis and so on

i'm a strong advocate of only using publicly known and well studied algorithms, which from what i've seen in this channel, you are too

thorn obsidian
#

@sinful cliff @thorn obsidian hi again
I changed my assignment and this time my T told me to make my custom encryption algorithm with the help of s-box or something like this. so i did some research and made this. i guess it's ok for a beginner however i kinda feel it's become somehow messy. anyway here is my code https://gist.github.com/IamYousef/e550192e0a5142ec2a2b761246cd012f
also, i know how my encryption system works but i just can figure out how to make a decryption algorithm. can u help?

#

my T told me to make my custom encryption algorithm
Here we go again

cerulean sphinx
#

@thorn obsidian This is for you too if you want to answer?

cerulean sphinx
thorn obsidian
#

Well that comes under one of my points

In some algorithms, such as Caesar or RSA, if you encrypt with key A and then with key B, the result will be just like encrypting with key C.

#

So depending on the algorithm you use, you can encrypt 100 times with a different key, it won't be any harder to bruteforce

cerulean sphinx
#

okay okay that makes plenty of sense I understand fully

thorn obsidian
sinful cliff
thorn obsidian
#

Can make a very basic example, if you encrypt "Hello world" 2 times with the Caesar cipher, once with shift 4 (key A) and once with shift 6 (key B) it will result to "Rovvy gybvn". Now if you were to bruteforce the last string

#

It's just like using key C, so 10 (6+4)

cerulean sphinx
#

Yes thank you using more then one key is just making 1 new key thank you

thorn obsidian
#

Not always, depends on the algorithm used

cerulean sphinx
#

Yeah I got that thanks although Im not familiar with a lot of the different popular used algorithms It makes sense

sinful cliff
#

in that example, decrypting with a wrong key is more or less another round of encryption as it mutates the data

#

and it's using one 168 bit key that is cut up in 56 bit slices where one is used for each pass

cerulean sphinx
#

Okay so I guess in the realm of safety in encryption I would think symmetric encryption methods are the best way to achieve that and just depends on the algorithm you use however not practical in some situations

sinful cliff
#

while normal single DES is just using one 56 bit key

cerulean sphinx
#

and just going with the best method on the first go around is the best way about going about it

sinful cliff
#

but due to vulnerabilities in the DES algorithm you will not get even close to 56 bits of security per pass

cerulean sphinx
#

Okay so going back to the method you would use one that would support more bits per pass or once again just using a symmetric encryption?

sinful cliff
#

i would say longer keys for one pass is better then two passes with half the key length per pass

cerulean sphinx
#

Okay and I think DES is only considered good if 3 different keys are used per pass but still once again its smaller keys

sinful cliff
#

one pass of Rijndael 256 is probably better then two passes of Rijndael 128 even with two different keys (Rijndael is the original name of the cipher we all now know as AES, because it was the winner of the AES competition)

cerulean sphinx
#

okay thats fair but what if you used DES on an AES encrypted file could you double stack encryptions like that?

sinful cliff
#

sure, but never reuse the same key
because DES is much weaker then AES, if one was to break the key for the outer weaker layer DES one would have compromised the key or at least part of the key that was reused and the next layer will be easier to brute-force
and i would never encourage anyone to use DES or even 3DES today

cerulean sphinx
#

Okay thats pretty cool thank you

sinful cliff
sinful cliff
forest wind
#

Any interesting blog or feed people follow when it comes to sast or dast?

raven frost
#

@thorn obsidian @thorn obsidian I think the idea is to just get you thinking. I doubt the teacher expects any real scheme or anything perfect by any means.

sinful cliff
raven frost
#

I think it's a case of "its about the journey, not the destination"

sinful cliff
raven frost
#

That being said, is it a brutal thing to ask a python beginner to start with encryption? yes. But hey, we live in a brutal world.

#

🙂

cerulean sphinx
sinful cliff
#

or you learn the hard way why you shouldn't attempt to implement ciphers or crypto systems your self 😉

raven frost
#

Sometimes pain is the best teacher

#

this teacher is probably a genius actually

#

hes showing his students by example why they probably never want to write their own crypto again lol

#

and if they do, they can go on to be cryptographers lol

sinful cliff
raven frost
#

I consider myself pretty decent with physics, but I got a whole lot better after flying over the handlebars of my bike a few times. 🙂

sinful cliff
cerulean sphinx
#

okay

thorn obsidian
#

Hey, how do call a password that is true/legit/that matches the username?

cerulean sphinx
sinful cliff
thorn obsidian
modern bronze
#

do you salt the hash?

#

encrypted, hashed, salted, scattered, covered

thorn obsidian
#

As said above, either use a hashing algorithm that is strong enough or a salt.
Saving them in a separate table is simply useless.
I don't really get by "encrypting the vps" - you can't just encrypt whatever you want as you wish. But yes, you might want to secure your VPS.

thorn obsidian
#

Lets say I have a website

#

And I have an SSL cert

#

And someone can be connected through a proxy

#

So an MITM attack can happen

#

So the attacker can give the client a fake SSL cert and decrypt the traffic then encrypt it again with the actual SSL cert

#

How would I prevent that?

#

If possible?

sinful cliff
#

i would recommend using both salting and a strong one-way function such as Argon2id for the passwords, i believe pythons passlib has support that
secure programming practices are also very important, for example be vigilant about not using any user provided input for sql queries unless using placeholders and bind variables to avoid sql injection attacks that could easily extract the full content of your database

sinful cliff
# thorn obsidian How would I prevent that?

not using self signed certificates for the website and using HSTS is a good start and will mitigate quite a few such attempts as long as the client has visited the site previously before the MITM attempt and it wasn't far in the past so that the HSTS has expired

mutual TLS (mTLS) is also an option (even if a very advanced and cumbersome one), where you would require the client to use client certificates that you can trust that only the user can get hold of and not an adversary, which will be quite a bar to entry for anyone wanting to use the service and also presents problems with certificate enrollment for the users as well as the one running the service/server

however, even without such measures the client will be made aware of the fact that they are not connecting to the real site as the adversary will most probably not present a certificate issued by a valid certificate authority for that domain, but the user may ignore those warnings and click through them and access the site anyways, it will depend on the vigilance of the user (which isn't reliable)

thorn obsidian
thorn obsidian
#

How should I start learning about cryptography?😑

sinful cliff
thorn obsidian
sinful cliff
# thorn obsidian should i really pay $42 for a book?

they are both really good books in their own right, i think it's only fair to support creators for their time if one consume their product, but you do you
i think there are free samples like the first few chapters that you can read online to form an opinion of what you think of the book before you buy
there might be used books to buy cheaper or electronic versions which might be cheaper
these books should also be available in libraries if you want to lend them for a while to read

raven frost
#

@thorn obsidian didnt you say you saw Christof Paar's course?

#

Thats honestly a great way to start, its comprehensive. The entire university lessons are online

#

Thats (applied crypto, that course, your python experiments) really it, the rest is up to you reading and having patience/persistence.

#

When learning that stuff, you will hear about certain types of math such as Galois fields for example, and probably want to go and learn about those too, you can always look them up, find out about literature about that type of math, etc...

#

I also own and have used the book Serious Cryptography. It's a great book written by an expert but it's more hands-on and less background/theory

worldly stone
#

It really depends what you want to know about cryptography, you don't need to know exactly how it works to use it.

raven frost
#

yes, bestMiguel serious crypto is a better book for that, whereas those other books are for people who want to be cryptographers or just understand the math behind it more

#

I do agree that it's probably not a good idea to take Christof Paar's course unless you really want to learn crypto. If you just want to know a few things about how to use Python lib or something, thats way overkill.

carmine sparrow
#

Anyone good at cryptography in python here?

sinful cliff
carmine sparrow
#

I want to be able to encrypt binary files but I don’t know how to change my code to allow for this to happen. The files that get encrypted from the terminal with the -e flag it turns into an automatic metadata file that includes the salt validator Mac and searchterms but the searchterms should not produce the hashes for binary files

#

This is what I have so far

sinful cliff
# carmine sparrow This is what I have so far

sorry, i don't have the time to go through that amount of code right now
just skimming through it a bit i think ECB mode sticks out like a sore thumb, wouldn't you like to use one of the AEAD modes instead?
and their are better algorithms available today then pbkdf2
also, i still don't understand exactly the problem that you are having and was trying to describe

carmine sparrow
#

I tried to make a function to ensure if the file is in bytes or not like this and then later on i used the function and said if its binary to not do the search terms list when encrypting and when it is not to put inputs inside the search terms

def is_binary(file):
try:
with open(file, 'tr') as check_file:
check_file.read()
return False
except:
return True

#

yeah my ctr mode is also not encrypting big files

#

def one_ctr_block(key, nonce_plus_ctr):
ctx = AES.new(key, mode=AES.MODE_ECB)
return ctx.encrypt(nonce_plus_ctr)

maybe i should change to AES instad

carmine sparrow
#

anyone can help take a look at my cryptography code in python?

thorn obsidian
#

If you don't share it, nobody will

sinful cliff
#

you can't salt it after, salting is a part of the hashing operation, unless of course you hash the password again, but then the result of the first round of hashing that is done on the client side essentially becomes the password from the view of the server side code

sharp marsh
#

s

cerulean sphinx
serene radish
sinful cliff
thorn obsidian
#

Didn't see as it wasn't using code blocks kek
Also can't help or inform anything for the next 3 weeks

sinful cliff
thorn obsidian
#

does anyone here use vmware

thorn obsidian
sinful cliff
thorn obsidian
#

Basically more than one

#

Like Math, Physics, Chemistry, etc.

sinful cliff
thorn obsidian
#

Yeah it's quite painful, thanks a lot :D

#

I always feel like I know nothing before these exams

raven frost
onyx cedar
raven frost
#

@carmine sparrow Why are you using ECB?? Its not super clear from what you stated above. Because "CTR mode isn't encrypting big files?" Also, what do you mean "maybe I should change to AES instead?" This is AES.

#

In that code above that sentence, you are literally using AES already.

#

ANother question - what type of salt are you providing? I see it comes from a file... Is it a constant salt? How is it created? Whats the length etc

#

This is a sorta random nitpick too but, what is the purpose of this:

#
def createmasterkey(password, salt):
    pw = password # <--------
    salt = salt # <------
    key = pbkdf2_hmac('sha256', pw, salt, iterations=250000)
    return key

That just seems like a waste of space with no added value to me.

#

thats all I got time for right now, will check back later

raven frost
austere lodge
#

what are some good books to read to get better at the Linux command like system?

thin peak
raven frost
#

Yeah there’s another no starch one called “the Linux command line” or something like this from same publisher as that one. Maybe look at the TOC of both

#

Basically the command line is nothing more than a bunch of small independent programs that you can work together in a system

#

Those books cover a great handful of them

austere lodge
#

alright thanks guys

thin peak
#

You're welcome!

cedar junco
#

Hello guys

#

Im in the moderate level in python, can i jump to bash script or complete python untill getting pro in it ?

sinful cliff
cedar junco
#

Becoming a professional python programmer in term of security ofc

#

@sinful cliff

sinful cliff
cedar junco
#

nvm

sinful cliff
# cedar junco nvm

if the question is what you can write software in for sec stuff, i would say that you can use any programming or scripting language that you like as with any programming, just that some languages are better suited for different situations

cedar junco
#

Guys i converted a py file to an exe file and the process went good, but the problem is when the program is finishd the cmd disapears immediatly without i can see the output!

raven frost
#

For example if you call the input() function it’ll probably hold the CLI open until you hit enter. Thats what I used to do in my c programs sometimes. But since I run Linux I never have this issue now since the terminal didn’t just close when stuff is done. If you’re on windows you could also try to run the program in powershell.

#

However I just realized that the above isn’t a #cybersecurity matter so maybe try one of the help channels or #python-discussion if you need more assistance @cedar junco

cedar junco
#

Okay, thanks for helping

slate fulcrum
#

any1 know anything abt reversing apks?

#

(not sure if the channel is meant for python side of cybersecurity)

lethal shell
#

the process is very similar

slate fulcrum
#

Yeah, but my problem is handling a bundled apk

#

I pulled the folder from /data/app/ and it contains base.apk and other apks like split_config.apk, I'm not sure how to handle that

#

do I just decompile the base.apk and sign it or do I need to build one apk containing all others and signing that

sinful cliff
# slate fulcrum do I just decompile the base.apk and sign it or do I need to build one apk conta...

your both talking about "revers" apks and "decompiling" stuff and at the same time you are talking about the opposite when you mention package them up to one single file and singing stuff
an apk file can be opened just like a zip file
if you instead want to bundle them up in to one you can use a the google bundletool from the android development kit
but this doesn't sound like it's about#cybersecurity or even python really

slate fulcrum
#

actually I just want to know what kind of http requests the app sends but I did not succeed at using a proxy to find it out so I figured I could decompile the app and inject bytecode to log the request data, so I figured it would go to security

thorn obsidian
#

That indeed does kind of fit to security, but not really to the channel topic

umbral finch
#

if you use asymmetric public-private key encryption, is it possible to deduce the private key if you have the encrypted message and you know the message content

#

nevermind, ofc it isnt. stupid question lol

#

if it were possible then anyone who knew the public key could deduce the private key 🤦

raven frost
umbral finch
#

well by design asymmetric public-private key encryption doesnt allow this, i dont know why i asked this in the first place lol, i could have realised the answer if i gave any ounce of thought

sinful cliff
sinful cliff
dire osprey
#

Is hackthebox academy a good source to learn from?'

thorn obsidian
#

Never used it, so can't say it's good or bad

thin peak
raven frost
#

So interestingly I've been happening upon this common theme of security being an especially difficult area of software development because it is "impossible to thoroughly test" since it relies on an infinite possibilities of things not happening, rathert than a finite list of things happening. I suppose this also depends on one's definition of "security." I feel that as subcomponents of security become more defined, requirements are more easily met.

#

One thing that security defense has as an advantage too is for a vulnerability to be actively damaging, it also must be found and exploited. Of course in the field we assume that this will happen with every vuln but in actuality, it probably won't.

#

Sometimes I wonder if security is actually that bad or if every subdiscipline/group of software developers see all of the hardest parts of whatever they are working on, and inherently claim it to be harder than others, or at least hard. I'm sure there is some name for this type of bias.

raven frost
#

Perhaps what people mean is that “the consequences of bad security can be higher than the consequences of bad other areas of software” which seems more realistic if you’re talking about say a mass data breach. But even still, has anyone actually compared the monetary implications behind that with say they cost of a huge spaghetti codebase over time?

sinful cliff
# raven frost Perhaps what people mean is that “the consequences of bad security can be higher...

depending on your business a breach could mean the company loss their license to operate and hence all of their business in one blow, just like a catastrophic failure in any critical area of compliance
a spaghetti codebase can lead to increased costs and stagnated development of the business and even lost of some of the customers or contracts as a consequence of that stagnation, but i have a hard time seeing that it would have the same ultimate and immediate consequences

raven frost
#

Also note they often have insurance, not saying there isn’t a cost though

#

Former being large company actually loses their license or is shut down etc

sinful cliff
knotty citrus
#

Anyone know what lang they couldve used for this? Its old 2005-2007.

thorn obsidian
#

Analyze the file. A random guess would be Winforms w/ C#

lethal shell
smoky moat
tardy forge
#

I’m gonna be bold here and say probably not python, possibly java but still unlikely, or some language under C, C#, C++, or a windows centralized language

#

It most definitely is not JavaScript, HTML, CSS, Golang, Rust, Bash/Batch/ZSH/Shell, Haskell. I don’t know about Ruby, Visual Basic, Elixir, etc

cedar junco
#

Is there any difference between **Ssh **and Openssh?

smoky moat
#

yes

#

@visual oriole SSH is a networking protocol

#

wrong person

#

@cedar junco

#

OpenSSH is an application level implantation of that protocol

#

so you use OpenSSH to which uses SSH protocol

sinful cliff
final vapor
#

Hello, I am building an application which will make users able to write their own extensions in Python, the problem is some of that code should get executed on client's PC directly, this of course means I need to sandbox the app so that it can't access any of the stuff on the computer.

I know about PyPy sandbox but as I read it's only secure for Python 2, other stuff I read about was using AppArmor, the problem is that I need it to work on Windows and without user having to do anything.

The implementation doesn't need to be written in Python, I can also use C++ or C, but it has to be invokable from a code. Also I need the code being ran to use one lib I wrote. So that it can access the interface of the application it should extend.

I have no idea if it's even possible or if I want too much. I also thought about stuff like using the sys audit hooks but I don't think that would be 100% secure.

Thanks for any answer.

thorn obsidian
#

@solid hinge

solid hinge
#

hi

thorn obsidian
#

@deep rapids

#

Now

solid hinge
#

so what first happened that made you suspect you had a virus @deep rapids ?

thorn obsidian
#

Have any sussy things been happening on your pc?

deep rapids
#

resetting the passwords atm, brb

solid hinge
#

kk

thorn obsidian
#

Alr

#

OK so

#

Lean

solid hinge
#

yeah

thorn obsidian
#

Do you think it's a spear phishing

#

Cause if it is

#

Then it is kinda bad prob

solid hinge
#

indeed i do

thorn obsidian
#

I would take it to law enforcement

solid hinge
#

but i dont have any evidence to back up my claim

thorn obsidian
#

Same

#

I would say they investigate

#

First

#

And try to log the IP

solid hinge
#

indeed

thorn obsidian
#

Check if it's a tor node

#

try typing "wmic startup get caption,command"

#

in cmd

#

Them tor nodes be doing sussy things

solid hinge
#

we need more information though

thorn obsidian
#

or "get-service | foreach-object{ if ($.status -eq "stopped") {write-host -f red $.name $.status}` else{ write-host -f green $.name $_.status}} "

#

for services

solid hinge
#

it could not be a spear phishing

thorn obsidian
#

Thing is

#

Malware might have spread over their pc

#

So resetting passworss

#

Passwords

solid hinge
#

wont work

thorn obsidian
#

Might not be helpful

deep rapids
thorn obsidian
#

Check task manager

#

if its spear phishing they wont take browser creds

#

they enumerate first

#

then log admin creds

solid hinge
#

kk

deep rapids
thorn obsidian
#

Check task manager for powershell or cmd

solid hinge
#

and maybe

solid hinge
#

its a cookie that dosent get deleted

#

invented by some dude in a basement now the NSA uses it

deep rapids
solid hinge
#

check background processes

thorn obsidian
#

Is there anything by the name

#

RemoteDesk.exe?

solid hinge
#

also check your performance

thorn obsidian
#

^

#

Also open cms

#

Cmd

#

Do

#

As adminstrator*

#

And do

#

netstat -b

deep rapids
solid hinge
#

and finally

#

go to startup

#

and see if theres anything sussy in there

past starBOT
#

Hey @thorn obsidian!

You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.

thorn obsidian
#

Check startup

deep rapids
#

clean as well

thorn obsidian
#

What's that txt file

solid hinge
#

use hastebin

#

go to details

thorn obsidian
solid hinge
#

and see if anything is running on a sussy username

thorn obsidian
#

I see

deep rapids
thorn obsidian
#

here it is

#

Check for XXHackerLOLKidXX ig in the usernames

#

Check for any sussy usernames

solid hinge
#

ill send a list of all normal usernames

#

YOUR USER

thorn obsidian
#

Alright

solid hinge
#

SYSTEM

#

LOCAL SERVICE

thorn obsidian
#

And uhh

#

iirc

#

ADMIN

#

And

solid hinge
#

NETWORKING

thorn obsidian
#

PROCESS?

solid hinge
#

i have UMFD

thorn obsidian
#

I remember that being a thing

solid hinge
#

is that sussy?

deep rapids
#

well I assume there's nothing sus going on the laptop, thx!

thorn obsidian
#

nw

solid hinge
#

atleast not for a month or so

thorn obsidian
#

^

solid hinge
#

until you know its clean

thorn obsidian
#

Also

#

I would say use the cloud incase of ransomeare

#

Ransomware

#

Anyways

#

Anything happens ping me

solid hinge
#

same

thorn obsidian
#

Or call law enforcement ig

#

Lol

deep rapids
#

there's very minimal personal info on this laptop, I have a personal one with secured stuff

solid hinge
#

because im prob always here

thorn obsidian
#

I have exams atm so might not be very active

deep rapids
solid hinge
thorn obsidian
solid hinge
#

today i graduated

deep rapids
#

congrats

solid hinge
#

thanks

thorn obsidian
#

Congrats

solid hinge
#

indeed

#

congrats

thorn obsidian
#

congrats

solid hinge
#

🎉

thorn obsidian
#

Alr

torn gazelle
#

Hello, I'm trying to create a secure socket using SSL/TLS. I'm using self-signed certificates but I got this error :

ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1129)

When I generate self-signed certificate with openssl req -x509 ... I don't have this issue. I got this problem when I use self-signed certificates generated with PyOpenSSL.

Does someone know how am I supposed to verify my self-signed certs with load_verify_locations and load_cert_chain ?

Thank you in advance.

sinful cliff
sinful cliff
# torn gazelle Hello, I'm trying to create a secure socket using SSL/TLS. I'm using self-signed...

you won't get any errors such errors when you generate the certificate, it's when the client tries to verify the certificate that problem would appear, just like you are experiencing, it's normal

there are examples of how to use load_verify_location and load_cert_chain at https://docs.python.org/3/library/ssl.html#functions-constants-and-exceptions, example 2 and 3
for path/to/cabundle.pem and /path/to/certchain.pem in those examples you would instead put the your certificate that you just generated
and /path/to/private.key would be the private key that belongs to that certificate

torn gazelle
#

In fact, I just realized that it still works for one of my sockets.

I have re-tested by regenerating self-signed and for one of my three TLS sockets, I can verify the certificates. Now that I understand why I can't do it. I don't understand why it works for one of my sockets...

sinful cliff
torn gazelle
sinful cliff
sinful cliff
torn gazelle
sinful cliff
torn gazelle
# sinful cliff how does the server side and client side code look like for the three sockets?
Working Server-side Socket 2 :
def __init__(self, cert="certs/server-cert.pem", priv="certs/server-priv.pem") -> None: 
        self.context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
        self.context.set_ciphers('ECDHE-RSA-AES256-GCM-SHA384')
        self.context.load_cert_chain(cert, priv)
Not Working Server-side Socket 2 :
      cert_path = f"certs/{self.username}-cert.pem"
      priv_path = f"certs/{self.username}-priv.pem"
      context_recv = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
      context_recv.set_ciphers('ECDHE-RSA-AES256-GCM-SHA384')
      context_recv.load_cert_chain(cert_path, priv_path)
#

Dude, I just found my mistake

sinful cliff
torn gazelle
#

I'm so sorry for the inconvenience

sinful cliff
torn gazelle
#

I made a mistake about the ports, I was connecting twice on the same port. So, the second certificate didn't match with the first one

sinful cliff
torn gazelle
sinful cliff
final carbon
stray crypt
#

I don't think any discord bot library uses the ctx package lol

graceful aurora
graceful aurora
#

I am reviewing this encryption example, does anyone know what the \033[1;32m --- \033[0m is for?

plaintext = b'this is the correct plaintext!'
print(f'plaintext: \033[1;33m{utf8(plaintext)}\033[0m')
encrypted = base64.b64encode(public_key.encrypt(
    plaintext,
    padding.OAEP(
        mgf=padding.MGF1(algorithm=hashes.SHA256()),
        algorithm=hashes.SHA256(),
        label=None
    )
))
print(f'encrypted: \033[1;32m{utf8(encrypted)}\033[0m')

from what I can tell it seems they relate to color code outputs, what is their purpose in an encryption sequence??

thorn obsidian
#

Absolutely nothing

#

Purely design and layout

thorn obsidian
graceful aurora
# thorn obsidian Absolutely nothing

That was my first thought, my second thought was that it was a color wrap encryption that could be used to identify categorical data based on a paired color class object (pre-decrypt).

thorn obsidian
#

Don't really think so, the colors aren't really chosen in a good way. But can be possible

smoky moat
#

ANSI escape sequences are a standard for in-band signaling to control cursor location, color, font styling, and other options on video text terminals and terminal emulators. Certain sequences of bytes, most starting with an ASCII escape character and a bracket character, are embedded into text. The terminal interprets these sequences as command...

thorn obsidian
#

Yeah they know that, see at the bottom of the message

smoky moat
#

Ah I see

lunar ginkgo
#

Hi, im starting Security, what do you guys recommend?

thorn obsidian
#

Process process = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = "nmap.exe";
startInfo.Arguments = "-p " + port + " --script http-sql-injection " + address;

I can run nmap like this using C#, how can I do the same in python?

thorn obsidian
lunar ginkgo
#

Alright

#

Thanks

lethal shell
lunar ginkgo
#

oh, ill definitely try those

#

thanks

#

im already loving Try Hack me

thorn obsidian
#

Hi, does anyone got source for process hollowing / run pe file in memory without any write to the disk for 64 / 32 bit payload ? thx

#

I don't believe that fits the channel's purpose at all. Therefore I don't recommend asking that, and didn't recommend anyone to respond.

sinful cliff
past starBOT
#

5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.

thorn obsidian
sinful cliff
thorn obsidian
ornate prism
#

Hello folks, I am looking for some help with pip install.

sinful cliff
ornate prism
#

Well, such behavior is often exhibited by malicious packages. So, I thought people here might have come across the same issue.

sinful cliff
raven frost
thorn obsidian
#

is there any way I can detect if a specific driver is loaded?

dark socket
#

gonna need way more context. what OS are you on, for one?

thorn obsidian
raven frost
thorn obsidian
#

I would just like to find a way to do it in python

raven frost
#

Yeah it’s less about preference and more about being able to interact with the OS/kernel the way you need to. I know there are also c bindings for Python too though

echo flower
#

why not just query wmi?

thorn obsidian
#

Does vscode track user data and send them to MS?

thorn obsidian
sinful cliff
thorn obsidian
sinful cliff
thorn obsidian
#

The link explains how to disable it..

thorn obsidian
past starBOT
solid mica
#

How do I fix the error in my code? The 3rd & 4th 'we made it' didn't show up

thorn obsidian
#

You won't get any help for a key logger

#

!rule 5

past starBOT
#

5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.

thorn obsidian
#

And you probably don't want to share your Gmail username and password with everyone :)

#

Making a key logger but leaking their own credentials, what a pro move @solid mica

solid mica
#

lol

#

Obviously its just a empty email for testing

#

You proud and think ure smart for that :/

#

Jeez people these days

thorn obsidian
#

Mad bunHappy

thin peak
past starBOT
thorn obsidian
#

I think we should change the channel name

#

to secure-code or Security-Information

#

Not really no

thorn obsidian
#

Lol

raven frost
# thorn obsidian to secure-code or Security-Information

Definitely not to security-information as the information is basically a useless word there. Secure-code makes more sense but still a bit weak imo. Maybe “securing-your-code” which may sound elementary but yeah every few hrs we keep getting hack requests, and other off topic content so i see why you asked.

“Security” is too broad of a term and I can go into detail as to why as a security professional. But I think the creators felt it was implied “Python code security” as it’s in the Python server. However we get a lot of pentesting and other such requests and questions

thorn obsidian
#

@raven frost do you know much about software fingerprinting

#

if so could you explain a bit about what it is and what its used for

thorn obsidian
#

Honestly the Wikipedia article explains it quite good https://en.wikipedia.org/wiki/Fingerprint_(computing)

In computer science, a fingerprinting algorithm is a procedure that maps an arbitrarily large data item (such as a computer file) to a much shorter bit string, its fingerprint, that uniquely identifies the original data for all practical purposes just as human fingerprints uniquely identify people for practical purposes. This fingerprint may be ...

fathom flare
#

Does anyone have a roadmap for a beginner to programming? I’m interested in cyber security.

sinful cliff
fathom flare
sinful cliff
fathom flare
#

Understood, thank you very much for this! Papa bless.

#

Skimmed through as it’s late right now but I’ll give it a thorough read tomorrow - seems like an excellent source.

bronze gust
#

Excuse me, what thing that we must have to learn about cyber security?

carmine merlin
#

I want to make my code store login credentials in a file, securely. I've looked into modules such as cryptography, just curious nonetheless if not the cryptography module, what is the most secure way of storing data in a file and encrypting it, then easily accessing the very same data?

sinful cliff
sinful cliff
# carmine merlin I want to make my code store login credentials in a file, securely. I've looked ...

if this is credentials you are going to use to authenticate with (and not against) this is very hard to do securely without user interaction each time and depends on your requirements, environment and threat model
if you want to encrypt a file you need an encryption key, which in turn must either be input manually each time or be stored somewhere/somehow
if you are just going to authenticate against the data in the file you don't really need to store the credentials in a form that can be decrypted again, this is much easier to do with a salt, an optional pepper and some kind of one-way function such as Argon2id

bronze gust
carmine merlin
sinful cliff
hoary hinge
#

Can I learn cybersecurity with python

sinful cliff
# hoary hinge Can I learn cybersecurity with python

cyber security is a huge subject with many branches and you'll need a firm and broad grasp of many general computer science subjects for a lot of roles
if you want to learn programming as well that will for many technical roles be an advantage
you can use python to create your own tools later on

sinful cliff
inland hazel
#

My PC is getting corrupt every 3 days. I have to reboot it again. Any possible solutions?

raven frost
inland hazel
thorn obsidian
#

You still haven't explained what corrupted means in your case. Lots of things can get corrupted.

thorn obsidian
#

Yet again, a BSoD can be the cause of many things, you might want to share the error code you get.

inland hazel
thorn obsidian
#

In my situation I wiped the whole hard drive

raven frost
#

What happens if you don't rely on the battery? If the computer is plugged into the wall, does this stuff occur or only when on battery power?

#

I don't know what you mean when you say "I checked the battery, it's gone and after 3 days". Does this mean that the battery has no charge, and after 3 days the computer crashes? Or are you saying the battery is physically not installed? Or are you saying that the battery dies after 3 days, but is physically installed properly?

#

^ These are all details that one needs to know to troubleshoot these type of issues. There is no way to help when we don't understand what is going on. Furthermore, I'm afraid this isn't the correct channel, because this is actually an IT support issue, but I wanted to give you something because actually the thought processes behind solving this issue is similar to debugging code. "help, my program isn't working" is not enough detail to debug a program either.

inland hazel
inland hazel
thorn obsidian
#

Use SFC software @inland hazel

inland hazel
# raven frost I don't know what you mean when you say "I checked the battery, it's gone and af...

A week back,The computer said that it can't identify the battery. And asked us to press F1 on the keyboard. I thought it was battery problem or something. So I continue to you use it on power. And the battery symbol on the taskbar, it changed to "0%, charging".

I continued to use it thinking it was a small problem and then after 3 days, (used laptop 5 times in that span), the PC took forever to open. And suddenly it restarted. This time, it came up with a message that it's diagnosing my PC.

Yeah I thought it was doing something, and continued for 10 minutes. After that it showed us recovery options, I tried all of them but no luck. Even tried using the system restore.

This time, things went smoothly but after 5 minutes of turning on the laptop, it just automatically restarted. So the same problem came back again, diagnosing... Recovery options...

This time I booted my PC with windows 10 and yeah it worked. But not for so long, just lasted for about 5 restarts. So the next thing I did was I booted it again. It again lasted for another 5 restarts, and now we got blue screen of death. I don't know what to do now... Should I just keep on booting everytime it crashes or is there anything I can do something about it?

inland hazel
#

I'll try it out and tell you how it goes

thorn obsidian
#

2 questions how old is your computer and what os?

inland hazel
inland hazel
thorn obsidian
#

I see old computer has trouble to run Windows 10

inland hazel
thorn obsidian
#

My laptop is very old that u can’t even play Minecraft on it (smoothly)

inland hazel
thorn obsidian
#

I suggest u to format ur disk and install win7

#

or Linux will be better

raven frost
#

@inland hazel have you completely re-installed the operating system?

inland hazel
#

The battery was changed 5 years ago, due to similar issues but back then, but it never crashed or corrupted

inland hazel
raven frost
#

try to get a new battery, take the laptop to repair shop, or just get a new one. You can get laptops better than that one for VERY CHEAP now

thorn obsidian
raven frost
#

thats what I would do having those issues

inland hazel
thorn obsidian
#

U r pc is very old to handle win10

inland hazel
#

Thank you so much @thorn obsidian @raven frost

inland hazel
thorn obsidian
#

Ur pc is old ...

inland hazel
#

I'll try win 7

thorn obsidian
#

To run win10

inland hazel
#

Oh yes, but it was running smoothly for 4 years

raven frost
#

Generally speaking, 9+ years is getting "too old" for PCs. This isnt really 100% true, but at your skill level it is lol

#

like if I knew you and we lived close, I would come over and try to salvage it, or I would show you how to put Linux on it to make it super fast

#

but I dont

thorn obsidian
#

@inland hazel I had some issues like u so that’s my suggestion

#

And battery has nothing to do with file corruption

raven frost
inland hazel
raven frost
#

I had file corruption due to power loss 2 years ago on Ubuntu

thorn obsidian
#

Battery just gives power to run

inland hazel
#

Really means a lot for taking your time and helping me. I'll let you know how it goes.