#programming

1 messages Β· Page 3 of 1

onyx merlin
#

@junior jackal This channel is for programming.
Please read through #start-here

kind oar
#

Thanks

wispy kestrelBOT
#

Gave +1 Rep to @wicked flame

nova berry
#

Indeed, after the bash -p... πŸ™‚

lilac holly
#

Are there any websites to learn Powershell interactively like Codecademy?

onyx merlin
lilac holly
#

I’ll look into it, thanks!

safe wing
#

Hey! Anyone experienced with JDBC?

#

Or just MySQL in general?

#

Nvm, figured it out πŸ™‚

slow portal
#

hi everyone

#

my code works incorrectly

#

can anybody help me to fix the code

minor zealot
#

probably can but won't. Try to narrow it down, put debugging statements, trace what is happening and see where it breaks. Give this details with what goes wrong and what should happen (this might as well already help you find the problem yourself)

#

Also, this feels like some homework stuff. No help on homeworks here I think.

slow portal
#

nooo

#

our home is to solve some problems from eolymp

#

i have made it

slow portal
#

i can't fix his code πŸ˜’

minor zealot
#

in this case .. debugging is an important part of programming and you should be able at least find out which functions is the problem. If you can give us just a few lines of code an "this line somehow does XY, but I'd expect it do AB", we are likely able and willing to point out why it behaves different.

minor zealot
lilac holly
#

I have a question about sockets in python3

#

I have made a port scanner

#

but I was thinking

#

Is it maybe better to close the sockets right after it scan that port

#

the semantics would be

#

for i in range(1, 1024):
s.connect(ip, i)
s.close()

#

would closing the connection be faster?

onyx merlin
#

You will learn more doing it through experiment than by asking us and getting a yes or no answer

lilac holly
#

learning about the queue module

#

It's really good

#

for multithreading

#

watched some tutorial videos

frigid cloud
#

Hello guys, I'm having some issues with the Introduction to Django room, I followed every step and I'm stuck in Unit-3 section 4, when I run python3 manage.py migrate it doesn't like it and throws so many errors (RecursionError: maximum recursion depth exceeded) , I've tried in both the virtual box and my own vm but it still doesn't work, when I run the app without adding urls it works fine (meaning I get the Django admin interface and all that) but when I add a path to urls.py it doesn't like it ( I did import include from django.urls and also tried from django.conf.urls import include) , any tips ?

whole yacht
#

recursion error sounds like there isn't an exit condition from the loop.

brazen flax
#

Hey people, any Rustaceans?

#

I am porting some code from C++ and got stuck at the very end.

true pumice
#

@primal summit C’mon keep it appropriate

primal summit
#

okay, i’m sorry…

surreal bronze
#

Hi everyone! When we have a primitive data type such as a String, and assign it to the variable such as name = "Jayy", when we to edit the value of name, because it's immutable does this mean that when we do name = "Bob" its a completely new variable (e.g. memory location) to the old name = "Jayy"? Or is it the same memory location (variable) but the values been overridden? Surely not because it's immutable

minor zealot
#

Java?

surreal bronze
#

?

minor zealot
#

is the question about Java or a different language? In case of Java, the string is not stored in the variable itself. the Variable just has an information where the real string is stored in memory. When you do name = "Bob" this information is updated. The variable name itself stays at the same memory location, but its value points to a different memory area (where you can find "bob")

surreal bronze
#

Ah, for python? Or C#?

brazen eagle
#

If it's immutable you cannot reuse the label

#

For C# it's also a reference generally

magic falcon
#

Most modern languages that I know of use references for everything, except possibly certain primitive types. String is not a primitive type, it's a complex type and the rules for primitive types don't apply.
"Canonical String Registration" is a good topic to look up.

surreal bronze
#

Okay thanks you guys! So the variable stays at the same memory location, but the value points to a different memory area? (Reference)

magic falcon
surreal bronze
magic falcon
surreal bronze
brazen eagle
#

Very likely

drifting dirge
#

hey, if i can ask, what's the difference between cout and printf in c++?

onyx merlin
drifting dirge
#

ye i was looking around to see what printf does itself but I really can't see the difference

#

i just want to get a simpler explanation than on google if possible

magic falcon
#

They are very different things.

magic falcon
#

Not quite correct. Please check the C++ docs on what an ostream object is, and how cout implements it.

brazen eagle
#

printf is C code anyways

steady quarry
lilac holly
#

It doesn't try to scan every port

#

It hangs at the 7th port scan

#

I tried looking at the queue documentation but

#

I don't really see anything that could help me with this problem

minor zealot
#

where do you take the elements out of the queue?
Does it work when you only use 1 thread?

lilac holly
#

it just hangs

minor zealot
#

maybe the problem is more with the port 139 itself and not the coding?

lilac holly
#

no that's not how it works

lilac holly
lyric mirage
#

Would it be better for you make the ports in a list then do

[0,PortList]

lilac holly
#

but I can try that.

#

My real problem is with scanning ports 1 to 1024

#

I put 1024 numbers ranging from 1 to 1024 in linear order in the queue

#

when I run my scan though

#

it surpasses 1024

#

and keeps going

#

very weird

#

maybe I should append all the numbers in a list and then loop the list and append all those numbers in the queue

#

I really don't know what to do at this point

minor zealot
#

putting the stuff in the queue seems fine. your problem has to be somewhere else I'd guess.

lilac holly
#

FINALLY I GOT IT

#

LETS GOO

#

This was the solution

minor zealot
#

nono wait

lilac holly
#

what

minor zealot
#

you got some raceconditions here

lilac holly
#

whats wrong?

minor zealot
#

there might be problems when a thread checks the while condition (not empty yet) but then the queue gets empty before you get the item

#

then it will wait forever

#

TOCTOU time-of-check time-of-use if you want to google about it

onyx merlin
#

Have two queues.
Pull the ports scanned from one queue, and push the results to the other.

lilac holly
#

I know how to fix it

#

I while make for loop that counts to 1024 append it to a list then loop through the list and put it in the queue

#

I'm doing this cause if you scroll up higher

#

You can see that the ports in the list seemed to work fine

#

nvm

#

this just hangs

#

for some reason

#

time to debug

minor zealot
#

you have a multithreaded program with raceconditions. it's a gamble if it is working or not

lilac holly
#

can I have some good resources about raceconditions

lilac holly
minor zealot
#

sorry, I don't know a good ressource. Maybe the topics "TOCTOU", "producer consumer pattern" might help (targeting your problem) . It's a huge topic

#

locking might help, but it's probably not the best in your case. You might take a look at the "block" parameter of the queue.get(). With this you can avoid the problem

lilac holly
onyx merlin
lilac holly
#

I think

#

I don't know what to do more.

onyx merlin
#

Why does it matter if they run in order?

#

If they have to run in order, you don't want threading.

lilac holly
#

I don't mind if they run in order or not

#

I don't want it surpassing 1024

onyx merlin
#

Oh, you changed your question

lilac holly
#

Yeah

#

sorry

onyx merlin
#

Probably not hitting mode 1 then

lilac holly
#

Yeah

#

I don't really get why it won't work

#

I tried everything

onyx merlin
#

You haven't tried everything

#

You can easily work out what mode it's finding by adding print statements

lilac holly
#

thank you

#

I got it

#

It's running

#

65535

#

ports

#

Now I just have to figure out how to fix that.

brazen eagle
#

May want to check how your mode is being set

#

To be fair, I'm a fan of Concurrent.futures

lilac holly
#

I like threading better

lilac holly
#

I don't understand why it won't encrypt it

#

it was working fine earlier

#

fixed it nvm

lilac holly
#

anyone know why im having this problem

#

im sure I gave it the the correct private key

jolly turtle
# lilac holly

you inputted your message as a bstring which is not how python works. when you input something it takes it as a literal string and then you turn it into bytes if you want

lilac holly
#

.strip(b'')

#

and then .encode()

#

I don't really know

onyx merlin
#

Or base64

#

There's already well known ways of providing raw bytes over printable strings

lilac holly
onyx merlin
#

I'm certain you can google "python decode hex" or "python decode base64"

lilac holly
#

also why ask for input in hex or base64?

lilac holly
#

encode it with base64

#

then decode it?

onyx merlin
#

I have a strange feeling you don't know what data types you're dealing with.
Slow down. Take some time to think about raw bytes.

lilac holly
#

oh my bad

#

ill google it

brazen eagle
onyx merlin
#

Or other control characters.

brazen eagle
#

True

jolly turtle
# lilac holly so how should I do it?

basically when you get that output instead of taking it as is you should convert it to base64 which you can then decode to get the bytes object that you need and decrypt that with rsa

lilac holly
#

thank you bro

jolly turtle
#

like say you have just encrypted some message and it's saved as a bytes objects let's assign it to a variable and call it encrypted_message then we do it like so:

import base64

base64_string = base64.b64encode(encrypted_message)

print(base64_string)
#

and then you take the string that is printed and you decode it like this:

message = base64.b64decode(input("please input your base64 string"))
#

and that message is decryptable you can now decrypt it using your private key and everything

magic falcon
#

It's a pretty common topic, but base64 is not an encryption cipher, it's a data encoding schema. Getting those confused is going to be real bad.

jolly turtle
#

that base64 string that you're gonna get is going to be encrypted because you used rsa on it not because base64 encrypted it

magic falcon
#

base64 is not capable of encrypting anything. Because it's not an algorithm designed to secure data.

jolly turtle
#

we know

#

the question was about rsa, i used base64 as a convenient way to make a string that can later be decrypted easily using rsa

magic falcon
#

I'm being extra explicit here, because the person you're talking with has a long history of mis understanding these topics, and I want to be extra clear what is going on.

jolly turtle
#

ok then

lilac holly
#

yeah ok bro

#

I was new at the time

jolly turtle
#

so to be clear that base64 string you're gonna get is not going to be encrypted but after you decypher it you're gonna get an encrypted byte array

lilac holly
#

you don't have to point a weakness I had before just cause you misread the question

#

lmao

#

I know what base64 is

magic falcon
#

I did not misread the question. You have a long, long history of asking questions that are resolvable by reading the documentation.

jolly turtle
#

reading the docs is not always easy for beginners

lilac holly
#

exactly

#

I got better at reading docs

jolly turtle
#

anyways what's up diaralb

#

with the code

lilac holly
#

good

jolly turtle
#

you figured it out?

#

is it working?

lilac holly
#

I'm first allowing the user to specify a path to a encrypted file

#

and then they can decrypt it with a private key

#

I'm going to add manual input after and see if your suggestion worked

jolly turtle
#

do you not have manual input in your program?

#

because it seems like you do from what you sent

#

i thought you wanted to decrypt a message inputted by the user

lilac holly
#

one sec ill snip the code rq

jolly turtle
#

send it as text instead it's more convenient

lilac holly
#

oh ok

jolly turtle
#

or as a pastebin

#

if it's too long send a pastebin

lilac holly
#

but its not a small script

#

ill put it on pastebin

jolly turtle
# lilac holly

do you get any errors or issues with this specific code?

lilac holly
#

not as of now

#

I gotta finish that function rq then ill show you

jolly turtle
#

then what is this all about i don't get it

lilac holly
#

should I send you the full code?

#

let me check out

#

pastebin rq

brazen eagle
#

Is there an actual problem?

jolly turtle
#

what i sent you was the solution to the first problem you sent

#

do you have a problem with the new code that you sent?

lilac holly
#

no no I don't

#

do you still want the full script though?

jolly turtle
#

i'm confused why did you come here for help without a problem?

lilac holly
#

that's what im going to add as well

jolly turtle
#

oh ok

#

then the solution i gave you is for that problem

lilac holly
#

ye except I added one more thing which you could also give a file to decrypt

jolly turtle
#

but if you don't have manual input you should know that using the whole base64 thing is pointless because you can just use the byte array straight from the source

lilac holly
#

yeah I know that

jolly turtle
#

the base64 solution is for manual input

lilac holly
#

yeah

jolly turtle
#

send me your code anyways i'll review it or something give you some tips

lilac holly
#

so I can send it

jolly turtle
#

if you must but i'd rather do it here

#

just send me a pastebin link

lilac holly
#

alr then

brazen eagle
#

Quick note from what you posted, prefer arguments to asking for inputs

#

It'll make the program far easier to script afterwards

lilac holly
tardy zealot
#

hey i h ave a question so i joined a king of the hill on the website it gave me the machine name and the ip adress but i cannot find the start the machine or attack box button can anyone help?

tardy zealot
jolly turtle
brazen eagle
tardy zealot
brazen eagle
brazen eagle
tardy zealot
jolly turtle
#

that's why in every python script we put everything in a main function and then run it under if __name__ == "__main__"

brazen eagle
#

Always hated that about python

lilac holly
#

did you see the script?

#

avi

jolly turtle
#

yeah i think it's pretty ugly but it's best practice

jolly turtle
brazen eagle
#

Why are you defining functions under a main?

jolly turtle
#

alright i'll start with the quickest fixes your functions naming convention is wrong it should be lowercase snake casing like this: function_name and not: functionName (camel casing)

jolly turtle
jolly turtle
#

your class name should be title cased like this: ClassName and not all caps like this: CLASSNAME

lilac holly
#

the script is a module

#

its not a main script

jolly turtle
#

and?

#

that doesn't justify it

lilac holly
#

yeah your righ

#

right*

brazen eagle
#

Also there's way too many if elif blocks, the cognitive complexity is way too high

jolly turtle
#

also why are you printing the name of your thing in an infinite loop?

brazen eagle
#

Looks like there's a fair bit of duplicated code, in any case a few refactoring passes are probably a good idea

brazen eagle
lilac holly
#

I'm not done fixing it yet

#

also

#

avi

#

having a problem

jolly turtle
lilac holly
brazen eagle
#

Script like this should be a one shot though

jolly turtle
#

you print the name and then put the menu thing in an infinite loop the name doesn't need to be reprinted

brazen eagle
#

Yeah the paths should be parameters in the command line, lookup argparse

surreal bronze
#

I have an idea

lilac holly
#

this outputs this

surreal bronze
#

for speeding up your code by a whole second

jolly turtle
#

yeah the sleep part

#

redundant

lilac holly
#

kind of looks cool to me

brazen eagle
#

Yeah that's a useless sleep

jolly turtle
#

you should value efficiency over coolness in this case

brazen eagle
#

Always

lilac holly
#

can you look at the thing above avi

surreal bronze
#

🌟 speed 🌟

lilac holly
#

my private key file has the---begin rsa

brazen eagle
jolly turtle
brazen eagle
#

I'll admit that debugging is more of an art than a science, but it's learnable, even if python makes it difficult

lilac holly
brazen eagle
#

The stack trace

jolly turtle
#

you have a line that says traceback somewhere in your error everything after that is your traceback

#

look for it

brazen eagle
#

That will tell you exactly what went wrong and where

#

@lilac holly perhaps it would be a good idea to learn how code is actually executed on a computer

surreal bronze
#

whats the end goal here?

lilac holly
#

I know how python interprets the code

brazen eagle
#

I mean how functions are called, about the call stack

lilac holly
#

about half of it

brazen eagle
#

Alright

lilac holly
#

it shows call stacks

brazen eagle
#

Now you need to learn the hard parts πŸ™‚

#

Aka how to debug when everything inevitably goes wrong

lilac holly
#

ye

#

fixed it

brazen eagle
#

To be fair I'm not that well versed in python

lilac holly
#

used print statements

#

really helpful

#

they always save me

#

in debugging

brazen eagle
#

They help

surreal bronze
#

πŸ¦†

brazen eagle
#

Anyways, @lilac holly I just want to ask you to please try to remain respectful when we ask you to look up the easy stuff on your own. I know that learning is hard, but being spoonfed the answers won't help you learn unfortunately. Experience is the true teacher here, as is making all the stupid mistakes and learning from them πŸ˜‰ programming is as much an art as a science, and we have the advantage that mistakes have virtually no cost, at least for small projects.

#

As you grow older and wiser, you'll see your old code and wonder who the idiot that wrote that was πŸ˜‰

lilac holly
#

yeah

brazen eagle
#

Also it'll help avoid mods getting angry and muting you

lilac holly
#

😭

brazen eagle
#

I mean, there's probably a reason don't you think?

brazen eagle
#

Good, I'd be disappointed if I hear you got muted again for the same reason

lilac holly
formal finch
#

anybody can help me with http proxy server

wraith latch
formal finch
# wraith latch Hey there, could you be more specific please?

I need help with http proxy as i have my sever suppose ubuntu with some ip address and apache2 running i want if someone hit this ip it shows the other website which i have configured and logged in so the user will directly go to website dashboard instead of login page and url will also not be hte same as actual website
for example my domain is mydomain.com and i configure it to show all the content of some site otherdomain.com which is login protected so i logged in with my credential and now when every body hit my domain.com it automatically logged in and url remain same as my domain.com and user can do the same task as they can do on actual site. on other hand the other site sees it as traffic coming from single ip as they disable 2 ip and account sharing but I badly need it for my office and my remote workers as i cant afford multiple subscriptions and my users have seldom uses this. If anybody help then please do help me as i am stuck with financial issues and its getting worse and worse that those sites are blocking my accounts by saying that i am sharing it https-proxy

brazen eagle
#

so...reverse proxy?

wraith latch
brazen eagle
formal finch
#

Yes i think so i have no experience in it can you please help me

brazen eagle
#

have you tried the docs?

#

are these custom-developped servers or off-the-shelf software?

onyx merlin
formal finch
#

Site is not blocking me but when i share credentials with my members they share with alot of people then problem happens

onyx merlin
formal finch
#

Yea but brother i have 100 people working in my setup and every have segregated duties if someone uses one feature of that tool than others uses second i cant afford that tool for all seprately as they dont even use 1% of quota suggest me anthing good☹️

icy bobcat
#

Maybe better budget for toolage would do

minor zealot
#

use a different tool or ask the company for a special license?

icy bobcat
#

If u can't afford your tools, something is wrong

onyx merlin
formal finch
#

Ok thanks for your response

plucky abyss
#

Hi guys

  1. I'm trying to use python to entirely extract each unique <section id=""></section> from an HTML document
    1a) I want extract each unique section ID from each unique section tag in HTML document, preferably added to a (tuple?)
    1b) I want to be able to access that information, and choose a section ID from that (tuple?) to interact with and modify
  2. Eventually I want to replace a variable amount of content between the <section id="sectionID"> and </section> tags.
    2a) This could mean that I need to delete a variable amount of content from between the start and end tags
    2b) This could also mean that I need to add a variable amount of content between the start and end tags, without overwriting any content.

I'm trying to figure things out by reading documentation, articles, and googling using different phrases, but I'm having second thoughts as to if I'm even using the right language.

So far I've figured out how to grab the HTML content and assign it to a variable.

print('please provide the absolute file address for the main webpage')
mainpage = input()
print('please provide the absolute file address for the new section content')
newcontent = input()

file1 = open(mainpage, 'r')
file2 = open(newcontent, 'r')

page = file1.read()
content = file2.read()

And I have created a variable to store what I'm searching the document for.

search = "<section id=\"" + * + "\">" + * + "</section>"

I can probably figure out a function to look through the webpage fairly easily and grab each section, but storing each section in a unique variable is going to be annoying, and what if I run out of variables? I can't write a unique variable for each section I find, that's going to be annoying af.

Maybe there's a way I can assign each section I come across, to a generated hexidecimal variable that increments 0000, 0001, and then only print the hex number and the related section ID so I can use that information later?

Sorry for the wall of text.

minor zealot
#

it seems like a bigger task to do with limited python skill. Maybe a few more exercises on programming/python might be a good idea

#

You might be interested in dict dictionary that can be used to store an unknown amount of data

#

Also research about list and using sys.args might be easier to get the filenames into the program

#

And last at the moment: your search string might work in the moment, but it is often a hassle to using simple searches/regex when analysing html. Take a look at the module beautifulsoup. That parses HTML for you and you can search there quite easily

plucky abyss
plucky abyss
wispy kestrelBOT
#

Gave +1 Rep to @minor zealot

plucky abyss
minor zealot
#

Yes sorry. argv is correct

plucky abyss
#

No worries! Thanks again!

surreal bronze
#

Or click

dense thistle
#

hello
i want to embed a meterpreter stager to one of my java projects. can you please suggest me something where i can learn how to do that?

tulip sail
dense thistle
#

just curiosity. also i gave a programmer friend and the permission to hack him. he is going to clone my repo and execute it.

tulip sail
#

Uh huh, you're aware that isn't legally binding, yes?

dense thistle
#

r u saying its illegal to do?

#

sorry my english is not the best

tulip sail
#

Yes

dense thistle
#

legal or illegal is not really a problem because he is actually my best friend and we are just having fun. also its gonna be a private repo so nobody could access it only two of us.

true pumice
#

!rule 9

narrow terraceBOT
#

Rule 9: No discussion of illegal/unethical topics or actions. If the target device doesn't belong to you and you don't have specific permission to perform an attack from the owner of the target, then you don't do it and we don't talk about it. This also applies to piracy / copyright violations -- illegally obtained materials (including classified or potentially classified materials) should not be posted here.
If in doubt, please ask a moderator before posting your message -- preferably without breaking rule 1. Whether an action is unethical or not is at the sole discretion of the moderation team. Be warned -- a community ban over ethical concerns may also be extended to a ban from the TryHackMe website; we do not teach blackhats.

dense thistle
#

i see. well i have specific permission to do it.

#

he is also a hacker student and we had an agreement that he can hack me and i can hack him anytime and anyhow.

surreal bronze
#

Sounds like a recipe for disaster

wraith latch
# dense thistle he is also a hacker student and we had an agreement that he can hack me and i ca...

Whether an action is unethical or not is at the sole discretion of the moderation team Is a part that stands out to me, I see where you're coming from having this arrangement with your friend but it doesn't fly with the rules as Jabba already pointed out. What Muiri was pointing out was that unless you have a contract with your friend, this arrangement is not legally binding so you're at risk of breaking laws of your country potentially.

Not looking to backseat mod here, just trying to help you understand

#

And even still, contracts do not generally give you permission to break the law. If I had a friend who signed a contract that said I could own a weapon that's classed as illegal in the country I'm in, I could still be prosecuted for that

dense thistle
#

i tought its a common thing to inject a payload to something else to trick the target. i did not know its illegal to do. also i see your point but the actual goal here is learning and laughing

magic falcon
dense thistle
#

alright! I will not

#

thats been said. can you please help me out with the original question also? how can I run this byte array from code?

surreal bronze
true pumice
#

-mute 377164261258035202 I hate being ignored :) mod note: proceeding to ask for help when told it was unethical

wispy kestrelBOT
#

πŸ”‡ Muted hanzs-solo#7124 for 1 day

blissful bison
dusty ore
#

Hi guys. I'm trying to make the 2 highlighted columns to not have the same value, these 2 are the ids from another table. Do you guys have any idea?

wraith latch
#

I'd help if you post what you've tried so far as well, example queries etc.

dusty ore
wraith latch
# dusty ore No, i want it to reject the value entered to one of those columns if one of whic...
SELECT column1, column2, column3
CASE
   WHEN column1 = column2 THEN 'whatever you want'
END
FROM table

You could use a case statement for example, this allows you to look for a specific condition and then get SQL to display something else.
I'm of the opinion that if you're seeing the same values in different columns then you've got a problem that you're trying to suppress rather than fix. It also smells a little homeworky to me but hope this helps

#

Otherwise you'll need to dive into how this dataset is configured to see what got messed up

rapid plank
#

I am trying to authenticate to a werkzeug application's debug console. Is this anappropriate way to do it? It seems to work fine although i always get a resetting dropped connection

def authenticate(session: requests.Session, url: str, secret: str) -> None
    parameters = {
        "__debugger__":"yes",
        "frm": 0,
        "cmd": "pinauth",
        "pin": None,
        "s": secret
    }
    
     while True:
          pin = input()
          parameters["pin"] = pin
          
          resp = session.get(url, params=parameters).json()
          if not response["auth"]:
              continue
          break
brazen eagle
#

I hope that's a POST

rapid plank
brazen eagle
#

Posting secrets in a get is bad practice

rapid plank
#

I tried to follow what werkzeug did on submit of the form

#

In my understanding fetch() performs a GET right? @brazen eagle

tulip sail
#

You are correct. And your Python at first glance looks to replicate that request. Your variables at the end are wrong though

rapid plank
#

What variables are you talking about exactly?

dusty ore
# wraith latch ```sql SELECT column1, column2, column3 CASE WHEN column1 = column2 THEN 'wha...

Thanks for your help. But that's not what I'm looking for. Luckily, my friend found a solution: it's the CONSTRAINT with CHECK
Link: https://stackoverflow.com/questions/52094985/sql-create-table-with-condition-that-2-columns-cannot-have-equal-values

wispy kestrelBOT
#

Gave +1 Rep to @wraith latch

short elm
#

hiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii

rapid plank
tulip sail
#

You've used resp on one line and response on the next

rapid plank
#

Oh yeah hahah my bad. I copied it from my pc and didnt notice it at all

#

Although why am i getting the resetting dropped connection thingy.

#

^ only happens using that loop

#

If i just send a request it doesnt show up

tulip sail
#

Oh, you did

#

One sec

tulip sail
#

Honestly? No clue. Try proxying it through Burp and see what you get when you control each request / response

rapid plank
#

What would the expected results be? As i said a standalone request doesnt show this.

#

also is that loop the good way of validating user input

tulip sail
#

Yes, albeit quite a basic one.

tulip sail
tulip sail
#

Put it through and just see if there's anything weird for a HTTP flow

rapid plank
#

Sure. If my crappy ahh pc can handle firefox and burp open at the same time

tulip sail
#

Baha

#

Just add a proxy to the GET request

#

, proxies={"http":"127.0.0.1:8080"} should do it iirc

rapid plank
tulip sail
#

Is the Burp Proxy active..?

rapid plank
#

oh shoot i didnt

#

Bruh

#

hahah im srry my braincells lagged or something

rapid plank
tulip sail
#

Huh

#

Well, is it working either way?

rapid plank
#

Yeah. Was just curious why

tulip sail
#

Well, no idea then I'm afraid. I wouldn't worry too much

rapid plank
#

Yeah. Well i just noticed that my GET translates to POST???

tulip sail
#

Well, intercept and see what's happening there

wispy socket
#

what video recommends to watch to learn assembly?

#

and is a good idea to learn? or is a waste of time

unkempt nacelle
#

I have a problem in python program

clear lodge
#

describe the problem

unkempt nacelle
#

yes describing

#

I made a port scanner with python3

#

and I want it's syntax to run like python3 port scanner.py

#

it runs and asks for hostname

#

but I want hostname to be between 0.0.0.0 - 25.255.255.255

#

bcse If I put any IP it shows ports it scans

#

and if I put random number like 1

#

it shows scanning and does not move further

#

I want it to give error on wrong IP

unkempt nacelle
clear lodge
#

no, im not gonna vc πŸ™‚ but if you need help with some programming issue its better to post your problem, maybe some code. Folks will be more inclined to help you that way

unkempt nacelle
#

for wrong Ip it says hostname could not be resolved

#

but for single digit it sucks

onyx merlin
brazen eagle
#

That is a nightmare regex, though less bad than email

unkempt nacelle
#

no

unkempt nacelle
#

It worked now

#

@quartz kraken helped me

#

Problem was not of wrong IP it was not working previously without regex and all

#

problem was of normal numerical strings which didn't stop and were running in a loop of scanning.

#

So I took a logic of validating an IP address and my scan loop I transferred it in a if else condition as : if my IP is valid scan , else say enter valid IP

onyx merlin
brazen eagle
#

You can do some basic parsing I suppose

onyx merlin
#

Ask the system if it's valid

#

Has the same problem they were facing, because those are valid expressions of IPs

brazen eagle
#

Yeah that's probably not an intuitive behaviour though

onyx merlin
#

How does nmap do it?

brazen eagle
#

Probably magic :p

wise frigate
#

Hi all! quick question, doing the python for pentesting and can't for the life of me understand this line..
for sub in subdoms:
sub_domains = f"http://{sub}.{sys.argv[1]}" What is the "f" used for???

May be a viciously stupid question but im super curious why the "f" is needed

Thanks!

minor zealot
wise frigate
wispy kestrelBOT
#

Gave +1 Rep to @minor zealot

vernal agate
#

Hello

short elm
#

what the ****

brazen eagle
#

??

lilac holly
chrome carbon
#

Does anyone know of a previewer for Outlook 2016/365 emails?

vernal rapids
#

Hi

clear lodge
#

things are going well today

brazen eagle
#

while cute, probably not age-appropriate. Keep it pg please

clear lodge
#

whaha

brazen eagle
#

that's more like it

clear lodge
#

8k fetches failed, aww

#

x)

brazen eagle
#

that's...a lot of network calls

vestal carbon
#

sounds like you're having early weekend

brazen eagle
#

or no weekend

clear lodge
#

im definitely having a weekend

#

whaha

brazen eagle
#

Also accurate

#

I have to write slides on how to BDD :/

clear lodge
#

eek, good luck!

brazen eagle
lofty wraith
#

should i finish python programmming, or start c#

brazen eagle
#

depends on what you need

upper portal
onyx merlin
#

If you want to build windows desktop apps, golang probably isn't the right tool.

upper portal
onyx merlin
#

You understand the point I'm making though, right?

upper portal
#

yeah, i'm just.. awkward πŸ™‚

onyx merlin
#

I like Go.
Go is not the right tool for every job. C# is the right tool for many jobs.

#

I write lots of go.

hollow sorrel
rough linden
#

cool repo

hollow sorrel
#

thanks

devout ledge
#

Who here is specifically interested in programming, as well as talking about what it is?

#

In general, who wants to chat, write to me in DM, I would be glad.

brazen eagle
#

I'd like someone to tell me how to get a project to properly use the custom gradle plugin I wrote, and also for that plugin to properly generate it's sourceset

#

But I'll allow that I'm on the wrong forum

devout ledge
#

Maybe, but I, for example, am just learning about programming.

brazen eagle
#

well I got it working anyways πŸ˜„

woeful quest
#

Which lang u should learn first ???

lofty wraith
#

Golang?

surreal bronze
#

As always, pythons a great language to learn for beginners

lofty wraith
#

i think i'll start C#

#

for desktop/mobile apps, and 3d games

#

software

woeful quest
#

What's Golang n what it is used for ?

lofty wraith
#

?

lofty wraith
brazen eagle
#

Go is a language created by google useful for server things among others, not super familiar with it myself

brazen eagle
lofty wraith
#

ok, sorry

lilac holly
#

The advantage of golang over python is that golang is faster

lofty wraith
#

hmm

onyx merlin
lilac holly
#

Yeah, that's true

#

In most cases you don't need a high speed

lofty wraith
#

πŸ‘

hushed wedge
#

hey

gilded widget
#

Hello

chrome carbon
# woeful quest Which lang u should learn first ???

A suggestion is to pick literally any language you find interesting, start making a small project, like a Calculator, then maybe take a udemy course or YouTube tutorial.
What language you learn first it not important, coding is kind of universal no matter language, especially the beginner stuff.

But if you have a special goal in mind we might be able to help you with a language that suits the project better if you let us know.

brazen eagle
#

I hear golang has a half-decent threading lib, but James can probably say more

onyx merlin
lilac holly
#

That sounds nice

lilac holly
#

im trying to get the clients ip when they go to my flask app but it keeps telling me its own server ip

onyx merlin
#

It's running on your machine so the traffic is coming from... your machine when you access it from your machine

lofty wraith
#

yeah

hushed ledge
#

Hi, i have a question for bash script

bold halo
hushed ledge
#

In case of break statement inside a while loop, the done is read ?

lilac holly
minor zealot
# lilac holly so if I used tryhackme openvpn file it would show the tryhackme ip correct?

why not just try it? But the answer is probably 'no'. If you access the page via 127.0.0.1, it is not routet via the THM VPN directly back to your server and you will always get this ip. But with an active VPN, you should be able to access it with your own THM VPN IP as well (10.x.x.x) in which case it will show this IP. The way to get a different IP there is to make another server access your page. E.g. start a THM machine where you have RCE and curl <your thm IP>. you should get the ip of the machine.

surreal bronze
#

No, It would be relative to where you are hosting the web application

onyx merlin
lilac holly
#

cause my machine is running it

onyx merlin
lilac holly
#

i'm going to deploy it on a linode server

#

and then test it

brazen eagle
#

You could try in a docker container

#

But if you want to make your life more difficult then go for it

sick scarab
#

just started learning c# and built a random number guessing game. the oop structure is a little weird to me but the language seems simple overall

amber niche
#

anybody knows C language lmk!

lyric mirage
lilac holly
#

hey guys. I have a question that I can't seem to find an answer for

My question is how do I replace a specific occurrence of a character, in a string, with the replace method?

So I have a variable of example with the value of "oppose". How would I replace the second "p" with an "o"?

I know if I use example.replace('p', 'o') that it'll just replace the first occurrence of 'p'

I've found answers that deal with replacing all occurrences of a character, but not a specific occurrence. thank you

minor zealot
#

i think this is too specific functionality to exists in common standard libraries. You'll have to implement this by yourself

#

(also, always include the language you are talking about.)

lilac holly
wispy kestrelBOT
#

Gave +1 Rep to @minor zealot

minor zealot
#

I mean, you could dynamically create a regex string that scans for x occurances of the character and then match-replace the x+1-st character. But i would not call this the best approach πŸ˜„

magic falcon
#

The problem formulation sounds very homework-y as well.

#

There are some unaccounted for edge cases, as stated.

lilac holly
#

guys how should i learn course cs 50

#

there is only video in the week one when i finished it what to do repeat it all the week and practice or what

chrome carbon
mellow matrix
#

Hi guys, i need help with JS. I wanna to send all keystroke from login form to another site. Can someone could help me?

vestal carbon
#

from what I understand is that, you want to send the keystrokes to a different website than what the user is typing it to?

mellow matrix
#

Yes, exactly

#

its just a test on js script

vestal carbon
#

can't you just send the login form to a different website? why send the keystrokes one by one?

vestal carbon
#

or am I getting the wrong interpretation here?

mellow matrix
true pumice
#

But why, what’s the purpose?

#

There’s going to be more than just testing if you can do it

#

And by the looks of it, it’s a malicious tool

mellow matrix
#

We were given a script in which a window was made available for testing to display, for example, advertisements. The samesite is set to NONE. In this case, we are to check if we can perform such an action as sending keystrokes to another server. Yesterday we tested this with a session cookie which proved impossible. Just this. The code in the screen shot above is just a scrypt from the internet hence my question if it makes sense or try something else.

#

im not a bad guy, i just ask for help bcoz im newbie in this

true pumice
#

I didn’t think you were a bad guy, just your actions

#

You say we, so I presume you are in a team

#

Ask your team, if not, as your team leader

#

Else, please don’t ask here, it is a malicious practice

lilac holly
wispy kestrelBOT
#

Gave +1 Rep to @chrome carbon

brazen eagle
lilac holly
brazen eagle
#

Just looked like a homework or interview question

lilac holly
#

ok

chrome carbon
lilac holly
#

Im going to use that instead

magic falcon
#

There is NO ethical reason for someone to do that. Do not offer help.

magic falcon
#

that's actually surprising

#

given that jabba brought the hammer down on the topic yesterday

stoic badger
#

That exercise has been around for a while too iirc

lilac holly
#

does a input submit button in html have a onclick attribute?

wraith latch
brazen eagle
#

I assume buttons are clickable (hint use the HTML button element for buttons)

clear lodge
#

I made a little fiddle to demonstrate

#

note how submit types ( input or buttons ) in a form with an action behave differently from a button with type="button". After the alerts show up and you click them away, you'll see that ONLY the button w type "button" does not display a 404 page ( because its just 'clicking', not submitting ). Because the submit types will attempt to submit a form and the button type="button" does not ( 404 ofc because there's nothing to submit to because this is a fiddle πŸ˜‰ )

#

if you are trying something with a form ( since its an input ), this may be a cause for something not working as you expect

lilac holly
#

I have already figured it out

#

Thank you

clear lodge
#

okidoki

surreal bronze
#

@pale pollen ```py
def cree_jeu():
jeu = []
couleurs = ("pique", "coeur", "carreau", "trèfle")
valeurs =("As", "2", "3", "4" ,"5", "6" ,"7", "8", "9", "10", "Valet", "Reine", "Roi")
for couleur in couleurs:
for valeur in valeurs:
jeu.append((couleurs + valeurs))
return jeu
cree_jeu()

pale pollen
#

oh

surreal bronze
#

Here, I modified the code for you - firstly placing it in the function and then returning the actual jeu variable instead of the function

#

does that make sense? pls ask if your confused about anything)

pale pollen
#

i see thanks alot man i was stuck on this

pale pollen
wispy kestrelBOT
#

Gave +1 Rep to @surreal bronze

true pumice
#

L+Ratio @surreal bronze

#

-undelete -a

wispy kestrelBOT
#

Up to 10 last deleted messages (last hour or 12 hours for premium):

none...

surreal bronze
#

can't believe that

true pumice
surreal bronze
ornate wagon
#

ho can halp me learn "Π‘"? Maybe you'll recommend some courses or teach yourself?

wraith latch
brazen eagle
#

In any case yag would have nuked it

heavy rampart
flat oriole
#

Any tools on how to identify which fonts app is using..

true pumice
sick scarab
#

Is anyone familiar with command line arguments in nim? I am trying to use https://github.com/c-blake/cligen but im struggling with the syntax. Anyone have any tips for command line args or familiar with the library above? Also could be I am very new to the language so Im still learning the little things but any insight is appreciated πŸ™‚

GitHub

Nim library to infer/generate command-line-interfaces / option / argument parsing; Docs at - GitHub - c-blake/cligen: Nim library to infer/generate command-line-interfaces / option / argument parsi...

paper sky
#

Hi! I'm a newbie, and made a php webpage to try and test out sql injections, but I can't get past this error... I'm assuming it's a syntax error, but I don't understand why... shouldn't the code at the end be SELECT * FROM users WHERE username=''-- ? (the ' at the end being single quotes)

rich kettle
#

I had to change some code today but did it in the attackbox, later closed and restarted the attackbox, and gone are the changes, I forgot to export them to a distro or vm of my own.
Is there a way to retain the changes and on the Abox. I could have uploaded on Github or something.

onyx merlin
#

Google can teach you

winter mist
#

@flat oriole if you're talking about web applications, often they will be imported in the style sheet. If not, its a matter of exploring the browser dev tools

nova berry
golden lichen
#

Hey, how do I check if a GET request is received using js?

#

I tried googling but no use

magic falcon
#

Your question is kind of nonsensical as stated. What do you mean by 'using js'?

paper sky
golden lichen
magic falcon
golden lichen
magic falcon
#

You are missing the point of my questions, Vain

#

Debian server is completely meaningless in this context

#

Is it an IIS server? Apache? Nginx? Something else?

#

Node? React?

golden lichen
#

ohh, it's apache

magic falcon
#

Ok, that's progress.

golden lichen
#

just plain js

magic falcon
#

Is this .js part of the frontend or backend?

golden lichen
#

backend

magic falcon
#

What's the WSGI plugin to serve backend JS content?

golden lichen
#

I'm using flask

magic falcon
#

You are serving JS backend code with flask

golden lichen
#

yup

#

I should probably use serverless

magic falcon
#

Are you 100% sure you are using a python-based web server with javascript backend code

golden lichen
#

not 100% but I honestly don't know how the hell it's working

magic falcon
#

Check your flask routing code

#

if you see something like

def jsalert('/ping.js'):
    return 'Some value'

then someone is doing weird shit to fake you out

golden lichen
#

got it, gonna read through the code again

magic falcon
#

Here's your steps: Go play around with flask in an environment you control. Understand how it works first, then you can come back to this

#

Especially pay attention to how routing works for this framework

golden lichen
#

Got it

#

thanks Juun πŸ˜„

tulip sail
#

What the actual fuck lmao

surreal bronze
#

Does this mean that I shouldn't use something like turbo flask πŸ˜…

brazen eagle
#

oh hai Muiri

lilac holly
#

@tulip sail should I go for the new ejpt certifcation and then go for oscp and crto etc etc

#

Im currently studying for ccna atm

tulip sail
lilac holly
#

I currently have about 11 python projects which I made and posted to GitHub

#

Which is in my profile

#

I also have good knowledge in networking

#

I can draw the osi model

#

I’m trying to get certs like ceh/oscp/ etc etc

tulip sail
# lilac holly I’m trying to get certs like ceh/oscp/ etc etc

If you're not in India then forget about CEH -- it's, uh, quite literally a meme. Useful as a hiring box to tick in India but useless for learning and not widely respected anywhere else.

A code portfolio is good, especially for red team.

eJPT is good as an on-ramp for other certs, kinda like a confidence boost. It's also got good foundational content, so worth doing if you feel shaky on other aspects of offensive security (you should have networking sorted by the sounds of it πŸ˜†). Definitely recommend OSCP after it, or just straight off if you feel up to it. That's a good foundational one that gives you a solid grounding and is also well respected in industry.

If you want to do red team then CRTO -> CRTL is a really good next step, yes.
I did OSCP -> CRTO -> OSEP personally, which landed me a red team job. CRTL is a recent release but I intend to do it as soon as I have my OSCE3 and probably CHECK.

#

Believe it or not, CCNA is also a really good one to have, especially for infrastructure pentesting jobs, so you're off to a great start with that one.

wispy kestrelBOT
#

Gave +1 Rep to @tulip sail

lilac holly
#

I guess I will not be going for CEH

#

and more to the certifications that you recommended

tulip sail
# lilac holly Thank you a lot for the info

Np πŸ™‚
Yeah, CEH is very much one that you get if you have to and if someone else is paying. Don't waste your own money on it unless you need it to get a job in your area

lilac holly
#

instead of buffer overflow

tulip sail
#

Yes and no. The 2020 changes to the lab material added a chapter on active directory, yes. The exam now also includes an active directory network which is guaranteed, and yes, the buffer overflow may not appear in the exam now.

But it might still show up, so it's not an either/or

#

More like the exam now includes both

lilac holly
paper lily
naive tartan
#

hey can someone help me with bash scripting?? In an if else statement, i need to use two conditionals but i get an error if i use more than one condition

#

such i need to check if its a regular file if [[ -f $FILE ]] then , and if the file is has content [[ -s $FILE ]] then but i am having trouble doing both in one if else statement

brazen eagle
#

bash has an AND and OR statement, yes?

#

hard to see what's wrong without seeing some code πŸ™‚

naive tartan
#

i ended up getting by doing this [[ -f $FILE_NAME && -s $FILE_NAME && ! -d $FILE_NAME ]] and just changing what i was checking for with each elif sorry for not being more elaborate

#

hey what i guessed is actually in this file you sent @magic falcon haha. I was sure i had to use double ampersands but i was formatting it incorrectly. I happen to guess correct just before you sent this but thank you anyways!!

wispy kestrelBOT
#

Gave +1 Rep to @magic falcon

naive tartan
#

im feeling great, i learned this on my own and it feels nice, im happy i figured this out before i read your guys' response because this feels really nice. Thank you both for the help anyways

olive lava
#
# Given an alphanumeric string, return the character whose ascii value is that of the integer represenation of all of the digits in the string concatenated in the order in which they appear.

# For example, given 'hell9oworld7', the returned character should be 'a' which has the ascii value of 97.

strng = 'hell9world7'
def q1(strng):
    lst = list(strng)
    placeholder = []
    for n in lst:
      if n == 0 or n == 1 or n == 2 or n == 3 or n == 4 or n == 5 or n == 6 or n == 7 or n == 8 or n == 9:
        placeholder.append(n)
      else:
        pass
    # return ord(placeholder)
    print(placeholder)

q1(strng)```

Hello, I am struggling to get the right value returned. I tried on a bunch of different variations but my output was always blank.
When I try to print "placeholder", I get a return of '[]' and no numbers are being appended to the variable.
whole yacht
#

variable n is of type string and you try to check for type integer.

9 =/= "9"

vivid dome
#

are can phyton here

lilac holly
vivid dome
#

@lilac hollyyes

lilac holly
#

Search it up

#

You can learn there for free

brazen eagle
lofty vault
#

Hi, is this the right channel for mobile app security?

brazen eagle
zenith river
zenith river
#

also is network + better or CCNA?

magic falcon
#

Depends on region and organization.

#

Look at your local network engineer listings and job reqs

tulip sail
# zenith river Hey, I was just wondering what would you recommend the best route into red team ...

Not a clue w/r to New Zealand -- I'm a Scot. You'll need to check your local jobs to see what they're asking for.
As a general rule, red team tends to become an option after you've got a bit of professional experience as a pentester (although there are exceptions). Some people go straight into pentesting, it's common to go through a SOC first (which, as a side note, is a really good idea anyway if your ultimate goal is red team ops).

W/r to OSCP vs Sec+, it's totally up to you. eJPT is the normal "training wheels" cert for OSCP -- Sec+ is useful in its own right but is quite different in terms of format.
It's quite possible to go straight for OSCP with a few months of cyber experience (that's the route I took, personally), but going for something like eJPT is equally valid. Just up to you and how confident you feel.

#

And yeah, as Juun said, Net+ vs CCNA is quite org specific.
CCNA has the advantage in terms of being more well-known and thus respected, but I hear Net+ covers similar topics, just not Cisco specific.

Personally I would probably still do CCNA (not least because I have the books for it), but again, worth checking what folk are looking for locally.

zenith river
#

I see, thank you for explaining it so in depth!

zenith river
wispy kestrelBOT
#

Gave +1 Rep to @magic falcon

tulip sail
#

Np πŸ™‚

long arch
#

Best programming langauge(s) to prioritize for soc and digital forensics? Learning python right now, I have a strong interest in html (if that counts).

peak echo
#

Anybody know any good bootcamps so I can get better with codeing

solar oasis
#

hi'

#

hi

surreal bronze
#

@true pumice Here ya go, not sure what to do to make websocket / ws secure

surreal bronze
#

Nvm all fixed!

wispy socket
#

can someone help me to make a script that download all these files

true pumice
true pumice
wispy socket
#

I only want to download all, for example not files from these site

wispy socket
#

If i have a situation when I suppose to download more files how can do more fast

true pumice
true pumice
surreal bronze
# surreal bronze https://paste.pythondiscord.com/yexanefubu

well i thought i had to use require wss but instead, I had to replace

var socketServer = new WebSocket.Server({port: WEBSOCKET_PORT, perMessageDeflate: false, key: keys, cert: certys});

w/

var httpsServer = https.createServer(credentials);
httpsServer.listen(WEBSOCKET_PORT);

var socketServer = new WebSocket.Server({server: httpsServer, perMessageDeflate: false});
wispy socket
#

ok, sorry, I will not ask anymore

true pumice
#

index.html

<!DOCTYPE html>
<html>
<head>
  <link rel="stylesheet" href="style.css">
  <meta name="viewport" content="width=device-width, initial-scale=1">
</head>

<body>
  <div class="tablet">
    <div class="content">
      <iframe src="/path/to/main.html" style="width:100%;border:none;height:100%" />
    </div>
  </div>
</body>
</html>

style.css

body {
  background: #f1f1f1;
}


.tablet {
  position: relative;
  width: 768px;
  height: 1024px;
  margin: auto;
  border: 16px black solid;
  border-top-width: 60px;
  border-bottom-width: 60px;
  border-radius: 36px;
}

.tablet:before {
  content: '';
  display: block;
  width: 60px;
  height: 5px;
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #333;
  border-radius: 10px;
}

.tablet:after {
  content: '';
  display: block;
  width: 35px;
  height: 35px;
  position: absolute;
  left: 50%;
  bottom: -65px;
  transform: translate(-50%, -50%);
  background: #333;
  border-radius: 50%;
}

/* The screen (or content) of the device */
.tablet .content {
  width: 768px;
  height: 1024px;
  background: white;
  margin: -1px;
}

Not my code, just adapted

#

@surreal bronze

surreal bronze
#

<style="border: 10px solid transparent; padding: 0px; border-image: url(assets/border.png) 100 round"> thats what I have currently, will checkout your code

#

woahh your code is actully nice!

#

cheers!!

#

I love it, tysm @true pumice

lilac holly
#

Hello

clear lodge
#

@lilac holly check out Jabbas message here: #programming message . If he said no, then dont offer to do it in here either

bold heron
#

And also, computing in general.

rain rover
#

Hello

#

Has anyone ever worked on JIRA here?

rapid hound
#

hello , any help ?

#

HTML code

#

so im doing a website for a restaurant

#

and this is what annoys me

#

why is the <h1> + <h3> which is
Ninety Nine
The joy of food
why is it so down ?

#

i want it under the 99 logo

#

this is the code

<h1> Ninety <span> Nine </span></h1>
<h3>The Joy <span> of Food </span></h3> <br/>


<p> Ninety Nine was founded in 1952 when Charlie Doe opened a pub at 99 state Street in Bosten.<br/>Unlike others 
    Ninety Nine was one of the pioneers of the casual dining concept many years before it becomes common place. <br/>
    In 1962, The restaurant left Boston and moved it's main location to Woburn whcih still stands today.
</p>
#

and the color is css

.left-column h1{
    font-size: 35px;
}
span{
color: red;
}
true pumice
rapid hound
#

Alright ill explain

#

So this is down on the bottom of the page

rapid hound
#

How do I change that and make it on top under the logo ?

#

Basically like that

#

How can I change the paragraph <p> from the bottom of the page to up there

magic falcon
# rapid hound

this is 100% controlled by CSS. Would recommend you go play around with figuring how CSS boxing and layouts work (flow, grid, et al)

rapid hound
#
.left-column h1{
    font-size: 35px;
    text-align: center;
}
span{
color: red;
}
#

asked my friend in class he said i should add
text-align: center;
i did but didn't work

#

ig im gonna have to wait till morning and ask my teacher abou it

magic falcon
#

You need to go experiment with CSS a lot. Here's some food for thought to mull over and meditate on: What's the default behavior for alignment with images and text?

rapid hound
#

so i should add align: top; ? or align: top-left ?

#

left i mean

#

I'll mess with it might find out

clear lodge
#

@rapid hound big tip: open your dev tools, hover over elements in the DOM and look at the box to the right in dev tools and the styles that are applied to each element. You can uncheck ( or add ) styles directly and find out what is causing this content to display as it does πŸ™‚

See also: the box model

rapid hound
wispy kestrelBOT
#

Gave +1 Rep to @clear lodge

brazen eagle
clear lodge
#

it is good to understand how it works

#

as it can bite you in the ass if you don't and you waste 500 hours

#

id say grid/flex are separate things? Its layout, whereas the box model pertains to an element

brazen eagle
#

fair, but I never liked floating things

clear lodge
#

thats good, because you shouldnt :p

brazen eagle
#

it's too unpredictable

#

but yeah the issue above is a layout issue I think

#

and some pretty naive coding

clear lodge
#

I can see a few reasons from the screenshots πŸ˜„

brazen eagle
#

navbar is oddly placed

#

probably should be using classes to style elements

#

I don't think a 2 column layout is appropriate here, but that's my opinion

magic falcon
#

Hence my questions about default behavior πŸ™‚

brazen eagle
#

and even if they want a 2-col layout, they're probably doing it wrong

clear lodge
#

imo Grid is out btw

#

πŸ˜‰ whaha

brazen eagle
#

eh?

clear lodge
#

I never use Grid anymore

#

flex everything pretty much

brazen eagle
#

flex ftw?

clear lodge
#

yeah, I find it much easier in use

brazen eagle
#

I use grid for the main structure in general, then flex everything else

#

but it's a bit clunky to use

#

stupid powerful though

#

but yeah for a single columnar layout, then flex is fine

#

All the web stuff I've done has had a sort of header area, working area with usually 2 columns, and a footer area for actions, so a simple grid handles that well without having to embed a flex in a flex

clear lodge
#

Right

brazen eagle
#

course the whole thing is using Angular anyways, so it's still a charlie foxtrot

#

and don't ask about the shenanigans we've had to pull to integrate that into the vendor's software, because there be dragons

#

pretty sure even the vendor doesn't want to know

clear lodge
#

if I dont jump in on a project later on and get to set up my stuff from the start, I work with a system of columns in columns in columns. So if I need 3 columns in a row, I make 1 column full width, with 3 column children ( inline, 33% each ). Thats how I build my entire layout. Below an X breakpoint it all snaps to vertical stacking. So its fully responsive and it doesn't require using Grid or Flex ( I'll use flex inside the columns themselves though for other stuff )

brazen eagle
#

and then you see abominations like this: https://hilla.dev/

Hilla is a modern framework for Java that integrates a Spring Boot Java backend with a reactive TypeScript frontend. It includes all the UI components and tools you need so you can focus on building your app.

clear lodge
#

css for columns would look like this:

@media only screen and ( min-width: 1440px ) {
    .column {
        width: 100%;
        -webkit-box-sizing: border-box;
        box-sizing: border-box;
        float: left;
    }

    .column::after {
        content: "";
        clear: both;
        display: block;
        height: 0;
        visibility: hidden;
    }

    .column.phi.a {
        width: 38%;
    }

    .column.phi.b {
        width: 62%;
    }

    .column.two,
    .column.four.b {
        width: 50%;
    }

    .column.three,
    .column.three.a {
        width: 33.33%;
    }

    .column.three.b {
        width: 66.66%;
    }

    .column.four,
    .column.four.a {
        width: 25%;
    }

    .column.four.c {
        width: 75%;
    }
}

so you can make any kind of arrangement you want with that. Plus the template is really clear πŸ™‚

Yes, we do use float in this base even though I just said don't use float 😁 only permitted in this specific method, whaha

clear lodge
brazen eagle
#

yeah me neither

#

.<

#

I already gave up on React because I can't understand their model

clear lodge
#

I just go with the flow I guess, pick up w/e client is using. Curse a lot. But just do it, whaha

brazen eagle
#

pretty much

#

cursing and dragons, and other random monsters

clear lodge
#

I can deal as long as Im not cast back to iOS development

#

ahahahah

brazen eagle
#

heh

#

one of these days I'll figure out how to write JS code in Kotlin

#

though to be fair, the Shaker room does that already

clear lodge
#

I have no experience w kotlin but one of my (ex) colleagues raved about it

#

he's a really good engineer

brazen eagle
#

it's a nice language

clear lodge
#

so im tempted to take him seriously is what I mean* lol

#

i might give it a try some time πŸ™‚

brazen eagle
#

well it's nice enough that Java is stealing features πŸ˜›

magic falcon
#

That's what java does! Remember the lambda integration disaster of 1.8?

brazen eagle
deft remnant
#

Anyone have personal/portfolio websites related to cybersecurity/programming? Looking for inspiration for my own project (learning JavaScript so might as well make my own site where I put some CTF write ups/my homelab/certs/projects etc

lilac holly
#

you can look at my repo

deft remnant
#

Thanks sir!

rapid hound
#

not bad ig
still needs alot of work

#

gonna add home pages , some JaveScript effects ,maybe background too

deft remnant
#

@remote echo i like it!!

safe moon
#

does anyone have recommendations on what language to learn first? and a progression from there... i know they say once you learn one you can pick up most others relatively easily.. i started with python and i think that was a mistake

clear lodge
#

very clean code

#

10/10

stoic badger
wispy kestrelBOT
#

Gave +1 Rep to @stoic badger

stoic badger
#

I forgot to send my follow up message πŸ˜…

#

What language you choose to learn next is really up to what things you plan on programming for

Web? Checkout JavaScript and/or TypeScript, PHP, SQL
Want to get into memory-level stuff (reverse engineering, binary exploitation, embedded systems)? Check out C/C++, Rust, or Golang
Mobile? Probably look into Java or Swift depending on the platform

And the list could go on for a while

#

Programming fundamentals stay pretty much the same from language to language, the way in which they’re implemented and used will differ

safe moon
# stoic badger What language you choose to learn next is really up to what things you plan on p...

i want to do pentesting... i tried python first and never grasped it because I wasn't fully invested (just trying to learn a language).. i always wanted to be a "hacker" so i've been passionate about this thm stuff.. I'm almost done with the complete beginner course and i feel like stuff is starting to click. I completed the blue room with no help, which never happened before - so i am a complete beginner

#

so which language is most benefial for pentesters?

potent vault
#

Anyone here gracious enough to give me a little help with a tiny issue im having with my java program

stoic badger
#

Learn Python, then if your needs call for another language, learn a new one

#

Python’s biggest asset is just how easy it is to write something quickly that works very well

safe moon
wispy kestrelBOT
#

Gave +1 Rep to @stoic badger

wheat lotus
#

Hello, someone can recommend materials/website to learn golang?

potent vault
#

Yea i was tired as hell sorry about how lazily i asked for help

#

went to bed woke up and fixed it quite easily haha

brazen eagle
#

That happens

swift marsh
#

yo

surreal bronze
#

πŸ‘‹

#

I'm interested as to why your grandad wants you to do it in less than 10 lines, you could just do that with ; which allows you to multiple statements on one line but thats just not pythonic and not readable at all, why try to squish it in less lines? You want your code to be pythonic and readable

swift marsh
#

haha i dont know

#

honestly didnt know you could do that

surreal bronze
#

Yeah, try it! πŸ˜„

swift marsh
#

lol thats a short cut tho

#

is there a way to make it readable without cheating

surreal bronze
#

probably - again, why? ill have a go, but define "cheating" - ; is a resource given to you, if it works the....:P

swift marsh
#

uhh idk this is a task iv been stuck on for the past 30 minutes or so

#

you can use whatever id just like to be taught

#

like how you would go about it

#

im not good on the programming side of computers

#

πŸ˜…

surreal bronze
#

I would write out what your first thoughts are, and then see what you can improve and remove until you get to less than 10 lines

hollow sorrel
#

weirdly specific

surreal bronze
#

(i know im saying this a lot, but gonna be honest - giving a task of trying to make a program below X lines isn't a great way to learn imo)

#

cc @magic falcon have you ever seen something like this when teaching programing?

hollow sorrel
#

sounds like a teacher-given problem

swift marsh
#

its not i swear i finished school 2 years ago

#

miss it already tho

#

life is a pain

hollow sorrel
#

when did u graduate high school

surreal bronze
#

there self taught, grandad is teaching

swift marsh
#

then went to college but that wasnt great so left and got a job

surreal bronze
#

i am working on it, thats why im not typing btw

swift marsh
#

lol thanks

hollow sorrel
#

well there is a way to make it 10 lines or less

#

heck, you could do it in one line haha

swift marsh
#

yeah jayy explained how i could do that

#

never knew about it lol

hollow sorrel
#

no, not with ;

swift marsh
#

hmm

#

what with ?

hollow sorrel
#

you can do it in one line or so with list comprehension

surreal bronze
#

would love to see that one line without ; πŸ˜„

swift marsh
#

list comprehension ?

hollow sorrel
#

yep. its possible to do the sorting in one line

surreal bronze
#

Okay I have the answer, but how do you think to do it @swift marsh ?

surreal bronze
hollow sorrel
surreal bronze
swift marsh
#

im just able able to make a mini game with if statements and inputs lol

hollow sorrel
hollow sorrel
#

very not pretty code

#

also very weird

surreal bronze
#

@swift marsh ^ thats what I mean by not readable at all

swift marsh
#

lmao

surreal bronze
#

yeah rubbish way to learn

#

But anyways, here:
You know you want to go through each item in the list comparing it with the item next to it right?

swift marsh
#

yes

magic falcon
#

@surreal bronze Premature optimization is the death of understanding

swift marsh
#

i get how it works its just i wouldnt know how to write it out

surreal bronze
#

So to now how many times you want to put in your for loop, you would use what function to check the length of the list?

magic falcon
#

If you want to optimize for something, you have to understand the problem space you are working in

surreal bronze
surreal bronze
swift marsh
#

Ok!

magic falcon
#

And, a restriction on 'number of lines of code' is pretty dumb, to be honest. The point of your code ought to be to understand the problem space, write code that makes sense, not to hit some arbitrary target.

swift marsh
#

or just range

surreal bronze
#
arr = [4,5,1,2,3]
#

what would I use to get the length of thist list?

swift marsh
#

len ?

surreal bronze
#

exactly

#

so we can start of with something like

arr = [4,5,1,2,3]
m = len(arr)
swift marsh
#

😎

surreal bronze
#

okay, now we can do a for loop

#
for i in range(m)

The i will be our index

#

Okay now with a bubble sort, what guaranteed fact do you know after 1 pass?

swift marsh
#

that at least 1 number will be moved

magic falcon
#

Hold up a hot minute. Going through this way isn't a clear way to solve a general problem.

#

Have you spent the time to understand what the problem is, and how to approach it?

surreal bronze
#

quick question is it possible to write a bubble sort program that takes an input of random numbers and outputs the in order but the code is in 10 lines or less ?
thats the original question btw juun

swift marsh
#

^^

surreal bronze
#

can I see your current code for a bubble sort program?

swift marsh
#

mine ?

surreal bronze
#

yeah

swift marsh
#

ok

#

number = int(input("Write numbers: "))
for i > j:
print("in order ", i)

this was all with the current knowledge i have and thats when i realised i have no idea what im doing

surreal bronze
#

oh oh okay

#

I made the assumption that you alredy knew how to program a bubble sort

#

okay scrap getting it under 10 lines, I want you to first code one - no restrictions

swift marsh
#

okay

#

any recommendations on where to start ?

surreal bronze
#

Bubble sort is a simple, inefficient sorting algorithm used to sort lists. It is generally one of the first algorithms taught in computer science courses because it is a good algorithm to learn to build intuition about sorting. While sorting is a simple concept, it is a basic principle used in complex computer programs such as file search, data ...

swift marsh
#

thx

#

would i have to use def bubble_sort(array): in idle python ? i didnt see it anywhere else

surreal bronze
#

How much expierience do you have with functions?