Fluxion: Fluxion's xterm windows need to be positioned & verified on all resolutions.

Created on 6 Dec 2017  Â·  30Comments  Â·  Source: FluxionNetwork/fluxion

I'd like some help getting all of fluxion's windows positioned and properly laid out on all resolutions. I made a change to allow placing xterm windows on the top, bottom, left, and right. Those positions need to be fixed for their appropriate resolutions. I've estimated their positions, but can't verify whether they're correct or not.

You can help out by modifying the resolution bit of code in fluxion.sh, starting at around line 271.

Help Wanted Enhancement

All 30 comments

For me the xterm resolutions work. Do you want to add different resolution? If I will try to add them.

The problem is that I added four new positions, and I don't know if they position the xterm windows properly on the lower resolutions. My screen's resolution is 2560x1440, and the system (MacOS) doesn't let me drop it below a 1920x1080, so I can't verify whether or not the new positions are correctly positioning the xterm windows.

I don't know if you've checked out the most recent version. The Captive Portal attack opens six xterm windows, the DHCP server, the DNS server, the deauthenticator (mdk3), the status viewer (showing the attempts and clients), the AP service viewer, showing the AP logs, and the new one is the Web Service access viewer, showing what's being requested from the web server by clients on the rogue network.

There's four windows in the corners, one in the top center, and one in the bottom center. I need to make sure those two, the top and bottom, are centered in all resolutions.

Yeah I will take a look at this problem. Also we might think about a dev/experimental branch. To test such thinks like webserver, resolution etc

Yeah, that's a good idea, that way we don't destabilize the master branch. I was planning on doing that for testing the warning suppression stuff. We can do another branch for that, since that's just tweaking the lighttpd configuration file. We can worry about that later, though. We need to make sure everything else is working correctly, which is why I've been overhauling and correcting some poor choices I've made previously.

Can we should add a master thread with shows what is actually not working. I will start with that. By the way can you edit my comments.

You can edit the post if you want to.

So here is a quick example to understand xterm windows better.

Usage:
xterm -geometry [number of characters, wide] [number of characters, hight] {x pos} {y pos}

Example:
xterm -geometry 100x24+0+0

Will open an XTerm 100 chars wide, 24 chars high in the top left hand corner of the screen
Xterm count from the top-left corner and it is your origin

If you want from the top-left corner use:
xterm -geometry 100x24+0+0

Of course the basic understanding is hopefully clear. So now we want to start from the buttom left
corner using:
xterm -geometry 100x24+0+0

And so one...

Now the tricky part windows in the middle of the screen

We now use following command to count the size:
xdpyinfo | grep dimensions

Sample output looks like this:

dimensions: 1680x1050 pixels (444x277 millimeters)

If we take a closer look we now see that we find the number in milimeter. We need these one.
xdpyinfo | grep dimensions | awk '{print $4}' | sed -e s'/x/ /'g | sed -e s'/(/ /'g

Sure there is a better way, this is only a quick example

Sample output looks like this:

444 277

Now we can use it to launch the xterm windows
Top-middle window:
In this case: xterm -geometry 100x24+444+0

Buttom-middle window:
In this case: xterm -geometry 100x24+444-0

Also here is the generic version:

export  Top-left=$(xterm -geometry 100x24+$(xdpyinfo | grep dimensions | awk '{print $4}' | sed -e s'/x/ /'g | sed -e s'/(/ /'g  | awk '{print $1}' )+0)

export  Buttom-left=$(xterm -geometry 100x24+$(xdpyinfo | grep dimensions | awk '{print $4}' | sed -e s'/x/ /'g | sed -e s'/(/ /'g  | awk '{print $1}' )-0)

I hope you find it usefull

Regards,

deltax

Thanks for the help man. I’ll check out and update the issue table when I find issues originating from fluxion.

Need any help with that or should I add this few lines?

Oh, sorry, I forgot about this. I haven’t used my computer all day because I’ve been having issues with the temperature where I live. The place was recently remodeled and the guy that installed the damn HVAC system forgot to run the heater signal cable (he used the wrong cable), so the heater doesn’t work because it isn’t being activated and it’s cold as hell, lol, it was ~40F(~4C) in here a bit earlier, and were getting snow tonight... like, right now...

It hadn’t been this cold in here, the insulation does a pretty good job at keeping it relatively warm, so we hadn’t tried turning the heater on. Yesterday night it started to get pretty cold. My hands got so cold I started having trouble typing, so I stopped then.

@MPX4132 Where do you live?

@usama7628674 I live in the US. Sorry for being vague, I’m not comfortable sharing details.

@MPX4132 Do you work or are you a student?

@usama7628674 I just graduated. I need to get a driver’s license before I apply for jobs.

@MPX4132 In which field?

@usama7628674 Computer Science, but if you’re asking about what field within computer science, I’d like to work with artificial intelligence. I thought it was interesting when I was studying it, but what really caught my attention was a small incident that occurred involving AI. A friend asked me if I could help him develop an AI with neural networks for his senior project. He wanted to make it play a small “side-scroller” game he had written a couple of weeks before. I agreed to help him and we started working on it. We managed to finished it rather quickly, only four hours after we started, then we rigged it to the game’s controls. Well, he left it learning for 24 hours on his laptop. When he got back to it, he called me immediately to show me what it was doing. The AI had found bugs in his game and was exploiting them excessively to gain a ridiculous amount of points.

All we gave the AI was a reward function. That function allowed it to detect what was good (to kill enemies and progress further to accumulate a higher score), and what was bad (to get hit and death). That’s pretty crazy, we essentially told it what’s acceptable, and what isn’t.

If I do work with AI, though, I would have to be very careful. It could seriously harm people, depending on what it does. I wouldn’t want it weaponized, that’s for sure. It was killing indiscriminately in the game... that’s a bit unsettling for real life. There’s enough crazy people to do that, the last thing we need is machines streamlining genocide.

@MPX4132 That was interesting story.So you learn bash during graduating or what?

@MPX4132 don't worry I don't have time at the moment either. I try to answer issues and make some improves. In general good luck with your situation, hope the HVAC system will get repaired.

Edit: Well I have also experiences with AI too.

Some weeks ago I started a project about face detection. Sounds not very interessting but I promise you, it is. I used the OpenCV lib and I wrote a insta, facebook and tumblr crawler. The data was so huge that even my 6tb hard drives are now full.
The reason was that I want to catch faces on a photo and check if they match with my local lib. In some cases it does! It was even possible to get in some cases the name or other sensitive data without even knowing here. It was only because the person post some pictures about himself/hereself online and he/she forgotte to make the profile private. So I download all pictures of the profile and delete all pictures without a face. Finally I make a notice about his profile which was all done with my script. Pure 100lines python code.

@usama7628674 I learned bash when I took the Linux class in my sophmore year. When I picked up fluxion, I had forgotten most of it till I looked at the script. [Mostly] everything came back when I saw it.

@deltaxflux Thats pretty neat, and that was probabaly with a simple computer. It’s a bit unsettling what governments could do with the power they’ve got and modern technology.

By the way, we got the guy to come fix the HVAC heating issue. It was just like I suspected, he used the wrong cable and didn’t hook up the damn heat signal wire because it didn’t have one.

Well I agree the govement is still powerfull.

@deltaxflux I'll try to work on this using the info you gave me later on today.

@MPX4132 good I will start with the mac enhancement

Can somebody confirm that the xterm terminals are to big. For me they don't fit well I definetly have to take a look again maybe we should reduce the xterm size.

@deltaxflux What's the resolution you're having sizing issues with? That's what I meant when I opened this issue/request, I couldn't test it on all resolutions so I needed help figuring it out.

I wanted to try making it dynamic, so that it can auto-adjust depending on resolution, but I ran into the problem with pixels vs terminal columns. The number of pixels per column isn't a fixed value, and changes depending on the font-size being used in the terminal.

I wanted to implement auto-calucation of the screen's four centers (top-center, bottom-center, left-center, and right-center), but ran into that issue. I can get the size of the xterm terminals with xwininfo (if I remember correctly), but I need to try more things to see if we can get a mathematical function to get the offset so that the xterm terminal window ends with its center at the center of the screen. For example, an xterm terminal being centered at the top, should have the center of the xterm terminal at the center of the screen.

Again, the issue is with the font-size, because the font size changes the width of the column in the terminal, so I can't do something like:

get_window_size(window): return window.columns * column_width_constant
# Won't work because column_width_constant varies!

Yes but I post a detailed post later.

Or maybe we should change this hole xterm thing and switch to tmux. Because there are some main advantages:

  • easier to handle / no resolution is required
  • less power consumption
  • possible to run this attack over ssh
  • better for all geeks using a clip

disadvantages:

  • take time to implement

I run fluxion on a headless Raspberry Pi, so I use ssh when I’m testing it, I just forward X:

ssh -X [email protected]

I use tmux pretty regularly as well. The only major advantage I see with it is that it doesn’t kill processes executing when the ssh connection fails for whatever reason.

I think tmux would add a bit of complexity because it has lots of key combinations. People that hate vim will likely hate tmux. I’m fine with both, but I know lots of people are not.

There’s a relatively simple solution to the resolution problem, but I think it’s a bit annoying. We can make two different xterm windows, a regular size, and an expanded size (for the scanner, since it requires a wider xterm). We can then have a calibration period when fluxion starts where the windows open up, log their width, and close. Those values can then be used to auto center the windows. I would prefer if we could run that in the background without actually starting two different xterm windows for calibration, but I don’t know if that’s possible.

Your right. I forgot to think about the easy ssh method.

People that hate vim will likely hate tmux

I would agree with that too. For me personally, I love vim/nvim and of course tmux and I can't work without them. So I might see this a bit different. In general, I think it would be too complicated to learn all key combination for just a simple noob friendly program and I would also agree that the xterm windows are definitely repairable.
I will check if there is any good solution out there to measure the screen size and calculate the window size. I have done this in cpp but I think that would be strange if we need to implement that but I don't have any problem with that eighter.

[...] a regular size, and an expanded size

Yeah, I agree. The scan window should get big but the other windows like the ap, DHCP, handshake log window doesn't need to be so tall.

auto center the windows

We have done this already. Only the window size matters in this particular problem.

Regards

Deltax

Was this page helpful?
0 / 5 - 0 ratings

Related issues

S3cur3Th1sSh1t picture S3cur3Th1sSh1t  Â·  5Comments

SyntaxError843 picture SyntaxError843  Â·  9Comments

scratchmex picture scratchmex  Â·  7Comments

Gabo1203 picture Gabo1203  Â·  14Comments

christiantokevin picture christiantokevin  Â·  16Comments