00:00
00:00
Newgrounds Background Image Theme

Forsynth just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

The Flash 'Reg' Lounge

3,047,146 Views | 60,186 Replies
New Topic Respond to this Topic

Response to The Flash 'Reg' Lounge 2016-05-02 20:11:15 (edited 2016-05-02 20:15:31)


At 5/2/16 06:47 PM, MSGhero wrote: Unless I have actually been downloading malicious files every day, i.e. lecture notes for school.

Interesting, I've never heard of someone giving out model numbers before.
My best guess it to look at who knows what computer you have, and then who knows your phone number. Find a correlation and look for any data breaches.
Or possibly just who knows what computer your own. It's far more likely you've given your phone number out than your PC information.

In short, they probably had access to a data breach from a company you gave your info to years ago and forgot about. If you have Win 10, AV, EMET (or the like), and 64-bit Chrome (and basic security knowledge, like "don't enable Word macros") it's REALLY unlikely that you've been hacked.

Seriously, though. I can't hack my own computer from my Kali machine, and I know the damned password for it.

Programming stuffs (tutorials and extras)

PM me (instead of MintPaw) if you're confuzzled.

thank Skaren for the sig :P

BBS Signature

Response to The Flash 'Reg' Lounge 2016-05-02 20:40:45


At 5/2/16 08:11 PM, egg82 wrote: In short, they probably had access to a data breach from a company you gave your info to years ago and forgot about. If you have Win 10, AV, EMET (or the like), and 64-bit Chrome (and basic security knowledge, like "don't enable Word macros") it's REALLY unlikely that you've been hacked.

They don't have my product number, that was from a thread I found online. Though with more digging, I believe there was a data breach around the time the thread was made, which was a few years ago. The guy had my number, first name, and the model of computer I own. Last two I understand, not sure where they got my number from.

Just looked again, and there's another thread within the past few weeks. I guess there was a breach? Their number is listed as a valid number on the site's SE Asia/India page, but this number apparently has also been associated with IRS-related credit card fraud. Maybe that page is fake.

I told them to call back later this week, then I blocked the number.

Response to The Flash 'Reg' Lounge 2016-05-02 20:43:45 (edited 2016-05-02 20:44:08)


At 5/2/16 08:11 PM, egg82 wrote:
Seriously, though. I can't hack my own computer from my Kali machine, and I know the damned password for it.

Do you do something extraordinary to achieve this, or is that more of a general statement? I realize how security-pretentious I sound when I imply Win10, antivirus, and EMET are not extraordinary. I do use Edge, though, only use Chrome these days when I go to a page I know has a billion ads (like cracked.com), or when the page has .webm videos. Once Edge gets plugins later this year, I'll be set.

Response to The Flash 'Reg' Lounge 2016-05-02 21:41:10


At 5/2/16 08:40 PM, MSGhero wrote: Just looked again, and there's another thread within the past few weeks. I guess there was a breach? Their number is listed as a valid number on the site's SE Asia/India page, but this number apparently has also been associated with IRS-related credit card fraud. Maybe that page is fake.

There's a reason they ask "what are you calling about?" when you call them - they re-use numbers for all of their various scams they're running and need to know what they're doing- Netflix, Google, IRS, Facebook, blue screen, collection agency, Nigerian prince,etc.
(What scares me is that they're still sending out "Nigerian prince" e-mails, so they must be working to some degree)

At 5/2/16 08:43 PM, MSGhero wrote: Do you do something extraordinary to achieve this, or is that more of a general statement?

I pentest my home network and servers semi-regularly. There's a Win 7 machine on this network I know isn't secure (but isn't mine, so I simply disassociate all of my everything from it) but after attacking my own PC with all the force I have (even using DoS attacks) I still can't break it. It's a good feeling.

Generally attempting to inject code through SMB standard auth returns me nothing and I get a nice popup from Malwarebytes on my PC. If I use the Veil I also get nothing because EMET pops it as soon as it sees some memory injection. I attacked my browser and got very little as well (though honestly beef doesn't really get me much anyway. Possible cookie stealing and password reset, but that's actually difficult to obtain and can be done more effectively via MitM attacks). I don't store passwords (or any fields) via browser, even if I were to gain access to them. I CAN SSLStrip myself, but I honestly haven't figured out a mitigation for that yet. I'm thinking of turning my Pi into a NIDS and hooking it up to a monitor; looking for ARP spoofing. Somehow hard-setting the router's MAC address in my PC would also work until I get a new router and forgot I did that.

I also tried actually executing a crafted exe on my PC just by double-clicking. It was killed my MBAM, and after I added an exception it was again killed by EMET.

I think that even if I were to manage a standard remote shell I would still at least notice it from GlassWire (which notifies me if anything connects to any network for the first time) so I'm thinking at that point I'd at least know I was screwed and could change my passwords and keys.

I'm going to try just making a custom exe malware since I know that won't be in any definition and see how it goes. I made one a while back that simply pings an IP I own once every day for pentests (seeing how long it takes for IT to notice) but I could turn it into a file downloader/executer and that would have the ability to instantly become malicious. I know GlassWire will alert me, but maybe I can sneak by my other defenses.

I do use Edge, though, only use Chrome these days when I go to a page I know has a billion ads (like cracked.com), or when the page has .webm videos. Once Edge gets plugins later this year, I'll be set.

I'm still not super into using Edge because of IE. I know it's not the same browser, but it's the same company. (you know, the company that refuses to divert attacks like this because fuck you that's why) Once we start getting some solid evidence that it's a secure browser I'll start advocating it.


Programming stuffs (tutorials and extras)

PM me (instead of MintPaw) if you're confuzzled.

thank Skaren for the sig :P

BBS Signature

Response to The Flash 'Reg' Lounge 2016-05-02 22:37:24


At 5/2/16 09:41 PM, egg82 wrote: About half of this went over my head

So if I wanted to hack myself and see if my EMET even does anything, how could I do that? Baby hacks that don't open me up to actual hackers, please.

I'm under the impression that it's a command... "hack random_ip -ransom $100 -lockDrive C:\ -0day"

Response to The Flash 'Reg' Lounge 2016-05-02 22:40:26


Oh, I guess I don't need a NIDS for ARP watching any more.


Programming stuffs (tutorials and extras)

PM me (instead of MintPaw) if you're confuzzled.

thank Skaren for the sig :P

BBS Signature

Response to The Flash 'Reg' Lounge 2016-05-02 22:57:39 (edited 2016-05-02 22:59:10)


At 5/2/16 10:37 PM, MSGhero wrote: So if I wanted to hack myself and see if my EMET even does anything, how could I do that? Baby hacks that don't open me up to actual hackers, please.

1. Grab a VM software like VirtualBox or VMWare (I use VBox because free)
2. Download Kali
3. Setup and run (for network pentests use a bridged network adapter to your own ethernet port/cable so it gets an ip on your actual home network)
4. install as root. I usually recommend disabling root and using a user/pass during install, but for a VM it doesn't really matter
5. when done, open terminal
6. apt-get install kali-linux-full kali-linux-all
7. apt-get update && apt-get -y upgrade && apt-get -y dist-upgrade && apt-get -y autoremove && apt-get autoclean
8. reboot
9. repeat 7&8 until nothing left
10. You're ready to pentest! Go learn Kali.

For your case, I'd honestly recommend next:
1. Terminal
2. service postgresql start
3. msfdb init
4. armitage
6. Hosts->Nmap Scan->Quick Scan (OS Detect)
7. iprange/24 (eg. 192.168.1.0/24 or 10.0.0.0/24)
8. Wait
9. Attacks->Find attacks
10. Either test one by one or Attacks->Hail Mary

I dislike Hail Mary because it's not effective, but if you're new and inexperienced, splattering a bunch of shit on the wall and seeing what sticks works I guess.

I'm under the impression that it's a command... "hack random_ip -ransom $100 -lockDrive C:\ -0day"

That made me laugh harder than it should have :D

Edit: Hyper-V re-enabled itself after updating Win 10. Damnit, now I have to re-disable it so I can get my 64-bit back in VBox and run my Android VMs >:(


Programming stuffs (tutorials and extras)

PM me (instead of MintPaw) if you're confuzzled.

thank Skaren for the sig :P

BBS Signature

Response to The Flash 'Reg' Lounge 2016-05-02 23:48:10


At 5/2/16 10:57 PM, egg82 wrote: Steps

K well I have finals starting tomorrow so see you later.

Response to The Flash 'Reg' Lounge 2016-05-03 13:19:14 (edited 2016-05-03 13:30:39)


Now, this is a story all about how
A website can get all taken down
And I'd like to take a minute
Just sit right there
I'll tell you how to protect yourself because I care

https://www.youtube.com/watch?v=AVbQo3IOC_A

Right, yeah, enough of that.

So I assume most of you own/run/develop websites. Let's say, hypothetically, there was a person or group of people out there sending out phishing e-mails for Blizzard accounts, and someone with some security knowledge doesn't like that. That person has some options for attack. Like I said before, I'm really not great at website analysis, but I have a couple of tools. I also generally don't like denial of service attacks because it reduces your attack surface and is really just a pain in the ass (with little to no skill involved) - but in the case of a phishing website when another opportunity doesn't present itself, I suppose nobody would care if it went down and maybe saved a few people some pain down the road.

Okay, we'll build a hypothetical phishing website. This website will steal people's Blizzard account info, targeting WoW players as before. All the user sees is a fairly-obviously fake URL and a login page that (probably, let's be honest) steals your account info. How would we start the information gathering stage?

First, I like to look at the headers being sent/received to see if the Server header is still set or any other information leaks are happening.

Good (Cloudflare put an extra x-frame-options in there, and added its own Server header)
Bad

Etags, Server, x-powered-by, etc. are all information leaks. We now know this (bad) website uses IIS 6.0, PHP 5.2.7, and ASP.NET
A little research tells us IIS 6 with PHP has an auth bypass exploit, which might come in handy.

Second is to look at the IP address, which we can get via digwebinterface.com - this one points to an IP that isn't behind any sort of service (like cloudflare), so we probably have the real IP. This is dangerous.

If we want to we can start doing some light probing on the server, but let's assume this one is secure and has its holes plugged by ModSecurity (sounds dirty)

Alright, then let's move on to a DoS attack and just prevent people from accessing it to help protect them. Normally I wouldn't recommend this since most servers are shared, but we'll say this one is a virtual host (since most are) and a layer-7 attack won't affect its neighbors adversely whereas a layer-3 (eg. ICMP ECHO, which I can still do with a grand total of ~4Gbit/s under my personal control) would. Let's go for a layer-7 instead.

There's three major attacks: Slow headers, slow POST, and SSL renegotiation. All three of these are helpfully bundled in OWASP's SwitchBlade, program which runs on any platform. You can always look for another one or even make your own- the concept behind all three is pretty simple.

Apache is vulnerable to slow header attacks (aka. Slowloris) and IIS (and others) are vulnerable to slow POST requests. Cloudflare and other IP-hiding services usually easily defeat these attacks, but since we have the real IP we don't need to worry about that.

Now, we simply start our attacking software up (preferably behind a proxy, which is then behind a VPN) and wait a while. Lo and behold, it's gone for as long as we want it to be. IP banned? No problem, just find a new proxy and start again.

The easiest defeat for this is simply hiding your IP via something like Cloudflare (I keep recommending CF because it's both good and free, but use whatever you like)

I do, however, remember a few years ago @3D-Xelu 's Concerned Joe website going down via Slowloris and the mitigation for that not being super difficult. You can read up on other mitigation techniques here.

Now even if your IP was to be discovered, you're still at least safe from a layer-7 DoS.

Welp, there you go. I might end up posting this on my blog.


Programming stuffs (tutorials and extras)

PM me (instead of MintPaw) if you're confuzzled.

thank Skaren for the sig :P

BBS Signature

Response to The Flash 'Reg' Lounge 2016-05-03 13:58:33


Also, seems legit.
I'll probably copy it over to my XP VM and see what it does.


Programming stuffs (tutorials and extras)

PM me (instead of MintPaw) if you're confuzzled.

thank Skaren for the sig :P

BBS Signature

Response to The Flash 'Reg' Lounge 2016-05-04 08:40:40


@egg82 have you heard of wappalyzer? Claims to find out what websites use which technology. I can't verify it's usefulness since I haven't used it, but then again I'm not really in a position where I'd need to use it.


Slint approves of me! | "This is Newgrounds.com, not Disney.com" - WadeFulp

"Sit look rub panda" - Alan Davies

BBS Signature

Response to The Flash 'Reg' Lounge 2016-05-04 18:30:14 (edited 2016-05-04 18:30:47)


At 5/4/16 08:40 AM, Gimmick wrote: @egg82 have you heard of wappalyzer? Claims to find out what websites use which technology. I can't verify it's usefulness since I haven't used it, but then again I'm not really in a position where I'd need to use it.

I haven't, no. Installed it, checked it out, and I'm fairly impressed. I'll keep using it for now and see if it helps with my pentests. Basically I'm hoping it will reduce my absolutely massive potential attack surface into a smaller and more manageable real attack surface. Automatic information gathering for the win.

Also, since when was this a thing?

So I couldn't help but notice IBM was sharing a public-facing quantum computer with the internet. Looks interesting.

Since that was a thing that happened I decided I'd share my knowledge on how quantum computers actually work in terms of RSA encryption breaking. (You know, that HTTPS thing everyone's always on about)

RSA is an offshoot of the DH secure key-exchange algorithm. With Diffie-Hellman, each person in the line of communication ends up with a shared private and public key. The problem with DH is that, on a server, you would need a unique private key for every person that connects to it. DoS attacks ahoy. RSA solves this by basically only generating a single keypair, thus only needing to retain one key and preventing it from running out of memory after a few connections. The browser implements the same, and both the browser and the server only know eachother's public key for encrypting instead of actually handshaking a new key for eachother on every new connection as in the DH specification.

I hope that was clear enough to get a gist of what the differences are between DH and RSA, but since their encryption works in a similar fashion (prime factorization) and DH is easier to understand I decided I'd give my examples via that. Just know the same techniques applied to this example can be applied to a real DH exchange on a larger scale, and then RSA itself for the total compromise of any SSL connection. (SSL being the underlying technology behind HTTPS, so it's not actually limited to just HTTPS. Think SSH)

First, though, a quick clarification on how quantum computers actually work: They're not inherently faster than any normal computer because of some magic quantum mechanic bullshit. They work differently, not faster. Think of it like taking the question you've asked (what are the factors of x?) and twisting it into another question in a way only quantum mechanics can do to achieve an obtainable answer in a reasonable time. (way before the heat death of the universe, which is the amount of time classic computing would take) - also, quantum computers can't solve prime factors on their own because they don't deal in normal mathematics. You still need help from a classical computer to do classical computations.

Right, so there's the general idea. Now to be more specific, we'll talk about how the DH key exchange works. Remember RSA is very similar.
Alice wants to encrypt communications with Bob without either of them previously sharing any contact (as in a random client connecting to a random server)
Eve starts intercepting everything between them.
Alice picks two prime numbers p and g (let's say 23 and 5 respectively, following Wikipedia's article) and sends them to Bob. Eve of course picks these up.
Alice, Bob, and Eve now have the two numbers 23 and 5. It's important to note that in this example 5 is actually a primitive root of 23. It doesn't have to be a primitive root, but the discreet logarithm is lost if it isn't since you would end up with a bias in the resulting numbers, increasing the likelihood of guessing a (not the, but a) correct number.
Alice chooses a secret number a (6 in this case), and Bob chooses a secret number b (15, again following Wikipedia). These numbers are not shared with eachother, so Eve doesn't know what the secret numbers are.
Alice sends Bob a new, computed number A, which is actually just g^a%p (so 5^6%23 = 8, so A = 8)
Both Bob and Eve now also have the number 8.
Bob does the same with his b to get B (g^b%p, 5^15%23 = 9, so B = 19) and sends that to Alice.
Alice and Eve now have the number 19.
It's important to note that while all relevant information has been shared across the wire (Eve gets nothing else aside from encrypted data that Bob and Alice will soon share) still nobody actually has an encryption key.
Both Alice and Bob now compute s. In the case of Alice, s = B^a%p. In the case of Bob, s = A^b%p. Either computation lands you the number 2, which is the shared secret key used for encryption.
Since Eve neither has Alice's a nor Bob's b, she can't know the answer to the final problem presented and thus can't decrypt the messages now being sent between Bob and Alice (who are using the shared private key s, or 2). She can compute everything else with those numbers, just not that.

I found this visualization on Wikipedia extremely helpful in putting basic understanding behind the math when I did my simple implementation of DH in Flash.

This is the DH key exchange, simplified. The real exchange actually involves hundreds of numbers, and thankfully nobody needs to compute g and p since there's a bunch of them included in the specification. Knowing g and p doesn't weaken the security in the slightest, as you might have guessed from looking at the exchange.

The point of DH is the discrete logarithm. In order to break A or B, it requires essentially guessing a or b. You'd need to run through every number between 0 and g-1 to guess the (hopefully single, if g is a generator of p) right result; and since, again, most DH numbers are hundreds of digits long, you'll be there a while. (2^t, where t is the number of bits; eg. 2048-bit DH key would mean 2^2048 computational power required to solve for a or b. ie. brute force would take O*(2^t) time)

This is where quantum computers come in. Shor's Algorithm says: "for b=a^s%N where N, a, and b are known, find s" - which is exactly what we're trying to do here.
There's a lot of theoretical math (and quantum physics) involved, but the gist is this:
x mod y will result in a period. This basically means "how many different numbers will come out of this before it starts repeating?" (because mod results in repeating patterns) - using a primitive root will always yield a period N, but we don't know for sure whether or not that is actually the case. Either way, period finding is still only part of it.
Any way you look at it, finding the period is a start. Quantum Fourier transforms (Sec. 4, Polynomial-Time Algorithms for Prime Factorization and Discrete Logarithms on a Quantum Computer) help us by selecting a random number smaller than N for a and placing the possible values of the algorithm into superpositions, essentially resulting in wrong answers being closer to zero with destructive interference and right answers being closer to one with constructive interference. This means that we have, with high probability, found N's period p. If not, we simply try again with a new random value for a.
For prime factorization, all that's left is to find the greatest common denominator of N and a^(p/2)-1 and we have a factor! This immediately breaks RSA. DH still needs a little more work.

Keep in mind DH is based off the discrete logarithm while RSA is actually a prime factorization problem (which Shor's solves directly)

The best part about all of this? Mathematicians in the late 1700's conceived of both RSA and the quantum algorithms to break it. They were thinking longer-term than the people who actually made SSL.


Programming stuffs (tutorials and extras)

PM me (instead of MintPaw) if you're confuzzled.

thank Skaren for the sig :P

BBS Signature

Response to The Flash 'Reg' Lounge 2016-05-04 18:37:17 (edited 2016-05-04 18:37:45)


I could, by the way, be wrong on a lot of the quantum computing stuff. I did a lot of research, and I'm pretty certain I'm at least very close if not spot-on, though. Theoretical math and quantum mechanics is hard.


Programming stuffs (tutorials and extras)

PM me (instead of MintPaw) if you're confuzzled.

thank Skaren for the sig :P

BBS Signature

Response to The Flash 'Reg' Lounge 2016-05-05 00:58:05


Would anyone here like me to give them some malware? I've been pulling them apart to figure out how they (and the debugging tools I'm using) tick. If anyone else (that I know) is interested.. ?


Programming stuffs (tutorials and extras)

PM me (instead of MintPaw) if you're confuzzled.

thank Skaren for the sig :P

BBS Signature

Response to The Flash 'Reg' Lounge 2016-05-08 03:07:28 (edited 2016-05-08 03:08:38)


http://prnt.sc/b1lai6

Little rough around the edges, but I'll be damned if this isn't exactly what I wanted. I can clean it up tomorrow.
Multithreaded Tor proxy. Anything you point at it gets round-robined through n-Tor nodes for ultimate rate-limit bypassing!

I'll be using this for password guessing during my pentests, but honestly there's a lot that can be done with it. I'll post it on Github when it's cleaned and has the command-line options thing done.

Screenshot of the same website being refreshed twice simultaneously - multithreading ftw!
http://prnt.sc/b1lbyg


Programming stuffs (tutorials and extras)

PM me (instead of MintPaw) if you're confuzzled.

thank Skaren for the sig :P

BBS Signature

Response to The Flash 'Reg' Lounge 2016-05-08 18:35:04 (edited 2016-05-08 18:43:47)


http://prntscr.com/b1u62q
Yay!
20 threads. Each thread has its own circuit, and after 5 uses of a thread it will automatically get a new circuit. (proxy) requests are round-robined through all threads.
All configurable, of course.

Also the release version doesn't spit out quite as much info as you're seeing so you don't get swamped with text.

Source/Binary download: https://github.com/egg82/BruteTorce


Programming stuffs (tutorials and extras)

PM me (instead of MintPaw) if you're confuzzled.

thank Skaren for the sig :P

BBS Signature

Response to The Flash 'Reg' Lounge 2016-05-09 23:47:05


Read this and tell me how this isn't a valid pull request.

http://prntscr.com/b28t05 - "We think people rely on a random number generator producing predictable results"
I can't even fathom..


Programming stuffs (tutorials and extras)

PM me (instead of MintPaw) if you're confuzzled.

thank Skaren for the sig :P

BBS Signature

Response to The Flash 'Reg' Lounge 2016-05-10 01:06:18


At 5/9/16 11:47 PM, egg82 wrote: Read this and tell me how this isn't a valid pull request.

http://prntscr.com/b28t05 - "We think people rely on a random number generator producing predictable results"
I can't even fathom..

The page didn't finish loading before I saw "php" in the address bar, so I tabbed back here to be @Diki.

"Yet another reason why PHP is the stupidest fucking language that human beings could possibly have come up with. I cannot fathom how the developers could be such ignorant fuckwits."

Now I'll go back and actually read what's in the link. 71k issues and pulls tho, wow.

Response to The Flash 'Reg' Lounge 2016-05-10 01:14:02


At 5/10/16 01:06 AM, MSGhero wrote: Now I'll go back and actually read what's in the link. 71k issues and pulls tho, wow.

Ok wait, I'm confused. The RNG used to be seeded and they reverted that, or vice versa, or what? If people are in the comments wondering how a seeded RNG could be useful... I have an alpha I need them to look at.

Response to The Flash 'Reg' Lounge 2016-05-10 09:05:43


At 5/10/16 01:06 AM, MSGhero wrote: "Yet another reason why PHP is the stupidest fucking language that human beings could possibly have come up with. I cannot fathom how the developers could be such ignorant fuckwits."

At least PHP has very helpful and sensible error messages.

Response to The Flash 'Reg' Lounge 2016-05-10 15:11:07


Response to The Flash 'Reg' Lounge 2016-05-11 13:43:47


At 5/10/16 03:11 PM, MSGhero wrote: I fixed some bugs of my own yesterday: http://enkiangames.tumblr.com/post/144158509278/how-i-fixed-2-bugs

those...kinda seem like hacky fixes to me.


Slint approves of me! | "This is Newgrounds.com, not Disney.com" - WadeFulp

"Sit look rub panda" - Alan Davies

BBS Signature

Response to The Flash 'Reg' Lounge 2016-05-11 13:58:54


At 5/11/16 01:43 PM, Gimmick wrote: those...kinda seem like hacky fixes to me.

My rule of thumb is if it's not as bad as this, it's fine http://www.geek.com/games/a-train-you-ride-in-fallout-3-is-actually-an-npc-wearing-a-train-hat-1628532/

Response to The Flash 'Reg' Lounge 2016-05-11 14:13:38


At 5/10/16 01:14 AM, MSGhero wrote: Ok wait, I'm confused. The RNG used to be seeded and they reverted that, or vice versa, or what? If people are in the comments wondering how a seeded RNG could be useful... I have an alpha I need them to look at.

My issue with it is that they named the PRNG mt_rand when it very clearly does not follow the Mersenne-Twister specification. So, if you were planning on using the MT function in PHP and expecting proper values, think again. This could potentially seriously break things that are expecting good values since it's not actually labeled anywhere.

At 5/10/16 09:05 AM, Diki wrote: At least PHP has very helpful and sensible error messages.

Yep, sounds 'bout right.

At 5/10/16 03:11 PM, MSGhero wrote: I fixed some bugs of my own yesterday: http://enkiangames.tumblr.com/post/144158509278/how-i-fixed-2-bugs

That second one is more of a hack than a fix, but alright :P

I bought a server that I'm going to attempt to run 4 KVM Ubuntu machines on to host my two existing servers, plus two servers for.. Possibly friends or something.
Should be a fun experience since this is completely new territory for me. I still have no idea how the machine even has 5 IP addresses attached to its one interface, let alone be able to assign them to each KVM.

Actually, if anyone can help with that it would be much appreciated. Seriously, I have no idea what the fuck I'm doing.

If you're thinking about getting a server like this, then beware: After some server hardening I figured out the machine I just bought comes with root ssh unblocked with no password by default, and within two hours I had several hundred failed SSH attempts. No idea how many succeeded between then, but several reboots and more hardening later and everything looks clean.


Programming stuffs (tutorials and extras)

PM me (instead of MintPaw) if you're confuzzled.

thank Skaren for the sig :P

BBS Signature

Response to The Flash 'Reg' Lounge 2016-05-12 01:31:28 (edited 2016-05-12 01:34:11)


At 5/11/16 01:58 PM, MSGhero wrote:
At 5/11/16 01:43 PM, Gimmick wrote: those...kinda seem like hacky fixes to me.
My rule of thumb is if it's not as bad as this, it's fine http://www.geek.com/games/a-train-you-ride-in-fallout-3-is-actually-an-npc-wearing-a-train-hat-1628532/

I support reusing stuff as much as the next guy but this is just ridiculous.
Edit: That being said I guess this did save a lot of time...


Slint approves of me! | "This is Newgrounds.com, not Disney.com" - WadeFulp

"Sit look rub panda" - Alan Davies

BBS Signature

Response to The Flash 'Reg' Lounge 2016-05-16 01:33:18


The worst part about haxe is that ||= (or equals) is not supported. The dev team is actively against it despite compatibility with AS3. I don't think they like how the boolean to the left of the operator gets shorted rather than the one on the right, and they would rather not implement it than to be ass-backwards to the flash devs coming in.

This code feels like a slap in the face.

while (it.hasNext()) { collision = collision || checkCollision(it.next()); // RIP ||= } return collision;

Response to The Flash 'Reg' Lounge 2016-05-16 02:10:11 (edited 2016-05-16 02:21:54)


At 5/16/16 01:33 AM, MSGhero wrote: The worst part about haxe is that ||= (or equals) is not supported

I'll be honest, I've never heard of that operator.

All of my code is now automatically invalid

So I finally got everything set up, and I started transferring my servers over to KVMs that I control through the dedi. I also found out that Cloudflare gives out free SSL certs, so I issued some for all of my domains. (after fiddling with Let's Encrypt, I decided CF was easier since it literally just gives you a cert file and a key file. No extra work needed.)

basically (for my reference as much as anyone else's):

sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils virt-manager

(You can use X11 forwarding with virt-manager, or just omit it entirely.)

Add yourself to the group:

sudo usermod -a -G libvirtd $USER sudo usermod -a -G kvm $USER

log out and back in again to finish the changes to your group.

We don't need the "default" network that libvirt provides:

virsh net-destroy default virsh net-undefine default

The dedi comes with UFW by default, but it will block access to your KVM machines if you enable it without putting this line below the *filter block:

-I FORWARD -m physdev --physdev-is-bridged -j ACCEPT

After that, you just add the bridge to /etc/network/interfaces (making sure to put in whatever broadcast address they gave you, becuase for some reason it doesn't come in the em1 interface by default)

auto em1 iface em1 inet static address XXX.XXX.XXX.14 netmask 255.255.255.248 gateway XXX.XXX.XXX.13 broadcast XXX.XXX.XXX.19 auto br0 iface br0 inet static address XXX.XXX.XXX.14 netmask 255.255.255.248 network XXX.XXX.XXX.0 gateway XXX.XXX.XXX.13 broadcast XXX.XXX.XXX.19 bridge_ports em1 bridge_fd 9 bridge_hello 2 bridge_maxage 12 bridge_stp off

And finally I made a script to create VMS with my really shit/rudimentary bash skills:

#!/bin/bash get_pw() { local result=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9,._+:@%/-' | fold -w 16 | head -n 1) echo $result } print_help() { echo "Args:" echo "1. name (eg. test)" echo "2. IP (eg. XXX.XXX.XXX.15)" echo "3. SSH user (eg. customer)" } if [ "$1" == "-h" ]; then print_help exit 0 elif [ "$1" == "--help" ]; then print_help exit 0 fi if [ "$#" -ne 3 ]; then echo "Invalid number of arguments." print_help exit 1 fi mkdir -p temp pass=$(get_pw) vmbuilder kvm ubuntu --suite=trusty --flavour=virtual --arch=amd64 \ --hostname=$1 \ --ip $2 \ --gw XXX.XXX.XXX.13 \ --bcast XXX.XXX.XXX.19 \ --mask 255.255.255.248 \ --dns 8.8.8.8 \ --bridge br0 \ --mirror http://us.archive.ubuntu.com/ubuntu \ --components main,universe,restricted \ --addpkg=openssh-server --addpkg=linux-image-generic --addpkg nano \ -t temp --destdir=/var/vms/$1 \ --libvirt=qemu:///system -o \ -m 3840 --cpus 1 \ --rootsize=102400 --swapsize=1792 \ --user $3 --pass $pass \ --verbose echo "SSH Password:" $pass

Yeah, don't forget that --dns bit either. Fought that one for an hour before I went "oh, duh" and added it manually. Also, it won't compile without the linux-image-generic package because reasons.

Then start it:

virsh start $name

You can autostart any vm by:

virsh autostart $name

Or delete it:

virsh destroy $name virsh undefine $name

Finally, if you want to harden ubuntu and fiddle with the /tmp directory (like I did) then you want to do that BEFORE you install libvirt (or at least before you make a VM) because otherwise you'll find your life very difficult.


Programming stuffs (tutorials and extras)

PM me (instead of MintPaw) if you're confuzzled.

thank Skaren for the sig :P

BBS Signature

Response to The Flash 'Reg' Lounge 2016-05-16 02:15:21 (edited 2016-05-16 02:27:33)


At 5/16/16 01:33 AM, MSGhero wrote: while (it.hasNext()) {
collision = collision || checkCollision(it.next()); // RIP ||=
}

return collision;

Wait shit. next() doesn't get called if the collision is already true... I feel like that partially blew up in my face, although the collision check is what I expressly do not want to run if the collision is true. I do kinda want the iterator to keep going...

I think that's what I get for never manually using an iterator before.

Edit: Also, your post reminded me I still need to try to hack myself @egg82. I obviously need sleep now, but I think I'll try it tomorrow/today.

Question: would whatever linux I VM be able to install and compile haxe you think? I need "linux binaries" to compile to linux, but I'm not sure if that's enough. I wonder if bash for Windows counts...

Double edit: wait I think I do want the collision check to run every time. This is what I get for fixing bugs by refactoring.

Triple edit: yeah... didn't need the ||= after all. Still hate that it doesn't exist in haxe. 1AM coding, y'all.

Response to The Flash 'Reg' Lounge 2016-05-16 02:36:51


At 5/16/16 02:15 AM, MSGhero wrote: Question: would whatever linux I VM be able to install and compile haxe you think? I need "linux binaries" to compile to linux, but I'm not sure if that's enough. I wonder if bash for Windows counts...

looks like it, though I still spun up a temp KVM just to try it out and be sure. The answer is: yes it does.


Programming stuffs (tutorials and extras)

PM me (instead of MintPaw) if you're confuzzled.

thank Skaren for the sig :P

BBS Signature

Response to The Flash 'Reg' Lounge 2016-05-16 17:58:12


Managed to get an A+ on SSLLabs by pinning Cloudflare's extra root CA. Not bad for free.
> Insert jibe about NG not getting an A+ or using HTTPS by default here.


Programming stuffs (tutorials and extras)

PM me (instead of MintPaw) if you're confuzzled.

thank Skaren for the sig :P

BBS Signature