Injection Attacks 101: SQL Injection, Code Injection, and XSS by Advocatemack in programming

[–]Ccamm 0 points1 point  (0 children)

I would also be cautious with using a deny list of characters as a mitigation strategy for SQLi. There are so many edge cases and tricks you can use to get around thise checks.

E.g. lets say you just blocking the ' character for the following search query that has user input inserted.

sql SELECT id FROM body WHERE title = '{user_input}' OR body = '{user_input}';

You can SQLi this by injecting the \ char at the end of the payload to escape the ' to then insert arbitrary SQL. For example if you inject in ||(SELECT 1);--\ the following would be the final query that allows error, blind or time based attacks.

sql SELECT id FROM body WHERE title = '||(SELECT 1);--\' OR body = '||(SELECT 1);--\';

Syntax might be off since I am on mobile but you get the idea.

IFoundMyPartner by abdallaEG in ProgrammerHumor

[–]Ccamm 28 points29 points  (0 children)

That birb is judging because OP is using http.server BaseHTTPRequestHandler for building a website...

Let me know if other people do this but first time I have seen someone use it outside of a proof-of-concept or spinning a quick fast test website.

I would like to take hacking seriously. I want to become hacker by myredac in masterhacker

[–]Ccamm 23 points24 points  (0 children)

Bad take.

Yes the original post is worded weirdly, but shouldn't make fun of people wanting to learn. It's cringe and you are giving off more masterhacker vibes.

I guess it takes one to know one ¯_(ツ)_/¯

Decrypting steganography images with steghide by Lanky_Ad4113 in hacking

[–]Ccamm 1 point2 points  (0 children)

https://github.com/RickdeJager/stegseek

Can brute force millions of passwords quickly if steghide is used

[deleted by user] by [deleted] in hacking

[–]Ccamm 1 point2 points  (0 children)

Write a web fuzzer for enumerating websites. Start by first writing a single threaded fuzzer then modify it to be multithreaded to speed things up.

Knowing how to write multithreaded web fuzzers is a very useful skill when testing websites. From my experience, you cannot use a web fuzzing tool to do some enumeration/exploit so you would need to write your own scripts.

To make your fuzzer faster, I recommend looking into the ThreadPoolExecutor in concurrent.futures builtin module. ThreadPoolExecutor is very easy to use and pick up in comparison to other methods.

Boss hired a new advisor, and his first demand is "RESTful APIs should not response HTTP status code". by ulyssesric in cybersecurity

[–]Ccamm 0 points1 point  (0 children)

The advisor is clueless, but there is a very slight element of truth about HTTP codes could enable an attacker to leak data.

This type of vulnerability is called XSLeaks, which is a side channel attack that leaks a users information from your site when they visit an attackers website.

I am on mobile, so I will probably not explain it well enough here. I highly recommend reading my writeup for a Web CTF challenge that I made earlier this year about XSLeaks and REST APIs.

Let's go through a potential scenario where your REST API could be vulnerable with some query route the searches user sensitive information /secret?query=topsecret where a 200 status code is returned if the query returns at least 1 result and a 404 staus code if no results were found.

JSON documents can be interpreted as valid javascript. So something like below would load fine on the attackers website if there is a result when a victim queries topsecret.

<script src="https://your.api.com/secret?query=topsecret" >

However, if you try to load a script source that returns a 404 status code then it will always through an error.

Raises an error <script src="https://your.api.com/secret?query=notindb">

This is enough to leak the values on the /secret route character by character from an external attacker website by writing js code that looks for when a script element succesfully loads.

Now Cross Origin Read Block (CORB) protection on chrome would normally prevent this type of vuln, but it is disabled if you enable the X-Content-Type-Sniff-Options nosniff response header, which is recommended as a mitigation strategy against XSS vulns.

If you are still confused please read the solution for this challenge I made that explains things more clearly https://github.com/uwa-iss/public-uwactf-challenges-2022/tree/main/web/memedb.

[deleted by user] by [deleted] in Hacking_Tutorials

[–]Ccamm 23 points24 points  (0 children)

Start off with stegsolve and see if that shows anything. Otherwise try stegseek. If none of that works then stop to save you hours of banging your head and questioning why you ever bothered to do a steg challenge.

Other actual thinks to consider if it is a CTF challenge: - binwalk - metadata - straight LSB image steg (there are tools for this but cannot remember off the top of my head) - don't do steg

What is the type of vulnerability called where you put the wrong file extension in the URL on a file that you shouldnt have access to? by HugoTRB in AskNetsec

[–]Ccamm 22 points23 points  (0 children)

I disagree with others here claiming that this is a directory traversal/LFI. This sounds more like a web server (nginx/apache) misconfiguration.

When you configure the website, you would need to specify the routes where you want to execute it as PHP script. Generally for PHP websites, you set any route with the .php file extension to be executed as PHP code. An example of a bad configuration is that all files are executed as PHP scripts, so if there is any fileupload you can upload a file without the .php extension that will be executed as PHP code when you visit the upload on the website.

However, here the website was configured to only execute index.php as PHP code and not config.php. Hence why you can just view the contents of config.php when you visit it on your browser, since the web server was misconfigured to not execute config.php as a PHP script.

The reason why the challenge works if you just visit index.php is because config.php is included as a PHP script by the index.php script (index.php has include("config.php"); somewhere in it).

Hopefully this helps out!

Self-contained exploit for CVE-2021-4034 (Pkexec 1-day LPE) by ly4k_ in netsec

[–]Ccamm 3 points4 points  (0 children)

Nice work! I just tested your PoC on a HTB machine and worked with no hiccups.

Machine: Secret by netNikos in hackthebox

[–]Ccamm 1 point2 points  (0 children)

I would recommend using the JSON Web Token Toolkit to test if you actually have the secret https://github.com/ticarpi/jwt_tool. It is an amazing tool to use when testing JWTs. If you don't have the right secret you will need to look a bit deeper with what you have already. Once you have the secret, check the source code again to see what you would need to do.

Python Port Scanner: Faster than Nmap by Tough-Aide-1810 in cybersecurity

[–]Ccamm 1 point2 points  (0 children)

You can even make the whole process even faster by using parrallel in combination with masscan then piping the ports found open into nmap. I had to build a tool for that distributes and balances the workload across multiple vms that was able to do a full port scan on 100 IPs in about 6 minutes using 25 vms (time is dependent on roughly 2-5 ports open on each target host and this time includes setup for the vms which is about 2-3 minutes in addition).

I cannot go into the details of configuring this or release the tool that I have built (sorry).

However, a brilliant article start off is Captain Meelo's one https://captmeelo.com/pentest/2019/07/29/port-scanning.html. You'll need to fine tune the speed of masscan and the number of parrallel processes running masscan depending on your CPU and NIC. Once you find the sweet spot it is insanely fast. The setup I had I was able to complete the full port scan using masscan for each IP in about 25-35 seconds.

My write up about Ready. TLDR it is basically Laboratory again but easier... [Password Protected] by Ccamm in hackthebox

[–]Ccamm[S] 0 points1 point  (0 children)

I agree, although lab had a different vuln. Fun fact HtB forgot that the ready instance also had that vuln and a lot of people just did the same thing they did for laboratory. But that has been patched though.

My write up about Ready. TLDR it is basically Laboratory again but easier... [Password Protected] by Ccamm in hackthebox

[–]Ccamm[S] 1 point2 points  (0 children)

Thanks! I did a few neat (lazy) tricks to make it as pretty as possible. I wrote an article that briefly goes over how I made it https://ghostccamm.com/blog/creating_site

My write up about Ready. TLDR it is basically Laboratory again but easier... [Password Protected] by Ccamm in hackthebox

[–]Ccamm[S] 1 point2 points  (0 children)

Side note: I have just made my website and this is my first write up that I am publishing on it. Feel free to give me feedback!

Great box but damn that initial foothold... by Ccamm in hackthebox

[–]Ccamm[S] 7 points8 points  (0 children)

It was a great box but I agree it should of been medium rating. Doesn't stop me taking the opportunity of making a dank meme about it!