#cybersecurity

7 messages · Page 32 of 1

fading plaza
#

or just modify the code

#

to print the values

#

also

#

you shouldnt be handling stuff that the user isn't supposed to access on the client side

#

that should be done server side

thorn obsidian
#

how can i have csrf protection for my site i made in flask?

#

The form is submitted through post request

thorn obsidian
#

🥺 😢 😭

last ivy
#

Don't post lmgtfy links on this server. If you don't have anything to reply, don't reply anything.

spice ocean
#

how about telling people to ask properly

#

but sure will stop posting the right anwsers with a little fun included

rose plover
#

Wait so if I dont want to reply to someone's question I dont have to answer them hmm interesting.......... 🤔

thorn obsidian
thorn obsidian
thorn obsidian
#

No problem :)

sonic drum
#

Can anyone guide me on the way to create a secure E2EE socket communication thing?

#

I wanna use the best SSL library

umbral finch
#

From what I gather sha-1 requires a key but if I look up online sha 1 hash gen, it’s converts my plaintext to hash without a key?

#

Is it using a default key or what?

lapis radish
#

sha1(message) -> digest

fluid verge
#

No cryptographic hash function I know that is not explicitly used for a HMAC has a key

steel ridge
#

interesting

thorn obsidian
umbral finch
#

Is it true that there’s 16^32 md5 hashes? Since there’s 16 options for each character and 32 characters?

past pulsar
#

2 ^ 128 if i am not wrong

#

cause the digest size is 128 bit

woven gazelle
#

that's the same number :)

past pulsar
#

yup

hard frost
#

is there any good videos for learning python within a cyber security spectrum like automation scripting
Ik the fundmentals
and youtubers or udemy courses you guys suggest would be nice

thorn obsidian
#

so im kinda new to py and i want to make something like an encryption key type thing where i can set 'a' to = 1 or something so when i type 'apples are great' it will be '1pples 1re gre1t'

plush nova
#

ah

#

okay

#

read the docs xD

fading plaza
#

!d str.translate

past starBOT
#
str.translate(table)```
Return a copy of the string in which each character has been mapped through the given translation table. The table must be an object that implements indexing via [`__getitem__()`](../reference/datamodel.html#object.__getitem__ "object.__getitem__"), typically a [mapping](../glossary.html#term-mapping) or [sequence](../glossary.html#term-sequence). When indexed by a Unicode ordinal (an integer), the table object can do any of the following: return a Unicode ordinal or a string, to map the character to one or more other characters; return `None`, to delete the character from the return string; or raise a [`LookupError`](exceptions.html#LookupError "LookupError") exception, to map the character to itself.

You can use [`str.maketrans()`](#str.maketrans "str.maketrans") to create a translation map from character-to-character mappings in different formats.... [read more](https://docs.python.org/3/library/stdtypes.html#str.translate)
fading plaza
#

note that this scheme is completly unsecure

#

and barely even qualifies as "encryption"

thick yoke
#

does anyone know why kali linux in virtualbox is not working?

lapis radish
eager haven
#

it is because

#

you have hypervisor

#

enabled

#

you can try turn it off

#

you can turn it off

#

in windows

#

features

#

uncheck it

#

and press ok

#

and then after it is finished you can try

#

virtual box

#

it can even be enabled in your bios

#

i think

#

when i tried

#

getting it

#

i had the problem

#

when i accidentally

#

click the wrong thing

wicked raven
#

Hi, I am looking for a way to fetch Windows AD user rights like CreateChild, GenericAll, etc. Any library available in python for doing that

vale rose
#

Hi, I have a very basic doubt, I am trying to host an application on the Uni servers but it shouldn't be limited to intranet. The application downloads daily data from an external third party host. Earlier I was trying to whitelist their IPs and allowed their requests but now they added loadbalancers and switched to dynamic IP so can't maintain the whitelist. What would be the best way to open a secure connection for this ?? PS : I don't know much about certificates so resources will be very helpful. TIA

woven gazelle
#

why do you have to whitelist

#

is this a case of asking your network administrators to allow the IP

vale rose
#

so they mentioned to create a whitelist of IPs, but now it seems difficult

woven gazelle
#

hmm yeah

#

maybe set up an external server with a fixed ip

#

outside the itnranet

#

whitelist its ip, then when it receives a request it forwards it to the third party host

vale rose
woven gazelle
#

yeah, what i said is set up your own server

#

whitelist its ip

#

then the external server makes the request to the third party

vale rose
#

oh so something like vpn

woven gazelle
#

well not really

vale rose
#

but that server that i set up is not secured

woven gazelle
#

if you whitelist a vpn then anyone can access anything

#

i would suggest a VPS

vale rose
#

okay so please mention if I am wrong somewhere, we set up extenal to intranet server, make request to third party get data and have an app to upload data to intranet since this IP will be static

#

so allowing all the ports on this external server

#

I don't want anyone else to access that data, guess in this approach anyone can interfere the external server

#

And one quick question as well if someone know the whitelist then can they do ddos attack using ip spoofing ?

woven gazelle
#

well the external server would only allow requests to be forwarded to a specific service

#

and you'd give it whatever api token you want it to use

thick yoke
thorn obsidian
#

im looking for best way to run arbritrary python code submitted by a user securely, i feel the best way would be to use docker, however im having a hard time figuring out how to start new docker containers when a script is submitted, any resources that might be useful? thanks in advanced

vale rose
#

if this is a one time job

thorn obsidian
void aspen
#

Hey, that’s our project :D

thorn obsidian
tender hatch
#

I have never used python security

#

but ill try

#

Which system software can we use for Django? For Security like login etc..

fallen vine
fallen vine
#

🙂

fading basalt
#

Hey so I made a port scanner and I'd like to run it, but I don't believe I know enough about infosec to run this. What are some things I should do before running it??

fading plaza
#

dont run it on anything unless you have permission

#

first test on yourself

thorn obsidian
#

@fading basalt I was just about to talk about a port scanner

#

My port scanner has a flaw in it though and Im confused

#
from socket import *
import sys, time
from datetime import datetime


host = ''
max_port = 5000
min_port = 1

def scan_host(host,port, r_code = 1):
    try:
        s = socket(AF_INET, SOCK_STREAM)
        
        code = s.connect_ex((host, port))
        
        if code == 0:
            r_code = code
        s.close()
    except Exception, e:
        pass
    
    return r_code

try:
    host = raw_input("[*] Enter Target Host Adress: ")
except KeyboardInterrupt:
    print("\n\n[*] User Requested An Intterupt.')
    print("[*] Application Shutting Down.")
    sys.exit(1)
    
hostip = gethostbyname(host)
print("\n[*] Host: %s IP: %s" % (host, hostip))
print("[*] Scanning Started At %s...\n" % (time.strftime("%H:%M:%S")))
start_time = datetime.now()

for port in range(min_port, max_port):
    try:
        response = scan_host(host, port)
        
        if response == 0:
            print("[*] Port %d: Open" % (port))
    except Exception, e:
        pass
    
stop time = datetime.now()
total_time_duration = stop_time - start_time
print("\n[*] Scanning Finished At %s ..." % (time.strftime("%H:%M:%S")))
print("[*] Scanning Duration: %s ..." % (total_time_duration))
print("[*] Everything is good here! ...")
#

Here is th error:

#
  File "C:\Users\pchaf\Downloads\New folder\Security\portscanner.py", line 19
    except Exception, e:
                    ^
SyntaxError: invalid syntax```
tulip holly
#

Check for inconsistent quotation marks

#

User requested an interrupt'

#

The problem is there

vivid frost
#

is bcrypt good?

#

or should I be using any other hashing algo

fading plaza
#

that's py2 except syntax

#

py3 syntax is what penoqo posted

#

I hear that argon2 is a better choice for hashing these days

lapis radish
vivid frost
#

was just making a simple login system and wanted to store hashed passwords

lapis radish
#

Argon2 should be enough like @fading plaza said

#

In Argon2 specs you have recommended parameters for authentication system

#

You can use them

vivid frost
#

argon2 okay

#

thx for the suggestion appreciate it

lapis radish
#

Your welcome!

vivid frost
#

is it pip install argon2-cffi or pip install argon2?

#

nvm figured it out

fading basalt
fading basalt
fading plaza
#

@thorn obsidian i just took a closer look at your code

#

you're trying to run python2 code

#

using python3

#

dont use py2

#

or rather

thorn obsidian
#

Already fixed it

#

Someone helped me already.

#

Me and a friend made it a while back

umbral finch
#

windows stops you accessing some files due to security reasons but if you boot lets say linux from a USB drive, surely its a security risk since you can do whatever?

woven gazelle
#

Well yeah you can always just take the hard drive out and look at the files

#

Windows does support bitlocker which encrypts your hard drive

umbral finch
#

so if (and this is just theory) i code/find a distro that i put on a usb that dumps the windows SAM and SYSTEM files from windows then i could extract passwords

lapis radish
umbral finch
lapis radish
#

Any

#

You can run different OS from USB/CD, you can attach hard drive to different machine

#

As far as disk is not encrypted you can read and manipulate data

umbral finch
#

damn, theres a cyber security project i wouldnt mind starting:
a USB that extracts windows hashes
i mean... urr... totally not doing that... educational purposes and whatnot

woven gazelle
#

Well they will be hashes of the password

#

And at that point you're probably better off just copying all the files off then

umbral finch
#

I mean I’ve used hashcat to crack my friend NTLM passwords (that they gave me for my project) but surely passwords even in the form of hashes would be more beneficial since many people use the same password everywhere

Also if you have a USB, storing all their files might not be an option due to size restrictions and sending them over the victims connection might alert the victim

woven gazelle
#

sounds sensible to me

umbral finch
#

can anyone explain to me how PwdumpX works

#

in detail?

thorn obsidian
#

I made a sample ddoser to use on my router and its not really working

#
import socket

target = input("Enter your router ip: ")

for i in range(1,100):
    s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
    s.connect((target,80))
    data = b"GET / HTTP 1.1\r\n"*1000
    s.send(data)
    s.close()
#

But when I put the ip in

#

s.connect((target,80)) socket.gaierror: [Errno 11001] getaddrinfo failed

woven gazelle
#

what did you put as the ip

thorn obsidian
#

my ip adress

woven gazelle
#

local or remote

#

like is it 192.168.1.x or something else

thorn obsidian
#

yeah my IPv4

#

wait nevermind

#

I used the wrong one before XD

#

I thought I used my ipv4

woven gazelle
#

ah right does it work now

#

and just a heads up i'm only helping because this is a very impractical way of DOSing

#

and you've said it's only for using on your router

#

it's against the rules to ask for help with things that break the law

#

so

#

experimenting is good but

#

ya know

#

be careful

#

also in some countries developing hacking tools is illegal

thorn obsidian
#

Yeah this is a bad script for ddosing anything other then my own router

#

And I dont intend to use it for anything other then that. Thank you for your help

thorny tide
#

what doi do if someone token logged my discord

quasi steppe
#

I think changing your password resets your account token if that was your question

#

dont see how this is related to python but ok

thorn obsidian
#

So im making a ddos for my own website/router (not for unethical use) and I thought it would be nice to implement it into a GUI. This is not working when I use it ```py
import PySimpleGUI as sg
import socket

sg.theme('DarkAmber') # Add a touch of color

All the stuff inside your window.

layout = [ [sg.Text('A DDOS tool to use on your own website and or router.')],
[sg.Text('Enter IP'), sg.InputText()],
[sg.Button('Attack'), sg.Button('Cancel')] ]

Create the Window

window = sg.Window('DDOS For Personal Use.', layout)

Event Loop to process "events" and get the "values" of the inputs

while True:
event, values = window.read()
if event == sg.WIN_CLOSED or event == 'Cancel': # if user closes window or clicks cancel
break

window.close()

for i in range(1,100):
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
s.connect((values[0],80))
data = b"GET / HTTP 1.1\r\n"*100000
s.send(data)
s.close()

When I click the attack button it doesnt seem to do anything. If I X out of it after It gives me this traceback:Traceback (most recent call last):
File "C:\Users\pchaf\Downloads\Python Scripts\Cyber Security\DDOS_GUI.py", line 22, in <module>
s.connect((values[0],80))
TypeError: 'NoneType' object is not subscriptable```

thorn obsidian
#

Can anyone help me fix the error?

inland yoke
#

Hello, my friend got infected with IGDM Ransomware, all he files are encrypted.. can anyone help ??

#

Just some suggestions

long hemlock
#

Hey guys, If i set a passphrase with rsa_keygen, how secure is it if i loose my privatekey?

#

In theory they shouldn't be able to do anything without the passphrase, right?

wicked raven
#

Hi, Is there a library to convert nTSecurityDescriptor object from ldap to a more human readable format?

lusty flare
#

no.

#

is the short answer.

#

passworded keys are the right thing to just in the event they're lost, yes

#

sometimes common ransomwares do have freely available decrypt software made available by security researchers

#

but don't just download and install stuff, you could end up making it worse

#

"oh no i have malware i better google how to get malware removed oh i guess i'll just download this program off this shady looking page."

woven gazelle
#

Isn't that the first step in the pydis incident response plan 🤔

lusty flare
#

oh i thought it was this

#

¬_¬

astral briar
#

I need some help with RSA encryption, anyone who can?

fluid verge
#

what do you want help with?

astral briar
#

I can't understand how to calculate "d" the last component for the private key

#

everything else makes sense, but the damn "d" lmao

fluid verge
#

right, do you understand the use of d, at least?

astral briar
#

Yeah

#

I understand everything, just can't caculate it, everytime I try I get a failed result

#

I would like to narrow it down to d = "equation" but it doesn't seem to be that simple

fluid verge
#

okay, so, when you have c^d mod n, what you actually compute is c^{d mod \phi(n)} mod n

#

where \phi(n) is Euler's totient function (the number of numbers less than n that are coprime with n)

astral briar
#

Why mod phi(n) all of a sudden

#

shouldn't m = c^d mod n

#

Not with a phi(n)

fluid verge
#

It is

#

But the problem is finding d such that for any m, m^{ed} mod n = m

astral briar
#

oh

#

How do i find that d then?

fluid verge
#

which means that you need to find d such that m^{ed mod \phi(n)} mod n = m

#

thus, d is the modular inverse of e mod \phi(n)

astral briar
#

Can you join me in off topic vc?

#

Wait i can't speak apparently

fluid verge
#

I don't really like voice chats :/

#

also, I'm probably not allowed to speak as well, so...

astral briar
#

Yeah I found out

#

Can you do an example, with like p=5 q=7 maybe, cause I'm still having a hard time understanding exactly how I find "d", once I understand I'm golden, but till then it ain't that fun lmao

fluid verge
#

ok, now I am, but back to the point.
Once you know that for every coprime integers m and n, \phi(m * n) = \phi(m) * \phi(n), and that for every prime p, \phi(p) = p - 1, I think you can understand what you need to do to find d

#

coprime meaning they don't share a factor other than 1

astral briar
#

m is the message you want encrypted right?

fluid verge
#

In the last message, m and n are any integers greater than or equal to 1

astral briar
#

I think I understand, I'll try working on that

#

RSA encryption is easy, but "d" sucks till you get it

#

then it's fun

fluid verge
#

RSA relies on quite elementary, but non-trivial number theory

eager steppe
#

how to setup tails with whonix

hexed jungle
#

what's is the purpose of tails on whonix

lusty flare
#

uhhhh

#

i mean don't both whonix and tails have their own branded browsers?

#

i mean they both utilise tor so i can't see there being a vast difference

#

interesting round up with references

#

although whonix may be tooting their own horn a little

tacit turret
#

hi, I would like to start with security in python but I am not sure what to learn or where. Any recommendation?

winged crest
#

security as in cyber security?

tacit turret
#

yes

lapis radish
past starBOT
#

6. No spamming or unapproved advertising, including requests for paid work. Open-source projects can be shared with others in #python-general and code reviews can be asked for in a help channel.

honest otter
#

@tacit turret There is a lot you can do in cyber security.(I have been doing it for about a year now) There is Reverse engineering, Cryptography, mobile security, wireless hacking, Social engineering, Forensics, hardware-hacking and much more. It depends on what your passionate with.

winged crest
umbral finch
#

oof

thorn obsidian
#

why i cant install stmplib in python using pip

#

pls dm anyone know it

leaden crater
#

Quick Security question
When doing a application. And you need to sign in
Obviously the "keep me signed in button" works with cookies on websites.
With an App instead of using a cookie could you use a "random" (using os.urandom or secrets.random of course) to generate a code. That you send the client. And they can just send that to the server each time they connect instead of needing to login every single time? (unless stated of course)

thorn obsidian
#

@leaden crater

#

clarify "With an App instead of using a cookie could you use a "random" (using os.urandom or secrets.random of course) to generate a code"

leaden crater
#

So with a cookie. It obviously has a token inside it? That your browser sends to the server

Could you do something similar with an app sending the token to a server? Just not a cookie. 🤔

thorn obsidian
#

with an app

#

you want an app to communicate with the server

#

a python program?

#

so not a browser?

woven gazelle
#

which is pretty clever but since it's already a thing unfortunately you get to read a load of best practices rather than share your invention with the world

leaden crater
leaden crater
thorn obsidian
#

@leaden crater sorry i was away

#

browsers use Cookies as an alternative to variables

#

its just how they store information about sessions

#

browsers are "limited" in a way

#

so if you want to use a python application instead of a browser then you can definitely do so without cookies

#

since python has more freedom

woven gazelle
#

but cookies are also sent when a page is visited

#

to the webserver

thorn obsidian
#

thats correct

woven gazelle
#

you type insanely quickly btw

thorn obsidian
#

@leaden crater you can just store the the data about session in regular python variables and then pass them via GET parameters

#

while browsing the web

leaden crater
#

Yeah

#

The "app" as such connects to a socket server its a chat app but (communicates over SSL dw) 🤔 But I am glad this is easy to do

thorn obsidian
#

Cookies are also easy to use

#

are you just afraid of them?

#

@leaden crater

#

i might have misunderstood you

leaden crater
thorn obsidian
#

does the server belong to you?

#

the one you are connecting to

leaden crater
#

Oh yeah yeah

#

I have total control over the script for the sockets and the machine

thorn obsidian
#

well then you should be good to go if you control the both ends

#

you can make the server retrieve the session data either from cookies or GET parameters

leaden crater
#

Ahhh good good

thorn obsidian
#

and then send those from a client

#

i thought for a second you didn't have access to the server, in which case you would have to follow the rules set by that server

#

and either place the data in Cookie part

#

or GET parameters

#

as server instructs

thorn obsidian
leaden crater
#

Because its a socket server not web server 🤣

#

Sorry for being a little crpytic I wasn't quite sure what information you needed

thorn obsidian
#

thought it was a web server

#

even wrote examples with requests

#
import requests

cookies = {
  "sessionid": 123
   }
r = requests.get("https://www.google.com", cookies=cookies)
import requests
r = requests.get("https://www.google.com?sessionid=123")
leaden crater
thorn obsidian
#

could pass that value of sessionid either way

#

@leaden crater if its not a web server

#

why even ask a question about cookie

#

just curious

#

cookie is solely a web thing

leaden crater
#

It was an example.
The "cookie" inside it has a login token?
That login token I was wondering if it is a randomally generated and then if that would be something I could use in my app
So the app sends the token instead of asking the user to login every single time...

#

I was special I structured my question poorly.

thorn obsidian
#

@leaden crater cookies can contain absolutely any data not just login token, and they are created by the web server and sent to the clients

#

and when clients receive them, they are stored on their machines, and then sent out with every request to the server

leaden crater
#

👍 Thank you for clearing it up for me @thorn obsidian

thorn obsidian
#

np

#

@leaden crater just as a last note, i would suggest sending data from a client to a server in a json format

leaden crater
#

Oooh. Thank you

thorn obsidian
#
import PySimpleGUI as sg
import socket
#For PERSONAL ROUTER AND WEBSITE USE ONLY.
sg.theme('DarkAmber')   # Add a touch of color
# All the stuff inside your window.
layout = [  [sg.Text('Simple Python DDOS Attack tool for your own website/router.')],
            [sg.Text('Enter IP'), sg.InputText()],
            [sg.Button('Attack'), sg.Button('Cancel')] ]

# Create the Window
window = sg.Window('DDOS Python.', layout)
# Event Loop to process "events" and get the "values" of the inputs
while True:
    event, values = window.read()
    if event == sg.WIN_CLOSED or event == 'Cancel': # if user closes window or clicks cancel
        break

window.close()

for i in range(1,100):
    s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
    s.connect((values[0],80))
    data = b"GET / HTTP 1.1\r\n"*1000
    s.send(data)
    s.close()
    ``` Ill send the error message
#
  File "C:\Users\pchaf\Downloads\Python Scripts\Cyber Security\DDOS_GUI.py", line 22, in <module>
    s.connect((values[0],80))
TypeError: 'NoneType' object is not subscriptable
> ```
lapis radish
fading plaza
#

!rule 5

past starBOT
#

5. Do not provide or request help on projects that may break laws, breach terms of services, be considered malicious or inappropriate. Do not help with ongoing exams. Do not provide or request solutions for graded assignments, although general guidance is okay.

fading plaza
#

@thorn obsidian

#

also thats not even a ddos

thorn obsidian
#

It is not illegal since I was given permission, by myself...

#

I know it's more of a DoS then ddos

fading plaza
#

well, we can't confirm that

#

plus "be considered malicious"

hard frost
#

does python verison 3.9 come pip pre installed

#

I am having issues running it

wicked raven
#

try py -3.9 -m pip install --upgrade pip

thorn obsidian
#

hello, im member of a group where we try to help people finding their cybersecurity path for free. If you are interested tell me to post more information. Thanks!

thorn obsidian
#

Guys, can u help me

#

Im tryin to make a port scanner

#

As u guys can see, its giving me error

#

NameError: target not defined

void aspen
#

Hey, we won’t help you with a port scanner is this is usually used for malicious intends, sorry

thorn obsidian
#

Ah ok then

#

Ill delete message @void aspen

void aspen
#

Thank you 👍

thorn obsidian
#

Np

undone carbon
#

I recently used a piece of code that detected if a port is in use so it would open the socket on another port @void aspen. I needed that in case I open my program multiple times it still needs to work, didn't know you can use this in a malicious way

thorn obsidian
#

socket.connect_ex()

void aspen
#

Yeah, it is usually used to see the opened ports on a target machines, for finding backdoors

thorn obsidian
#

@void aspen u saw my code?

void aspen
#

Yes

thorn obsidian
#

Off topic, sorry

thorn obsidian
thorn obsidian
#

Can u guys help me, im making proxy chain

#

If is that legal on server

#

oh sorry

#

If is that legal

#

Can someone help me

#

I have proxys, and i need just to make chain

woven gazelle
#

why

rose plover
#

yeah it's legal why?

sonic drum
#

My program takes in an email and password and then stores them in a database. The password is hashed in argon2 and the email is stored in plaintext, is that okay?

#

email@email.com $argon2i$v=19$m=102400,t=2,p=8$PeEEYPsgpSfTKngWQROfXw$tvdrXxUbqvKcY2v9+i8qkgthis is how it looks like

#

but imagine having more rows

mortal perch
#

that looks ok to me - i havent checked whether the argon2 parameters are suitable though

halcyon path
#

Anyone here that wants to try and crack my encryption?

woven gazelle
#

is it competently implemented

sonic drum
#

wait so I need more information

#

that looks ok to me - i havent checked whether the argon2 parameters are suitable though
do I not include them?

fading plaza
#

@halcyon path can you post it?

#

also keep in mind that "rolling your own crypto" should only be done for educational purposes and never be used in production

pulsar jacinth
#

I've got a theory that might not be plausible but I'll still ask if it is possible. It's in password cracking. Let's say I know the length of a password ie 12 digits long and only contains mixed alphanumeric characters and the algorithm used to encrypt the password, is it possible for one to find some sort of relation between the algorithm used and the password and use some sort of binary search algorithm attack where one can know on what end of the list(of a sorted list of all possible password combinations) of passwords is the password😅 cause if you consider the time complexity of Binary Search is O(logn) ? Thus if this can be done the password could be cracked in log(12^62)...... I might just be cooking up my own things, what do you think?

fading plaza
#

nope

#

any good hashing/encryption alg has no correlation whatsoever between plaintext and hash/ciphertext

#

so binary search won't work

#

In cryptography, the avalanche effect is the desirable property of cryptographic algorithms, typically block ciphers and cryptographic hash functions, wherein if an input is changed slightly (for example, flipping a single bit), the output changes significantly (e.g., half the output bits flip). In the case of high-quality block ciphers, such a ...

thorn obsidian
halcyon path
#

No it's not lmao

#

I made it myself without modules

thorn obsidian
#

Ez decode

#

🤣

dense walrus
#

can someone help me i always get incorrect padding this is the code ```python
def aes_ecb_dec(key, enc_msg):
cipher = AES.new(key, AES.MODE_ECB)
ct = cipher.decrypt(enc_msg)
return unpad(ct, AES.block_size, style='pkcs7')

dense walrus
#

pycryptodome

#
from Crypto.Cipher import AES
from binascii import hexlify, unhexlify
import base64
from pwn import xor
from Crypto.Util.number import long_to_bytes
from Crypto.Util.Padding import pad, unpad
from Crypto.Random import get_random_bytes
``` all the imports
#

enc func works though

lapis radish
#

Can you show me your aes_ecb_enc?

dense walrus
#
def aes_ecb_enc(key, msg):
    msg = pad(msg, AES.block_size, style='pkcs7')
    cipher = AES.new(key, AES.MODE_ECB)
    ct = cipher.encrypt(msg)
    return hexlify(ct)
lapis radish
#

You need to use unhexlify before decrypt

mortal perch
dense walrus
#

@lapis radish binascii.Error: Non-hexadecimal digit found

lapis radish
dense walrus
#
def aes_cbc_enc(iv, key, msg):
    enc_msg = b""
    
    for i in range(0, len(msg), 16):
        if i == 0:
            xor_text = xor(msg[i:i+16], iv)
            enc_msg += unhexlify(aes_ecb_enc(xor_text, key))
        else:
            xor_text = xor(enc_msg[i-16:i], msg[i:i+16])
            enc_msg += unhexlify(aes_ecb_enc(xor_text, key))
        
    return enc_msg
sonic drum
#

But it is still secure right??

mortal perch
#

im not a cryptographer, so im not the person to ask. but according to my limited knowledge, the id variant is preferred for better security. maybe read the wikipedia page

#

also, read the docs for the specific module you are using

#

in this case, it's point #1

sonic drum
#

ah okay

sacred furnace
#

pycryptodome

silver fable
#

help pls lol

#

def hasNumbers(inputString):
return any(char.isdigit() for char in inputString)

username = input("Create your username: ")

if len(username) < 5:
print("Your name must be more than 4 characters. Please try again.")
if len(username) > 15:
print("Your name must be less than 15 characters. Please try again.")

password = input("Create your password: ")

if len(password) < 7:
print("Your password must exceed 6 letters. Try again.")
if len(password) > 30:
print("Your password must be less than 30 letters. Try again.")
if not hasNumbers(password):
print("You must include a number in your password.")

#

trying to figure out how to resend
password = input("Create your password")

if i do not fit any of the criteria
if len(password) < 7:
print("Your password must exceed 6 letters. Try again.")
if len(password) > 30:
print("Your password must be less than 30 letters. Try again.")
if not hasNumbers(password):
print("You must include a number in your password.")

woven gazelle
#

put it in a while loop

#

while username_insufficient:

#

or something

#

then change to

#
username = input("Create your username: ")

if len(username) < 5:
    print("Your name must be more than 4 characters. Please try again.")
elif len(username) > 15:
    print("Your name must be less than 15 characters. Please try again.")
else:
    username_insufficient = False
thorn obsidian
#

Bruhhhhh

robust glade
vital lintel
#

Can someone help with this

#

It is showing error while downloading kali linux

fading plaza
#

where are you downloading from

#

and what are you running

vital lintel
#

From the kalilinux site

fading plaza
#

uhhh

#

link?

#

because i've never had to run any "*aszip.exe"

#

no like

#

which one are you downloading

vital lintel
#

64 bit

#

Installer

#

Anyone??

#

Hey anyone up

cursive furnace
#

im pretty sure thats not the installer; the real installer would be an iso image

#

@vital lintel

viral jetty
#

Hey guys quick question.
I am creating a game called "Astroids" it's a basic simple game.
The reason I am creating it is so I can use it as evidence to get in univirstity to stud computer science and Graphics design.

The question is this?
Can I combine python with other codes such as C++ or C#.
My game I created is written in C++ I think, cannot rember now lol.
But the task I needed it to do I can't do with c++ but I can do in python.

So is their away that python can be used along side c++

I tried using LUA and java however they are still unable of the task lol. Simple because I think it's the software I use.

#

Please ping me when u respond.

Thanks Guys 😁😁

#

If not going I would have to re write my whole game in LUA and Java as these can be combined lmao.

thorn obsidian
#

Im pretty sure u can combine them @viral jetty

#
vital lintel
cursive furnace
#

iso folder?

viral jetty
#

Thank you soo much.
Have a nice Christmas guys.

cursive furnace
#

im pretty sure its a single file usually

#

@vital lintel

vital lintel
#

Yes the iso file sorry

cursive furnace
#

can u send the download link you used?

vital lintel
cursive furnace
#

ok...

#

so the link is good

vital lintel
#

Yes but why is that error coming

cursive furnace
#

ok so

#

if you look up aszip.exe

#

it says its a self extracting zip program

#

@vital lintel

#

btw

#

which specifc one did u use?

vital lintel
#

@cursive furnace come in dm

cursive furnace
#

64 bit installer?

iron wadi
#

I recently got into doing CTFs. I have a background in Python web applications. The one I did was really simple and fun. Other people -- all pretty new -- were trying to figure out the basics of Django. and I was just like, "They published this site in debug mode lol"

#

It was obviously targeted at newbs but it was fun

gaunt pike
#

Hey guys wssup

#

Quick question.
I was reverse engineering a site to get access to data endpoints but I came across firebase credentials with the db paths hardcoded on the client side js. A lot of people told me that this is not really a vulnerability since firebase connects on the client side with exposed credentials and stuff and I was not going to get external access to the db anyways, but the problem is that I did get access to their db and even came across further keys stored in firebase. So my question is that should I report this vulnerability to the company or not?

oak breach
#

yeah

#

they should pay you to

#

thats a huuuuuuuge vulnerability

#

huge

#

if its a website you need to login to that is still a big vuln

mortal perch
#

they should pay you

#

they also might sue you

#

so uh

#

be careful

#

im not gonna offer legal advice but yeah i'd definitely make yourself very aware of how they might react before reporting things

thorn obsidian
#

Guys, im doin requests rn with proxies, and it sayin, Errno 110 connection refused, is that bcs of proxy or?

spring phoenix
tropic bluff
thorn obsidian
#

Its just bcs proxy got blocked

#

Nothing spec

astral briar
#

I have a question regarding rsa encryption

#

I found this to calculate d, works perfectly, but i don't know why it works, like how, what is it

lapis radish
#

@astral briar e is just an inversion of d in some finite field so all what you need to break RSA is to find φ(n) where φ is an Euler function

#

As far as you know n = p * q where p and q are primes so φ(n) = (p - 1) * (q - 1)

astral briar
#

I understand that and all, I just need the d = (φ(n)*i+1)/e explained. @lapis radish

lapis radish
#

If a - b is divisible by n so there is integer i that a - b = i * n

#

You can change this equation a = i * n + b where a = ed, n = φ(n) and b = 1 so you got ed = i * φ(n) + 1 and later d = (i * φ(n) + 1) / e)

#

You can read about congruences here: https://en.wikipedia.org/wiki/Congruence_relation

In abstract algebra, a congruence relation (or simply congruence) is an equivalence relation on an algebraic structure (such as a group, ring, or vector space) that is compatible with the structure in the sense that algebraic operations done with equivalent elements will yield equivalent elements. Every congruence relation has a corresponding q...

#

Hope everything is clear now

umbral finch
#

I understand the practice of storing a hash instead of the actual password for a login system however if the attacker gets hold of my database (which is stored an disk along with the login application) then while they can’t know the password, what’s stopping them simply replace my password hash with their own so they can enter their own password and login?

iron wadi
#

Someone might have a more expert comment than mine, but... generally, if someone gets the ability the modify entries in your database, they can do a lot of things.

umbral finch
#

Exactly, so nothings stopping them replacing the password and therefore being able to login to an existing account?

iron wadi
#

yeah, if they have permissions on some user to do that, yeah.

umbral finch
#

Is there any way to combat that such as storing check characters IN the hash that the attacker might not notice and confuse him?

#

Any other ways?

iron wadi
#

I think the most robust place to start is not getting the system the database is hosted on hacked. But at this point in the convo, someone with more practical and less theoretical knowledge should comment instead of me

umbral finch
#

Ah right, I’m making a password/account manager with works offline so storing vulnerable passwords elsewhere is out the question
Gotta rely on windows security I guess

woven gazelle
#

i mean yeah if they're in your database then like

#

they can delete all your user accounts

#

so what happens at that point is basically anything

iron wadi
#

Yeah, that is the last thing you want to happen, so you can asusme if they can do that, all is lost lol

#

Typically people have configured firewalls, the user accounts on the system the database is on, the role for users on the database config all to avoid this

lapis radish
umbral finch
#

what do you mean @lapis radish

#

the users actions?

lapis radish
#

You can assign public key to user account and sign with this key every action (like comment, post, settings update and so on)

#

Even when some hack your database the attacker cannot sign anything because only user has his private key

umbral finch
#

ohhh right

lapis radish
#

It's just a concept in my head but I think that every system should follow this path

umbral finch
#

Im designing a system and im just stuck on the storing of account details lol

#

winforms ^^

lapis radish
#

For example someone can hack Twitter database and post something as a president but how others can verify that is this fake or not? 🙂

umbral finch
#

lol yeah i see what you mean

lapis radish
umbral finch
#

only for the login system, then the rest use encryption

lapis radish
#

Oh okay

umbral finch
#

i might skip all this hassle and just use encryption for the login bit, then i can implement the same system for everything

#

it means the attacker could still log in but it would take a bit more work (generating password encryption and all that)

lapis radish
#

How about protection of data after decryption?

#

Do you want to store plaintext in the memory?

umbral finch
#

yeah id have to clear it from memory and all that right?

#

yeah exactly

#

so hashes are indeed the best option for the login

lapis radish
lapis radish
#

As far as I know

umbral finch
#

ughhh 😆 this isnt even a serious or graded project, i'm just doing it in my free time

lapis radish
#

Don't be afraid of KDF 😂 it's like normal hash function but with some extra parameters

umbral finch
#

cant i just use SHA 256?, whats KDF (im a bit new to this)

#

or whatever C# natively supports

lapis radish
#

You can build KDF based on SHA2-256 like PBKDF2-HMAC-SHA2-256

#

It's more resistant against offline attacks

umbral finch
#

so its more computationally intensive?

#

thats fine actually

lapis radish
#

And PBKDF2 for example accepts salt as second parameter so it's additional level of security

lapis radish
umbral finch
#

does KDF use salt?

lapis radish
#

In PBKDF2 you have iterations parameter

lapis radish
umbral finch
#

nice ill look into it

lapis radish
#

PBKDF2 uses salt and Argon2 too

#

There is something like HKDF too

umbral finch
#

thanks 😄

lapis radish
#

Your welcome

umbral finch
#

SHIT i just deleted my GUI

#

damn i guess il start again, i hadnt implement much code yet anyway

lapis radish
#

Use git or something

umbral finch
#

ah it just restored for some reason 😆 damn im a mess today

lethal knoll
#

now ima spam "Use recaptcha!"

woven gazelle
#

uh

#

right

sonic drum
#

Does anyone have any cool projects that I can do? Security projects

sonic drum
#

the last project I did was a GUI that takes in credentials and stores them in a database with the password hashed in argon2id using SQLAlchemy ORM

#

it has register, login, and logged in windows, it's mostly just for if I forget things in the future I can come back and look at my code, but I don't know what else to do

#

I was thinking maybe an E2EE chat app?

#

maybe if I do make that I can merge it with the project I just finished that I just mentioned

#

that'd be awesome

#

anyway, any ideas?

frail kite
#

please help
why cpp's socket is slow at sending?
it takes 15-30 seconds to send 65535 packets
compare to python, it only takes 3 seconds to send the same amount of packets
please help
(udp protocol)
The reason I am doing this is to brute force all possible port to perform udp hole punching to bypass nat

jade sonnet
#

hey! anyone wanna join me asap to solve some CTF taks! thanks

thorn obsidian
gaunt sapphire
#

@frail kite Basically it is guaranteed cpp would be as fast or faster if the appropriate libraries were used as intended. Your code spends most of it's time waiting for something.

rotund yarrow
#

Python's sockets are a relatively thin wrapper over the operating system's socket syscalls, but C++ gives an even thinner wrapper. If you perform the same operations, C++ should do them strictly faster.

sturdy kayak
#

why is this a grabify link?

#

@rotund yarrow

rotund yarrow
#

what?

sonic drum
#

can a moderator delete that

frail kite
#

please help

frail kite
#

python version

#
#code 1
import socket, time
s=  socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
t = time.time()
for i in range(1,65536):
  s.sendto(b"hi", ("127.0.0.1", 9000))
print(time.time() -t) // only 3 seconds for me
#code 2
s=  socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
t = time.time()
for i in range(1,65536):
  s.sendto(b"hi", ("127.0.0.1", i))
print(time.time() -t) // 30 seconds for me
thorn obsidian
#

@frail kite in the first code you are sending about 120k bytes to 127.0.0.1 on a particular port
in the second code you are sending 120k bytes to 127.0.0.1 on 65 thousand different ports

#

and its not a security related question so next time post a question like that in another channel

frail kite
#

@thorn obsidian this is the same problem

#

not in C but I write this in python

#

and udp is connectionless

#

thus, it doesn't make any sense

#

It seems to be not a problem if you test it on unix

#

but I tried on my 2 window machine and the performance issue occurs on both of them

thorn obsidian
#

why are you so concerned about this

frail kite
#

udp hole punching

#

timing is important

#

you can try this code for you self and the difference is not much

#

but why it run so bad on my machine

#

?

oak garden
#

hi, how to protect my code from being read ?
is there a way to encrypt it and still easy to run ?
is pyinstaller very secure to do that ? or there is another way ?
when using pyinstaller it generate a VERY BIG exe File !
any suggestion or help ?

thorn obsidian
woven gazelle
#

and pyinstaller makes it harder for people to read your code but definitely not impossible

#

why do you want to do this

oak garden
woven gazelle
#

well how are you decrypting the data

#

are you storing the secret password on the client

oak garden
#

yup . a part of it . i can send the other parts from server . as a changeable one.

woven gazelle
#

that's a bad idea

#

you shouldn't assume that anything you send to the client can't be discovered by them

oak garden
#

i am agree with you .
so how could i make my data secure ?

woven gazelle
#

i think the way you're doing the transmission is a bit flawed

#

are you trying to send a different secret message to each client

#

and verify that only the right client gets it?

oak garden
#

all clients are the same for me ..

woven gazelle
#

so how is it a secret

#

is the distribution of the program limited to people you want to receive the messages

oak garden
#

sort of ,

#

my program is [Scientific Program]
i used to create a python Env and feed it with readable scripts.

when sharing it , anyone can use the code or modify it ..
i want to make it harder to be read or hidden if possible ..

so i asked about how to hide or prevent others from reading the code ..
or compile it in a simple form not very big Size file
so what do you think?

ripe condor
#

guys how do install pwntool (python lib) as a linux CLI

dire comet
#

any one here a experienced ethical hacker?

#

pls text me

fading plaza
#

pip3 install pwntools?

thorn obsidian
fading plaza
#

plus the pfp

thorn obsidian
sonic drum
#

I'm trying to make a program where you can connect to another machine using sockets and communicate with them and I want to do it securely, so I want to establish an encrypted connection with the client, like End-To-End encryption

sonic drum
#

is there any good easy to use libraries out there that I can use for my program that encrypts data?

lapis radish
sonic drum
#

I wanna send it over a socket connection

#

just socket

lapis radish
sonic drum
#

Nah I don't wanna build it on my own

#

I'll just use SSL

sonic drum
#

what is this?

#

Is this for pentesting?

woven gazelle
#

yes

nimble isle
#

Anyone know if fail2ban detects illegal path traversals?

vital gyro
#

@thorn obsidian this channel is related to pythons ecurity, what you are asking would be better in an off topi channel

#

!ot

past starBOT
thorn obsidian
#

oh, sorry for the interruption of the topic, thanks for the info

main condor
#

how i can obfuscate my python code?

lapis radish
# main condor how i can obfuscate my python code?

Quick look at Google and I see that you can compile your code into byte-code and distribute in this form
https://stackoverflow.com/questions/3344115/how-to-obfuscate-python-code-effectively/7418341#7418341

main condor
#

but

#

with that

#

i still can make my .py an exe?

woven gazelle
#

pyinstaller generally needs a py file

#

why do you want to obfuscate your code

woven gazelle
#

what

fading plaza
#

thonk

#

do you know what "skid" means

viral jetty
#

Merry Christmas Everyone. Keep Safe.
Also thanks for everyone helping me too when I need help with coding.

Merry Christmas x 🎄🤶

meager latch
#

Guys what Script do i need if i have a bitlocked usb Can someone give mt the script to un lock it

woven gazelle
#

You can't remove bitlocker encryption without the key

#

it would take more than a billion billion years with the world's fastest supercomputer

lapis radish
#

But it's kinda offtopic here

meager latch
#

i dont have the key its for my customer but i dont have a script lol i was wondering if there was a pythoon script

woven gazelle
#

as I said, I could give you a script but it would take a billion billion years if you have no idea at all what the password is

#

and it's secure

lapis radish
#

Try to ask NSA #joke

heavy arch
#

NSA only have $ 290 millions per day to spend on spying people

thorn obsidian
#

Do you need to know data structures and algorithms for cybersecurity?

heavy arch
#

if you have that amount of money

#

?

lapis radish
thorn obsidian
#

@lapis radish Yeah I think if learn data structures and algorithms then This would benefit me for problem solving you know what i mean?

lapis radish
#

It can help you ofc

thorn obsidian
#

it's conspicuous

lapis radish
#

For example if you are a pentester and you are trying to break some code (like app for mobile devices) knowledge about data structures and internal processor layout can be helpful to find vulnerabilities

thorn obsidian
#

@lapis radish absolutely right

#

I like that example

lapis radish
#

👍

vivid frost
#

sha512 hash starts with $6$ right

fading plaza
#

sha512crypt, yes

primal star
#

waut

thorn obsidian
#

anyone have ideas for cyber security related projects? I already made a portscanner and various other things im just bored now

sonic drum
#

lol same

#

I finished my login/register program and I'm bored now

#

I don't know what to add to it anymore

#

maybe a UI? But I'm more focused on security related things

chilly linden
#

security! security!

oak steeple
#

@sonic drum code some exploits

dusty skiff
#

where is the cryptography section ?

sonic drum
#

You can ask here

thorn obsidian
#

Let's say I have implemented token auth for my web application.

Could a user theoretically brute force the token stored in the cookie, until they match the token of another user? Then be able to log in?

lapis radish
#

So tokens' space should be big enough that brute force is wrothless

thorn obsidian
#

@lapis radish so, long tokens to ensure that there are a load of possible combinations, therefore making brute force take exceedingly long?

lapis radish
thorn obsidian
#

what does a port scanner do

rose plover
#

scans any open or closed ports on a target machine

lapis radish
#

It's nice introduction into block ciphers and cryptoanalysis

rose plover
#

Why is this channel dead today 😞

lapis radish
patent lion
#

Some people know scapy here ?

lapis radish
patent lion
#

do you know what it said like matplotlib not imported and also texte smth ?

#

like i use matplotlib for jupyter notebook

lapis radish
#

How is it related with scapy and security? 😂

patent lion
#

it's on scapy

#

when i load scapy

#

i got those two messages

patent lion
#

but i've installed both

fading plaza
#

check python versions

#

and venv

patent lion
#

how do i check venv on linux

#

for python3 --version i have 3.6.9 and python --version i have 2. 7.12

woven gazelle
#

how are you running scapy

#

and run which scapy and which python3

patent lion
#

hmm to launch scapy i do sudo scapy

woven gazelle
#

why sudo

#

also it may be using a different python install somewhere

patent lion
#

i am following the scapy documentation where they do " sudo ./scapy "

#

but since ./scapy doesn't work i just do sudo scapy

woven gazelle
#

what did which scapy and which python3 output

patent lion
#

for which scapy : /home/tom/.local/bin/scapy

#

and for which python3 : /usr/bin/python3

woven gazelle
#

Is there any non terrible way to do PGP operations in python

wet plover
#

Haii, can i ask where should i start for studying security?

heavy arch
#

everytime you use a requests.get

#

the site counts as a "viewer"?

fading plaza
#

@patent lion ah then you need to sudo pip install matplotlib

#

since otherwise python wont read from ~/.local/lib/site-packages

#

where i assume matplotlib is installed(by default)

pallid epoch
#

hi how can i ethical hack?

void aspen
#

Hey @pallid epoch, we don't allow talking about ethical hacking here, because we have no way of verifying your actual intentions.

patent lion
#

When I do sudo pip install matplitlib he said requirement already satisfied

thorn obsidian
#

can cyber security be doneby py

jolly crypt
#

Python can be/is used in cyber security

torpid coral
#

also, your question is offtopic for this chanel lemon_grimace

patent lion
#

O

versed anchor
#

can anyone suggest a cool security project with Python?

lapis radish
versed anchor
#

whatever cool means for you

lapis radish
#

Do you want to contribute, use or what?

versed anchor
#

i'll edit that: can anyone suggest a security project with Python where I could learn some fundamental sec skills?

lapis radish
#

You have https://cryptography.io/ where you can use cryptographic primitives, you have scapy to capture and manipulate packets

versed anchor
#

nice, thanks

#

do you have any personal sec projects with python?

lapis radish
lapis radish
versed anchor
#

@lapis radish would you like to talk about them? I would be very interested

lapis radish
versed anchor
#

isn't this a security python channel?

lapis radish
#

We can talk here, this is not problem for me but maybe mods have different opinion 😂

versed anchor
#

talking about python sec projects in a python sec channel doesnt sound off-topic to me

lapis radish
#

Right.. So, what do you like to learn?

versed anchor
#

i would like to get myself into web app pentesting since it's a field with high demand

#

but i was interested in what you worked on

#

sharing your experiences

lapis radish
#

I worked with steganography and dictionaries generation for hash cracking

#

Mostly

versed anchor
#

wow, that sounds cool

#

personal projects or for work?

lapis radish
#

Steganography for my studies, dictionaries generation for work

#

There are good tools to generate dictionaries but there are implemented in different languages - like CUPP or duplicut

#

I don't have experience with pentesting but OWASP sites should be good place to start

#

You can implement simple backend detector (returns server's OS and HTTP server type and version) for example

versed anchor
#

thanks for the suggestions

#

i will look into that

lapis radish
#

Good luck

thorn obsidian
#

hii

#

anyone arround

void aspen
#

Hey, no need to ask to ask, just ask lemon_pleased

thorn obsidian
#

what do u do work or study

void aspen
#

Wdym?

thorn obsidian
#

i wanna ask i m going for networking diploma and then cyber security diploma

#

i m free for 3 months

#

and i was just wondering i should learn those languages that should be helpful in my cyber security career

#

like python c and java

#

ig python is used for automation in security domain

#

and c and java idk

#

or any other lang

thorn obsidian
void aspen
#

Yeah, that would definitely be valuable

#

I'd recommend you Python and C, but I'm not sure if learning both would be possible in 3 months

#

If you are motivated enough, I think so

#

Java is useless for CyberSec honestly

#

There's no real reason to use it

thorn obsidian
#

and i m thinking to learn python selenium automation and web scraping

#

rn

#

is it good

#

and also tell me other than this i should learn machine learning with python?

#

also i was wondering that when i would be doing that cyber security diploma i could learn all this at that time too what u say ?

void aspen
#

No, that isn't going to be useful for CyberSec, at least I don't think

void aspen
#

Well, it depends on what is included in the diploma, if there's programming or not

thorn obsidian
#

yes so

#

no for machine learning

#

what after learning c basics

#

what all i can do with that and what i have to do with c for cybersec

void aspen
#

C will have low level access to the computer resource, this is very important for some work

thorn obsidian
#

so for now i should learn python automation and c basics only

woven gazelle
#

what

void aspen
#

I'd say get comfortable with both languages

thorn obsidian
woven gazelle
#

what do you mean by 'there?'

thorn obsidian
#

i was asking r u there

#

being comfortable with a language, u mean learning their basics and all the domains they are used ? @void aspen

#

can i have ur 5 mins pls

void aspen
#

Not necessarily all the domains they are used in, it would be way too much

thorn obsidian
#

yeah

#

thats what i was wondering

void aspen
#

Just know how to do some simple stuff in those languages

thorn obsidian
#

not to tackle real word problems

#

bruh u confused me

#

ok leave i will ask someone else, i will go with some blogs

heavy arch
#

how can I know ifmy machine

#

has something bad caused by a .py f

#

file

lapis radish
heavy arch
#

like a --verify

#

there is no way that can be ofuscado?

#

Obfuscated*

lapis radish
#

You can run virtual machine with suspected Python script and check any I/O operations or disk changes

heavy arch
#

how much it costs

lapis radish
#

Qemu has something named cow

lapis radish
heavy arch
#

dolars

lapis radish
#

Idk

raw jewel
#

Unless the script is obfuscated or encrypted in some way, I'd think code analysis would be the most direct and least expensive route.

heavy arch
#

if you have money

raw jewel
#

Assuming you have someone with moderate python experience.

heavy arch
#

which service would you paid for?

lapis radish
raw jewel
#

I fail to see how a service is going to provide that for you.

heavy arch
#

its not reallywrong

#

with my machine

raw jewel
#

As Morowy described, you can sandbox the application

#

and observe its behaviors

#

but even that is non-deterministic

lapis radish
raw jewel
#

since the program could do something harmful in 60 minutes or 60 years

#

or or act on some input that does not exist in your sandbox

#

there may be static analysis tools that will do preliminary analysis

#

but again, whatever they spit out will probably require you to dig into the sources for usable details

#

is this a post mortem analysis?

heavy arch
#

yeah

raw jewel
#

That script is the least of your worries.

heavy arch
#

worries about what?

raw jewel
#

The fact that it exists should be your primary concern.

#

I assume it's a root kit or some kind of bot client?

heavy arch
#

something like that

#

im not interested in my machine

#

but in the info

raw jewel
#

You mean data exfiltration?

heavy arch
#

I mean

#

I wanna know if I can afford

raw jewel
#

Afford what exactly?

heavy arch
#

whatever

#

piece of information

raw jewel
#

Hiring someone to provide full forensic post-mortem?

heavy arch
#

yes

#

$ 20k ?

#

if it's not illegal I can pay directly

raw jewel
#

All I can tell you is that in 2006, our firm started at $10k for basic imaging and preliminary analysis.

#

I have no idea what the market looks like today.

#

There's nothing illegal about having someone image your compromised system and provide root cause.

heavy arch
#

I can afford it...

raw jewel
#

Well, you're asking in the wrong place. There are plenty of companies which provide forensic systems analysis.

heavy arch
#

yeah

#

o give it up

#

im not searching things

raw jewel
#

Have a nice day.

heavy arch
#

have a nice day too and a happy new year

#

i appreciate your attention

past starBOT
#

Hey @deep mirage!

It looks like you tried to attach file type(s) that we do not allow (.exe). We currently allow the following file types: .3gp, .3g2, .avi, .bmp, .gif, .h264, .jpg, .jpeg, .mkv, .mov, .mp4, .mpeg, .mpg, .png, .tiff, .wmv, .svg, .psd, .ai, .aep, .xcf, .mp3, .wav, .ogg, .webm, .webp, .flac, .afdesign, .m4a, .csv.

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

deep mirage
#

Here is an experimental encryption algorithm I have created.
It is not very secure, but it provides basic encryption and decryption with symmetric key's and parameters.
Type help encode and help decode for the command syntax.
https://paste.pythondiscord.com/alonilofaz.lua

#

It also says lua for some reason

#

But it is a python file

thorn obsidian
#

can someone help me with a homework problem, i am new to python and i really really need help

#

it involves a question regarding the vigenere cipher

deep mirage
#

You shouldn't ask for homework answers online.
It is considered cheating by most.

restive stone
#

@balmy mural are you having problems with the cipher or the python? I can help you with either.

rotund yarrow
# deep mirage You shouldn't ask for homework answers online. It is considered cheating by most...

We have a policy against giving answers to homework problems, but not against helping with homework problems. Doing the work for someone else is cheating (and defeats the point of the homework), but helping someone to understand the problem and to work out the solution is teaching (and that's the point of the homework in the first place). And for homework (as opposed to tests, for example) use of external resources is usually allowed.

sonic drum
#

Is "never trust the client" a good way to go about security?

lapis radish
#

Never trust user input

#

Always check both sides of the one way road

#

In real life too

sonic drum
#

Okay, so matter who uses my product, no matter what they do, it is not trusted

#

alright yeah

#

that makes a lot of sense

lapis radish
#

🙂

heavy arch
#

if a person uses a credit card from a foreign person in USA, for example

#

that person cannot be judged, but in case of the adress bill are in USA

#

getting a mandate is difficult to put that person in jail?

shy solar
#

i was talking to my comp sci teacher earlier this sem and he told me that using plenty of exec() in my program may cause security issues as the inputs may be processed as code?

#

does any1 know more about this and can tell me a bit more about it?

rotund yarrow
#

eval has the same problem. People frequently use eval to make a calculator, by doing something like:

num1 = input("first number?")
num2 = input("second number?")
print("Multiplying them gives:", eval(num1 + "*" + num2))
#

but the problem is, what happens if the user doesn't type a number, but instead types print("Hello world") for instance?

#

!e ```py
num1 = 'print("Hello world")'
num2 = '5'
print("Multiplying them gives:", eval(num1 + "*" + num2))

past starBOT
#

@rotund yarrow :x: Your eval job has completed with return code 1.

001 | Hello world
002 | Traceback (most recent call last):
003 |   File "<string>", line 3, in <module>
004 |   File "<string>", line 1, in <module>
005 | TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'
rotund yarrow
#

note that it ran the print("Hello world"); you can see it there in the output.

#

so if instead of print, they were to start a new evil process, let's say, you're going to have a bad time.

#

You should never use eval or exec on any string unless you already know exactly what it contains, and that it doesn't have any untrusted user input mixed in.

#

the "use eval as a calculator" thing is fine, if you make sure that the user gave you a number, only a number, and nothing else, for instance. But it's unsafe if they're allowed to enter anything at all.

olive iron
#

can someone tell me what account leeching and slayer leecher is?? can my account get "leeched" or hacked???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

proper path
#

@olive iron

#

very simple

#

you have the internet, this is a programming discord, not google

olive iron
#

in your case bing

weary hull
#

is there anyway for one way encryption
eg: encrypt string with a key, cant get the encrypted string back
but you can re-encrypt the same string with the same key and get the same encrypted string

sonic drum
#

I think you can do that with UUID5

#
>>> uuid.uuid4()
UUID('e817d382-e08c-4351-a1ba-1db2a25207ff')
>>> uuid.uuid5(uuid.UUID('e817d382-e08c-4351-a1ba-1db2a25207ff'),"hi")
UUID('38f9b040-a72c-5027-945a-fcc9f71a6274')
>>> uuid.uuid5(uuid.UUID('e817d382-e08c-4351-a1ba-1db2a25207ff'),"hi")
UUID('38f9b040-a72c-5027-945a-fcc9f71a6274')``` is this what you mean @weary hull
#

UUID('e817d382-e08c-4351-a1ba-1db2a25207ff') is the "key"

#

and you can use UUID5 and the UUID4 key to "encrypt" a string and get some other UUID, like hi with the key of UUID('e817d382-e08c-4351-a1ba-1db2a25207ff') will get you UUID('38f9b040-a72c-5027-945a-fcc9f71a6274')

#

if you choose a different key, it'll be different

woven gazelle
#

Well conceptually it's a salted hash

#

Or alternatively asymmetric encryption with an unknown private key

fading plaza
#

uuids aren't cryptographically secure afaik

#

but yeah thats basically hashing

heady zenith
# weary hull is there anyway for one way encryption eg: encrypt string with a key, cant get t...

A cryptographic hash function (CHF) is a mathematical algorithm that maps data of arbitrary size (often called the "message") to a bit array of a fixed size (the "hash value", "hash", or "message digest"). It is a one-way function, that is, a function which is practically infeasible to invert. Ideally, the only way to find a message that produce...

nimble crater
#

Hey guys, I converted my python file to executable using pyinstaller, and Windows Detector among other various security software is detecting it as a virus, how to fix this?

versed cliff
#

guys need help... working on a web scraping code with selenium. the website blocks bot action but grants access to manuel input. what can i do?

heady zenith
lapis radish
#

!rule 6

past starBOT
#

6. No spamming or unapproved advertising, including requests for paid work. Open-source projects can be shared with others in #python-general and code reviews can be asked for in a help channel.

hybrid finch
#

ㅐㄴㅅㆍ

civic bolt
#

Hello, Is there any way to have Voice Identification (as a Biometric) in Python?

lapis radish
#

@civic bolt You need to get some samples, create models and compare audio from microphone for example with your models, stored somewhere

#

I have some examples from my studies and we worked with LPC and MFCC methods to extract data from audio samples

woven gazelle
#

the problem with malware generally isn't that it takes more than 20 lines

void aspen
#

Hello @mental relic, let's not share articles about malicious projects please

restive hazel
#

Hello, Is there any recommended library for handling and interpreting CTI Sources . I have been looking some for my open-sources project

violet light
#

And try to interact with every possible element in the area of the text bar

#

Thats how I solved similar problem to yours

fading plaza
#

@violet light detecting bot-like activity is very easy, its what recaptcha does

#

also check the user agent

thorn obsidian
#

You could also do what WAF's do, they usually check for mouse clicks, user-agent, ip (whether it's a proxy/vpn), how long you've been there, the cookies, etc.

violet light
#

Yes but I used undetected chromedriver

#

You can either use this ore edit one variable of chromedriver in hex editor

#

And with undetected chromedriver it is hard for websites to detect you. They may give you a recaptcha, thats true, but they dont know that u are a bot for sure

#

Undetected chromedriver can bypass even instagram anti bot protection

#

So I doubt that the website inputs are blocked for bots

#

I think thats not the reason

#

Best for me would be if B2_Code_B2 provided me with the website he wants to bot so I could figure out whats going on

thorn obsidian
#

Just wondering can i make a .py file "non crackable" i want to give my friend my tool but i don't want him getting the source 🤔 (tldr:how to make .py to safe .exe)

woven gazelle
#

why don't you want them getting the source

#

does it have a secret in

#

or is it just about protecting the code

lapis radish
thorn obsidian
thorn obsidian
#

👍

thorn obsidian
#

Anyone have an idea of what else I should add ping me if so? Really just covers the basics here. (This is just something I'm doing for fun, probably won't use it in any project) https://i.imgur.com/UwRJh96.png

fading plaza
#

wtf is "undetected chromedriver" @violet light

#

anyways it looks like it just patches window.navigator and console.log(why?)

#

plus enable a few flags

#

still can be detected

#

also

#

!rule 5

past starBOT
#

5. Do not provide or request help on projects that may break laws, breach terms of services, be considered malicious or inappropriate. Do not help with ongoing exams. Do not provide or request solutions for graded assignments, although general guidance is okay.

fading plaza
#

and that bullshit with a "hexeditor" makes you sound like a skid

past summit
#

@thorn obsidian actually i'm pretty sure what you're asking is how to compile your program.

#

obfuscation is also another preventative measure you can take if you suspect your friend will try to reverse engineer your program

#

but yeah you can compile a program in many different ways, there's apps like auto-py-to-exe that'll do it for you or you can do it yourself via the cmd terminal

violet light
#

What? No

#

It really is undetectable

#

just search it up bruh

#

like I was able to be undetected on a page with Cloudflare

#

selenium chrome driver is detectable because it has some string in it with a certain value if I understood it correctly, and the websites can easily check the string. You can edit the string chromedriver so the websites wouldnt be able to see the difference between normal chrome browser and the chromedriver

violet light
nimble crater
#

this line of code var_5 = subprocess.check_output("dir", shell=True) works as a python script, but when I convert this into exe, it just dont work

try:
            var_5 = subprocess.check_output("dir", shell=True)
        except:
            await channel.send('error occured')
        else:
            await channel.send(file = discord.File(io.BytesIO(var_5), spoiler=True))
thorn obsidian
#

I wonder if undetected chrome driver breaks the fifth rule 🤔

#

I got so many good ideas, like auto join to remote school classes

void aspen
#

Yeah, it does break the 5th rule

violet light
#

Is undetected chromedriver illegal??

void aspen
#

It is against most ToS, yeah

violet light
#

Then why is it so commonly used among web botters

#

ahh

#

okay

vapid nymph
#

HEy there
Does anyone know about Nginx ??
I am being unable to block an automated web request. I used the deny <ip> in the location directive but nothing happens
I still see the <ip> in the access log

lapis radish
lapis radish
#

There is info that allow and deny should be in stream or server blocks

#

Do you restarted nginx after changes?

vapid nymph
#

Yeah

#

I did

#

Yeah, deny was in server block

lapis radish
#

Can you paste some code?

vapid nymph
#

I restarted, reloaded, force-reloaded the server

#

Send the code

#

I won't be able to paste it.....

#

I shit down the PC and now out for a walk

lapis radish
#

So why you think that it's not working? Have you tried to block your IP?

vapid nymph
#

I should have tried to deny all the IPs

#

No

lapis radish
#

Block yours and try to enter

vapid nymph
#

That just entered the theator of my imagination too

lapis radish
#

deny <your ip>
allow all

vapid nymph
#

Will try and let you know.
Will it be okay if I msg you personally later ?

lapis radish
#

Try to put it in the server block, restart nginx and we will see the result

vapid nymph
#

Probably will do after a few hours

lapis radish
#

Yes, you can msg me tomorrow

vapid nymph
#

Yeah, will do

#

Coll

#

*Cool

lapis radish
#

But I am not master of nginx

vapid nymph
#

Oh, then you can suffer with me.

lapis radish
#

Okay, good luck then!

vapid nymph
#

Ohkay bye